We recently updated our google service to the premier service and as a result the syntax for calling into the page the API is different.
http://code.google.com/apis/maps/documentation/webservices/#BuildingURLs
http://maps.googleapis.com/maps/api/staticmap?center=%E4%B8%8A%E6%B5%B7+%E4%B8%AD%E5%9C%8B&client=clientID&sensor=true_or_false
is now the proper syntax.. there is no longer a "key" parameter.
From Google about the key param:
"Including this parameter contravenes the API syntax... including this parameter will cause these requests to fail in the near future."
Unfortunately the Keys module doesn't let me actually change the name of the "key" parameter
I've found a way to remove the key from the query in the gmap.module core, but it seems hackish...
line: 326
'key' => gmap_get_key(),
to line 326:
'client' => gmap_get_key(),
and line 1112
$data = drupal_http_request('http://maps.google.' . $tld . '/maps/geo?q=' . drupal_urlencode($address) . '&output=csv&key=' . $key);
to line 1112
$data = drupal_http_request('http://maps.google.' . $tld . '/maps/geo?q=' . drupal_urlencode($address) . '&output=csv&client=' . $key);
Anybody else encountered this and come across a better fix? Is there some setting I'm missing here?
Technically I don't think you are even supposed to be geocoding and storing results per the terms of service agreement without a Google Maps Premier key, so why would it not be set up to support that?
Comment | File | Size | Author |
---|---|---|---|
#11 | added-gmap-client-and-channel-id-option-for-premium-1183868-11.patch | 2.81 KB | k_a_l |
|
Comments
Comment #1
tmsimont CreditAttribution: tmsimont commentedI made a patch that replaces the API key with a client ID, and adds a field for the super secret crypto key that then gets used to generate the signature parameter with a php base64 HMAC-SHA1 algorithm. it works for me, but wipes out the ability to use anything other than the premier client-id/signature set up.
Also I hard coded sensor=false -- which is bad and lazy but I didn't need it... maybe somebody can set that up in the settings_ui.inc and make this better..
I made a few other changes to the way the link gets written into the head -- why were BOTH check_url() and url() being used before?? Replacing query string delimiters (&) with %26amp%3B seems kinda silly to me....
Comment #2
podarokall feature requests can be imported in 6.x version after committing em in major versions with backport afterwards
Can You make this ?
Comment #3
tmsimont CreditAttribution: tmsimont commentedUnfortunately I've not longer got access to a premier account. I don't think I'll be able to work on this as I won't have an account to use for testing.
Comment #4
podarokIf someone can reproduce a bug and post a patch against latest major dev version - please, feel free to open his issue
Comment #5
k_a_l CreditAttribution: k_a_l as a volunteer commentedI needed to add these parameters and figured I'd integrate these changes into the ui. Hopefully this is helpful or useful for someone.
Comment #7
k_a_l CreditAttribution: k_a_l as a volunteer commentedprevious patch was based off my site structure.
Comment #8
k_a_l CreditAttribution: k_a_l as a volunteer commentedComment #10
sasstevens CreditAttribution: sasstevens commentedCurrent patch omits filling the field with the existing saved data, but otherwise works well.
Comment #11
k_a_l CreditAttribution: k_a_l as a volunteer commentedPatch now adds existing saved data to client and channel form fields.