Skip to content
Snippets Groups Projects
Commit 2a3fab90 authored by johnv's avatar johnv Committed by Andriy Podanenko
Browse files

Issue #870350 by johnv, shenzhuxi: Fixed Patch for better gmap for China.

parent 4c9cb98b
No related branches found
No related tags found
No related merge requests found
...@@ -237,44 +237,36 @@ function _gmap_base_js() { ...@@ -237,44 +237,36 @@ function _gmap_base_js() {
$ret = array(); $ret = array();
$path = drupal_get_path('module', 'gmap'); $path = drupal_get_path('module', 'gmap');
$ret[$path . '/js/gmap.js'] = array('weight' => 1);
$ret[$path . '/js/icon.js'] = array('weight' => 2);
$ret[$path . '/js/marker.js'] = array('weight' => 2);
$ret[$path . '/js/highlight.js'] = array('weight' => 2);
$ret[$path . '/js/poly.js'] = array('weight' => 2);
global $language; global $language;
$file = 'api/js'; switch ($language->language) {
case 'zh-hans':
$langcode = 'zh-CN';
break;
case 'zh-hant':
$langcode = 'zh-TW';
break;
default:
$langcode = $language->language;
break;
}
$query = array( $query = array(
'v' => variable_get('gmap_api_version', GMAP_API_VERSION), 'v' => variable_get('gmap_api_version', GMAP_API_VERSION),
'language' => $language->language, 'language' => $langcode,
'sensor' => 'false', 'sensor' => 'false',
); );
if ($key = gmap_get_key()) { if ($key = gmap_get_key()) {
$query['key'] = $key; $query['key'] = $key;
} }
if ($query['language'] == 'zh-hans') {
$query['language'] = 'zh-CN';
// There is no https:// version of this domain, so this can be hard coded.
$ret[url('http' . '://ditu.google.cn/maps/' . $file, array('query' => $query))] = array(
'type' => 'external',
'weight' => 1,
);
}
elseif ($query['language'] == 'zh-hant') {
$query['language'] = 'zh-TW';
$ret[url(gmap_views_protocol() . '://maps.googleapis.com/maps/' . $file, array('query' => $query))] = array(
'type' => 'external',
'weight' => 1,
);
}
else {
$ret[url(gmap_views_protocol() . '://maps.googleapis.com/maps/' . $file, array('query' => $query))] = array(
'type' => 'external',
'weight' => 1,
);
}
$ret[$path . '/js/gmap.js'] = array('weight' => 1);
$ret[$path . '/js/icon.js'] = array('weight' => 2);
$ret[$path . '/js/marker.js'] = array('weight' => 2);
$ret[$path . '/js/highlight.js'] = array('weight' => 2);
$ret[$path . '/js/poly.js'] = array('weight' => 2);
$ret[url(gmap_views_protocol() . '://maps.googleapis.com/maps/' . 'api/js', array('query' => $query))] = array(
'type' => 'external',
'weight' => 1,
);
$ret['/' . variable_get('file_public_path', conf_path() . '/files') . '/js/gmap_markers.js'] = array( $ret['/' . variable_get('file_public_path', conf_path() . '/files') . '/js/gmap_markers.js'] = array(
'type' => 'external', 'type' => 'external',
'weight' => 4, 'weight' => 4,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment