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:

Should become:

while X = 2 character language code from google documentation (ie "iw" for hebrew).

1. to fix this line go to your OpenLayers directory to:

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.


zzolo’s picture

Version:7.x-2.0-beta1» 7.x-2.x-dev

Hey @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

v2 uses hl (though its a deprecated API, we should still support)

zzolo’s picture

Status:Active» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.