Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps 谷歌地图自定义标记不显示_Google Maps - Fatal编程技术网

Google maps 谷歌地图自定义标记不显示

Google maps 谷歌地图自定义标记不显示,google-maps,Google Maps,我们在一年多前完成了这个脚本,它没有显示标记图标。我知道它是GMAP2,现在应该是gmap3了。。但为了我的生命,我不能改变信仰。感谢您的帮助,或者请帮助我们解决此问题 脚本是: var userLocation = '<?php echo $homelocation; ?>'; if (GBrowserIsCompatible()) { var geocoder = new GClientGeocoder(); geocoder.getLocations(us

我们在一年多前完成了这个脚本,它没有显示标记图标。我知道它是GMAP2,现在应该是gmap3了。。但为了我的生命,我不能改变信仰。感谢您的帮助,或者请帮助我们解决此问题

脚本是:

    var userLocation = '<?php echo $homelocation; ?>';

if (GBrowserIsCompatible()) {
   var geocoder = new GClientGeocoder();
   geocoder.getLocations(userLocation, function (locations) {         
      if (locations.Placemark)
      {
         var north = locations.Placemark[0].ExtendedData.LatLonBox.north;
         var south = locations.Placemark[0].ExtendedData.LatLonBox.south;
         var east  = locations.Placemark[0].ExtendedData.LatLonBox.east;
         var west  = locations.Placemark[0].ExtendedData.LatLonBox.west;

         var bounds = new GLatLngBounds(new GLatLng(south, west), 
                                        new GLatLng(north, east));

         var map = new GMap2(document.getElementById("map_canvas"));

          var Icon = new GIcon();
          Icon.image = "images/422marker.png";
          Icon.iconSize = new GSize(33, 50);

         map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
         map.addOverlay(new GMarker(bounds.getCenter()), Icon);
      }
   });
}
var userLocation='';
if(GBrowserIsCompatible()){
var geocoder=new GClientGeocoder();
geocoder.getLocations(用户位置,函数位置){
if(位置、位置标记)
{
var north=locations.Placemark[0]。ExtendedData.LatLonBox.north;
var south=locations.Placemark[0]。ExtendedData.LatLonBox.south;
var east=位置。位置标记[0]。ExtendedData.LatLonBox.east;
var west=位置。Placemark[0]。ExtendedData.LatLonBox.west;
var bounds=新GLatLng bounds(新GLatLng(南部、西部),
新格拉特林(北部、东部);
var map=newgmap2(document.getElementById(“map_canvas”);
var Icon=new GIcon();
Icon.image=“images/422marker.png”;
Icon.iconSize=新的GSize(33,50);
setCenter(bounds.getCenter(),map.getBoundsZoomLevel(bounds));
addOverlay(新的GMarker(bounds.getCenter()),图标);
}
});
}

从Google加载API的加载脚本URL中是否出现
&v=2
?如果没有,添加它,脚本可能会重新开始工作


当然,在某个时候你仍然需要花时间升级到v3。

你必须重写其中的大部分内容,没有办法,你必须去阅读和研究文档和示例,这些都非常清楚。也加入GMAPSV3谷歌小组。它曾经工作过但现在不工作了吗?或者标记从来都不起作用?它实际上工作得很好,只是没有显示我们的自定义标记。自定义标记从来没有显示过吗?它是最近才停止展示的吗?或者它从未显示过?是的,版本出现在脚本中,只是自定义标记没有显示,我们一直在获取标准标记pin。自定义标记是否与v2脚本一起工作?或者这是你最近才添加的和/或以前从未使用过的东西?我不能确定lol。我只是浏览了我们正在做的站点的所有google地图脚本,注意到这并没有显示自定义标记