I have a view page which show the location of a few node on a google map. This works fine with the English version of the page , but when I try the dutch version i get the "Javascript is required to view this map" error.

For some stranger reason this only occurs when the view is linked in a menu item.

I looked at the generate javascript code and i noticed that the only difference was that decimal Point het changed in to a comma. How do i prevent the translation of coordinates?

Comments

sstrong’s picture

I'm having this same issue... seeing that your question has gone 3 months without an answer is frightening.

pixelpreview@gmail.com’s picture

yes I confirm when I create a view with gmap display, I have no problem when I look this view in english but when I look at it in french ... the [data] in top of page are wrong

"id": "commercesmap", "longitude": "4.329643249511719", "latitude": "50.604377386224", "markers": [ { "latitude": 50,69711, "longitude": 4,420452, "markername": "lblue", "offset": 0,

see the variable longitude and latitude of the markers, the decimal numbers are written with a comma and not a point in french ! and that breaks the javascript for the page : "longitude": 4,420452,

in gmap_plugin_style_gmap.inc on line 187, I have changed these lines :

 $markers[] = array(
            'latitude' => $lat,   
            'longitude' => $lon,

to

 $markers[] = array(
            'latitude' => "$lat",   
            'longitude' => "$lon",
iorgie’s picture

Version: 6.x-1.0-beta4 » 6.x-1.1
Priority: Normal » Major
Issue tags: +gmap, +bug, +content translation, +comma decimal point, +decimal, +comma

Same problem here. Site is dutch and the output of the module uses comma's in the lat en long.

<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "gmap_markermanager": [  ], "gmap": { "auto1map": { "width": "700px", "height": "600px", "zoom": 9, "maxzoom": "14", "controltype": "Small", "align": "None", "maptype": "Physical", "mtc": "standard", "baselayers": { "Map": 1, "Satellite": 1, "Hybrid": 1 }, "styles": { "line_default": [ "0000ff", "5", "45", "", "" ], "poly_default": [ "000000", "3", "25", "ff0000", "45" ], "highlight_color": "ff0000" }, "line_colors": [ "#00cc00", "#ff0000", "#0000ff" ], "behavior": { "locpick": false, "nodrag": 0, "nokeyboard": 1, "nomousezoom": 0, "nocontzoom": 0, "autozoom": 0, "dynmarkers": 0, "overview": 0, "collapsehack": 0, "scale": 0, "extramarkerevents": false, "clickableshapes": false, "googlebar": 0, "highlight": 0 }, "markermode": "0", "shapes": [ { "type": "line", "style": [ "ff00ff", "1", "100" ], "points": [ [ 52,489333, 5,073 ], [ 52,464, 4,594 ], [ 51,824333, 4,120333 ] ] } ], "longitude": "-143", "latitude": "-16", "id": "auto1map" } } });
//--><!]]>

The suggestion made by pixelpreview doesn't work for me, maybe because i am using a line and he is using markers. Just give me a hint to find the code producing this text.

http://php.net/manual/en/function.number-format.php might be the solution, but where to put it?

iorgie’s picture

Problem still exists in 6.19 with gmap 6.x-1.1

Would be nice if somesone gives this bug some attention

iorgie’s picture

Changing the default site language to English solves the problem for now. Can I conclude this is a Drupal bug not an Gmap?

iorgie’s picture

Project: GMap Module » Drupal core
Version: 6.x-1.1 » 6.19
Component: Code » locale.module

The locale module edits the output of the Gmap module. This module outputs a lot of javascript.

using English:

[ 50.36, -3.577 ], [ 50.153833, -5.062833 ], [ 50.155167, -5.065333 ], [ 49.43, -5.68 ]

Usin Dutch:

[ 50,36, -3,577 ], [ 50,153833, -5,062833 ], [ 50,155167, -5,065333 ], [ 49,43, -5,68 ]

Which brings me to the next two questions:
-Why the hell would the locale module process / edit javascript output of another module?
-I know different languages use different symbols for decimal separation ie comma or point. Where can i change this setting?

----------
There is no such setting in http://ftp.drupal.org/files/translations/6.x/drupal/drupal-6.19.nl.po Looking further....

damien tournoud’s picture

Status: Active » Postponed (maintainer needs more info)

- Why the hell would the locale module process / edit javascript output of another module?
- I know different languages use different symbols for decimal separation ie comma or point. Where can i change this setting?

Core doesn't change the current locale nor deal with numeric formatting settings.

What you are seeing is more likely the fact of a contributed module (possibly different then GMap) that would call setlocale() carelessly. Try to identify it, and reassign to the proper issue queue.

iorgie’s picture

Damien, thanks for your response.

It seem like your are on the right track. I've installed a cfresh drupal installation with ony the gmap module added. No mess up of the javascript.
I'll keep searching.

iorgie’s picture

Project: Drupal core » Gallery
Version: 6.19 » 6.x-1.0
Component: locale.module » Code / API
Status: Postponed (maintainer needs more info) » Active

Enabling the gallery module on a drupal site also running the gmap module messes with the output of the gmap module.
quick search revealed no setlocale() within the module itself. Is gallery itself using setlocale() somewhere and messing with Drupal?

iorgie’s picture

iorgie’s picture

http://drupal.org/node/389452#comment-1532116 Solved my problem for now.
For me this confirm this is a bug in a drupal module, not gallery.

crifi’s picture

Status: Active » Closed (duplicate)