added api key to minimap url
This commit is contained in:
@@ -311,7 +311,7 @@
|
||||
*
|
||||
* Coordinates of new caches are appended to the url.
|
||||
*/
|
||||
$opt['logic']['minimapurl'] = 'http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=220x220&maptype=roadmap&markers=color:blue|size:small';
|
||||
$opt['logic']['minimapurl'] = 'http://maps.googleapis.com/maps/api/staticmap?sensor=false&key={gmkey}&size=220x220&maptype=roadmap&markers=color:blue|size:small';
|
||||
|
||||
/* target vars
|
||||
* all _REQUEST-vars that identifiy the current page for target redirection after login
|
||||
|
@@ -103,7 +103,18 @@
|
||||
// enable minimap for new caches if url is set
|
||||
if ($opt['logic']['minimapurl'] != '')
|
||||
{
|
||||
$tpl->assign('minimap_url', $opt['logic']['minimapurl']);
|
||||
// get the correct api key for google maps
|
||||
$gmkey = '';
|
||||
$sHost = strtolower($_SERVER['HTTP_HOST']);
|
||||
if (isset($opt['lib']['google']['mapkey'][$sHost]))
|
||||
$gmkey = $opt['lib']['google']['mapkey'][$sHost];
|
||||
|
||||
// build static maps url by inserting api key
|
||||
$url = $opt['logic']['minimapurl'];
|
||||
$url = mb_ereg_replace('{gmkey}', $gmkey, $url);
|
||||
|
||||
// put into template
|
||||
$tpl->assign('minimap_url', $url);
|
||||
$tpl->assign('minimap_enabled', true);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user