Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/476.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
Javascript Google Maps API v3未显示标记_Javascript_Maps - Fatal编程技术网

Javascript Google Maps API v3未显示标记

Javascript Google Maps API v3未显示标记,javascript,maps,Javascript,Maps,我试图在谷歌地图上放置一个标记,但它没有显示。地图显示的很好,中心在正确的位置,但我用那个位置作为标记,它什么也不做。有什么想法吗?多谢各位 代码如下: if (maps.geocoder) { maps.geocoder.geocode( { 'address' : mapInfo.address }, function(results, status) { if (status == google.maps.Geocoder

我试图在谷歌地图上放置一个标记,但它没有显示。地图显示的很好,中心在正确的位置,但我用那个位置作为标记,它什么也不做。有什么想法吗?多谢各位

代码如下:

  if (maps.geocoder) {
    maps.geocoder.geocode(
        { 'address' : mapInfo.address },
        function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                mapInfo.map.setCenter(results[0].geometry.location);
                var marker = new google.maps.Marker(
                    {
                        map : mapInfo.map,
                        posision : results[0].geometry.location,
                    }
                )

                var infowindow = new google.maps.InfoWindow({
                    content: "<b><u><a href='" + mapInfo.url + "'>" + mapInfo.title + "</a></u></b><br>" + mapInfo.address
                });

                infowindow.open(mapInfo.map,marker);

                marker.setVisible(true)
                console.log(marker)
            }
            else
            {
                alert("Google Maps: Адрес не найден по следующей причине: " + status);
            }
        }
    )
  }
if(maps.geocoder){
maps.geocoder.geocode(
{“地址”:mapInfo.address},
功能(结果、状态){
if(status==google.maps.GeocoderStatus.OK){
mapInfo.map.setCenter(结果[0].geometry.location);
var marker=new google.maps.marker(
{
地图:mapInfo.map,
位置:结果[0]。geometry.location,
}
)
var infowindow=new google.maps.infowindow({
内容:“
”+mapInfo.address }); 打开(mapInfo.map,marker); marker.setVisible(true) console.log(标记器) } 其他的 { 警报(“谷歌地图:状态”); } } ) }
难以置信!非常感谢难以置信!非常感谢D