#2 — Google Maps URL always produces 'incorrect key' message

State Resolved
Version:
Area Functionality
Issue type Patch
Severity Medium
Submitted by David Breitkreutz
Submitted on Sep 01, 2009
Responsible
Target release:
Due to the URL the google_maps_js function returns, any rendered map using Google Maps will produce a message about the API key being incorrect. This is because the returned value already has ampersands encoded as &. When rendered, the '&' becomes '&', resulting in no key value actually being sent.

Implementing this change fixes the problem:

Index: collective/geo/settings/browser/geosettings_macros.py
===================================================================
--- collective/geo/settings/browser/geosettings_macros.py (revision 96317)
+++ collective/geo/settings/browser/geosettings_macros.py (working copy)
@@ -31,6 +31,6 @@
     @property
     def google_maps_js(self):
         if self.googlemaps:
- return 'http://maps.google.com/maps[…]&v=2&key=%s' % self.googleapi
+ return 'http://maps.google.com/maps?file=api&v=2&key=%s' % self.googleapi
         else:
             return None
Added by David Breitkreutz on Sep 01, 2009 01:41 AM
Fixed in revision 96318.
Added by Giorgio Borelli on Sep 28, 2009 10:58 AM
Issue state: UnconfirmedResolved
Target release: None0.2

No responses can be added.