diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2016-08-25 14:04:32 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2016-08-25 16:33:23 +0200 |
| commit | c82b65c8552a2ddccb9ac9990366c03199ff9d29 (patch) | |
| tree | f46e2f342b4fcabe0321221c500efa557ab85811 /addons/website_google_map/views/google_map_templates.xml | |
| parent | 251344903d1ddee1672c4030b87349cd29fdc934 (diff) | |
[IMP] website, website_{*}: Google Maps API Key
As of June 22 2016, the use of API key is required to access the
following:
- Google Maps JavaScript API
- Google Static Maps API
- Google Street View Image API
https://developers.google.com/maps/pricing-and-plans/standard-plan-2016-update
For domains accessing the API before June 22, it will still work without
an API key. Since Google advises to use the API key, we hide the Maps if
no API key is defined.
Diffstat (limited to 'addons/website_google_map/views/google_map_templates.xml')
| -rw-r--r-- | addons/website_google_map/views/google_map_templates.xml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/website_google_map/views/google_map_templates.xml b/addons/website_google_map/views/google_map_templates.xml index 944bcae5b1b..7b623676789 100644 --- a/addons/website_google_map/views/google_map_templates.xml +++ b/addons/website_google_map/views/google_map_templates.xml @@ -14,7 +14,12 @@ var odoo_partner_data = <t t-raw="partner_data"/>; </script> <div id="odoo-google-map"></div> - <script src="//maps.google.com/maps/api/js?sensor=false"></script> + <t t-if="google_maps_api_key"> + <script t-attf-src="//maps.google.com/maps/api/js?key=#{google_maps_api_key}"></script> + </t> + <t t-else="1"> + <script src="//maps.google.com/maps/api/js"></script> + </t> <script type="text/javascript" src="/website_google_map/static/src/lib/markerclusterer.js"></script> <script type="text/javascript" src="/website_google_map/static/src/js/website_google_map.js"></script> </body> |
