我的标记不适用于我的站点地图

时间:2015-03-19 16:41:20

标签: javascript php jquery google-maps

function initialize() {
  var mapProp = {
    center:new google.maps.LatLng(51.508742,-0.120850),
    zoom:5,
    mapTypeId:google.maps.MapTypeId.ROADMAP
  };

  var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);

var marker = new google.maps.Marker ({
            position: (51.508742,-0.120850),
            map: map,
            animation: google.maps.Animation.BOUNCE



        });



$.getJSON("muziek.php", function (data){


$.each(data, function() {

$.each(this, function (key, value) {

    if (value.location != undefined){



        var myLatlng = new google.maps.LatLng(value.location.latitude, value.location.longitude);
        var images = value.images.low_resolution.url;
        var infowindow = new google.maps.infowindow({

        content: 
        "<img src='" +images+ "'>" 



        });







        google.map.event.addListener(marker, 'click', function() {

            infowindow.open(map, marker);

        });

    }
});

});


});

}

google.maps.event.addDomListener(window, 'load', initialize);

我的标记不能在我的谷歌地图上放置照片如何解决这个问题并将标记与我的istagram中的数据放在我的谷歌地图上。我已经控制了我的位置,但我不会得到任何结果。

1 个答案:

答案 0 :(得分:0)

我建议仔细检查你的img来源。以下工作对我来说很好:

var contentString = '<img src="[URL of image]">';

var infowindow = new google.maps.InfoWindow({
  content: contentString
});

var marker = new google.maps.Marker({
  position: myLatlng,
  map: map,
  title: 'Test',
    //animation: google.maps.Animation.BOUNCE
});