是否可以为 google 地图 api 中的一个标记打开多个信息窗口?
Is it possible to open multiple infoWindows for one marker in google maps api?
我正在做一个项目,他们想要像这样查看信息窗口:
[![在此处输入图片描述][1]][1]
这怎么可能,您会推荐哪个库?
在 Google maps v3 中,可以通过创建自定义事件侦听器和修改自动居中来实现。可以在此处找到示例:http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/
一个标记的多个信息窗口(未测试):
var infowindow = new google.maps.InfoWindow();
var infowindow2 = new google.maps.InfoWindow();
var marker = new google.maps.Marker({
position:latLng,
map: map
});
google.maps.event.addListener(marker, 'click', function(content){
return function(){
infowindow.setContent(content);
infowindow.open(map, this);
infowindow2.setContent(content+'222');
infowindow2.open(map, this);
}
}(content));
我正在做一个项目,他们想要像这样查看信息窗口:
[![在此处输入图片描述][1]][1]
这怎么可能,您会推荐哪个库?
在 Google maps v3 中,可以通过创建自定义事件侦听器和修改自动居中来实现。可以在此处找到示例:http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/
一个标记的多个信息窗口(未测试):
var infowindow = new google.maps.InfoWindow();
var infowindow2 = new google.maps.InfoWindow();
var marker = new google.maps.Marker({
position:latLng,
map: map
});
google.maps.event.addListener(marker, 'click', function(content){
return function(){
infowindow.setContent(content);
infowindow.open(map, this);
infowindow2.setContent(content+'222');
infowindow2.open(map, this);
}
}(content));