Hi all,
i was trying to create a google map layer for a hebrew website but encountered a problem:
under /admin/structure/openlayers/layers/settings under google's section there's a text field for choosing google maps display language. whatever lang code i inserted always resulted in english maps. after a lot of searching i found that there is a wrong param name in the JS call for google maps API in the HTML Head section:
original code:
http://maps.google.com/maps/api/js?sensor=false&v=3.5&hl=X
Should become:
http://maps.google.com/maps/api/js?sensor=false&v=3.5&language=X
while X = 2 character language code from google documentation (ie "iw" for hebrew).
1. to fix this line go to your OpenLayers directory to:
openlayers/plugins/layer_types/
2. edit the file "openlayers_layer_type_google.inc".
3. around line 141 change this:
$url .= !empty($lang) ? '&hl=' . $lang : '';
to this:
$url .= !empty($lang) ? '&language=' . $lang : '';
I tried it only with API v3.5.
Comments
Comment #1
zzolo CreditAttribution: zzolo commentedHey @SHS, thanks for catching this. It would have been helpful if you found the documentation for it (see below). I think we should support both parameters.
v3 uses langauge
https://developers.google.com/maps/documentation/javascript/basics#Local...
v2 uses hl (though its a deprecated API, we should still support)
https://developers.google.com/maps/documentation/javascript/v2/basics#Lo...
Comment #2
zzolo CreditAttribution: zzolo commentedOk, committed and fixed.
http://drupalcode.org/project/openlayers.git/commit/13b42ae