From: Stéphane Jacob Date: Wed, 18 May 2011 08:45:22 +0000 (+0200) Subject: Puts maps data in configuration files. X-Git-Tag: xorg/1.1.2~62^2~15 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=559cef11ddcccec3c0ba866d19395c7ef1015477;p=platal.git Puts maps data in configuration files. Signed-off-by: Stéphane Jacob --- diff --git a/configs/platal.ini b/configs/platal.ini index 6a5ce41..658f728 100644 --- a/configs/platal.ini +++ b/configs/platal.ini @@ -237,6 +237,24 @@ gmaps_language = "fr" ; Default location preference. gmaps_region = "fr" +; The maps section contains parameters used to display maps. +[Maps] + +; $globals->maps->static_map +; URL of Google Maps api for static maps +static_map = "https://maps.googleapis.com/maps/api/staticmap" + +; $globals->maps->dynamic_map +; URL of Google Maps api for dynamic maps +dynamic_map = "https://maps-api-ssl.google.com/maps/api/js" + +; $globals->maps->api_version +; Current Google Maps API version +api_version = "" + +; $globals->maps->language +; Language to be used in maps. +language = "" ; The lists section contains parameters used to interact with mailman. [Lists] diff --git a/modules/geoloc.php b/modules/geoloc.php index b8b452d..e98d945 100644 --- a/modules/geoloc.php +++ b/modules/geoloc.php @@ -30,8 +30,11 @@ class GeolocModule extends PLModule function handler_map($page) { + global $globals; $page->changeTpl('geoloc/index.tpl'); - $page->addJsLink('https://maps-api-ssl.google.com/maps/api/js?v=3&sensor=false', false); + + $map_url = $globals->maps->dynamic_map . '?&sensor=false&v=' . $globals->maps->api_version . '&language=' . $globals->maps->language; + $page->addJsLink($map_url, false); $page->addJsLink('maps.js'); $page->assign('pl_extra_header', ''); diff --git a/templates/geoloc/form.address.tpl b/templates/geoloc/form.address.tpl index 33c32a5..b05ac49 100644 --- a/templates/geoloc/form.address.tpl +++ b/templates/geoloc/form.address.tpl @@ -53,7 +53,7 @@ {/if} {if t($address.latitude)} - Position de l'adresse {if t($geocoding_removal)}
diff --git a/upgrade/1.1.2/README b/upgrade/1.1.2/README index 272bed9..5cbee98 100644 --- a/upgrade/1.1.2/README +++ b/upgrade/1.1.2/README @@ -1,2 +1,7 @@ Once all sql/php scripts have be run, run retrieve_address_tables.sh and finally xx_retrieve_geocoding.sql. Then "./formatAddresses.php -g -t g -r e" will format the last ungeocoded addresses. + +Additions to platal.conf: +[Maps] +api_version = "3.4" (depending on current version when releasing) +language = "fr"