0

How can I show the information of a particular makers? Such as the name of the locality, address, phone, etc. I use eclipse with libraries phonegap, and in my project I use code html and jquery. The script of multiple makers is this:

var ltlng = [];

        ltlng.push(new google.maps.LatLng(44.342377, 9.229788));
        ltlng.push(new google.maps.LatLng(13.5, 79.2));
        ltlng.push(new google.maps.LatLng(15.24, 77.16));

        map.setCenter(ltlng[0]);
        for (var i = 0; i <= ltlng.length; i++) {
            marker = new google.maps.Marker({
                map: map,
                position: ltlng[i]
            });

            (function (i, marker) {



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

                    if (!infowindow) {
                        infowindow = new google.maps.InfoWindow({ content: 'Location info:<br/>Country Name:<br/>LatLng:');
                    };

                    infowindow.setContent("Message" + i);

                    infowindow.open(map, marker);

                });

})(i, marker);
};
4

1 回答 1

0

如果您指的是当用户单击地图标记时具有信息图标,则以下解决您的问题:

使用信息窗口添加多个标记(Google Maps API)

于 2013-04-26T13:57:16.277 回答