Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/384.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 如何在谷歌地图中显示标记信息?_Javascript_Jquery_Html_Eclipse_Google Maps - Fatal编程技术网

Javascript 如何在谷歌地图中显示标记信息?

Javascript 如何在谷歌地图中显示标记信息?,javascript,jquery,html,eclipse,google-maps,Javascript,Jquery,Html,Eclipse,Google Maps,如何显示特定制造商的信息?例如当地的名称、地址、电话等。 我使用eclipse和phonegap库,在我的项目中我使用html和jquery代码。 多个制造商的脚本如下所示: 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 g

如何显示特定制造商的信息?例如当地的名称、地址、电话等。 我使用eclipse和phonegap库,在我的项目中我使用html和jquery代码。 多个制造商的脚本如下所示:

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);
};
var ltlng=[];
推送(新的google.maps.LatLng(44.342377,9.229788));
ltlng.push(新的google.maps.LatLng(13.579.2));
ltlng.push(新的google.maps.LatLng(15.2477.16));
地图设置中心(ltlng[0]);

对于(var i=0;i,如果用户单击地图标记时使用信息图标,则以下内容可解决您的问题:


我尝试添加您发送给我的链接中的代码,但无效。请告诉我代码的哪一部分,并在该位置进行替换。谢谢