0

One of the website i'm managing is getting in trouble...And as i didn't develop this one, i had real problems to do something on it.

It's based on Drupal 7 and use the Getlocations module to set-up some Gmaps with marker.

The problem is that from last week, for some page, the maps is showing an unknow location (somewhere in spain...). But, when you move the map with arrow, it's get to the good location. The problem is totally random, hard to reproduce in exact condition etc...

Here is the javascript console :

Uncaught TypeError: Cannot read property '20' of undefined markermanager.js:534

This line is relative to the z parameter.

So, after looking on the net it appears that it could help to set up the version of maps in the call. Set the v variable to 3.9.

I opened the file : sites/all/modules/getlocations/getlocations.module and to this part :

$query = array();
if (! empty($key)) {
$query['key'] = $key;
}
$query['sensor'] = 'true';
$query['language'] = $language->language;

add this line :

$query['v'] = '3.9';

uploaded the news file, empty drupal and chrome cache then...nothing. Drupal still calling

<script src="http://maps.googleapis.com/maps/api/js?
key=xxxxxxxx;sensor=false&amp;language=fr"></script>

and does'nt specify the version...I look to other files in modules/getlocations and find nothing interesting.

So my question is : how can i specify the version number of gooleapis ? I'd like to call this :

<script src="http://maps.googleapis.com/maps/api/js?v=3.9&
key=xxxxxxxxxxxxxx;sensor=false&amp;language=fr"></script>

I never use drupal and i'm dubitative on this point...

Thanks !

4

1 回答 1

0

标记管理器的更新版本可与 API v3.10 一起使用。将 API 版本硬编码为可能会在 6 个月内停用的版本可能是一个更好的解决方案。

于 2012-11-26T11:17:14.853 回答