标记没有出现?

时间:2013-05-09 19:24:58

标签: javascript google-maps-api-3

以下是我对地图标记的代码,它基于the official api,出于某种原因,当我点击标记时,信息窗口不会打开。有任何想法吗?我做错了什么?

    var marker = new google.maps.Marker({
        position: latlng,
        map: map,
        title: "You are here! (at least within a " + position.coords.accuracy + " meter radius)"
    });

    var contentString = 'test';

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

    google.maps.event.addListener(marker, 'click', function() {
        infowindow.open(map, marker);
    });

0 个答案:

没有答案