在同一张地图上,一个地图只有一个标记,而另一个地图有多个标记。我只想使用gmap3 bt使用相同的地图,一个使用gmap3,jquery和javascript以及一个额外的类来获取一个标记,另一个获取多个标记。可能吗?我已经在下面给出了我的js代码。有什么解决方案可以在$ gmaptwo变量中只给出一个标记吗?
https://i.stack.imgur.com/P0nhZ.png
$('.gmap3-area').each(function() {
var $this = $(this),
$gmaptwo = $(".gmap3-area.another");
$this.gmap3({
center: [40.8859901, -74.0640706],
zoom: 4,
mapTypeId: "shadeOfGrey",
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, "shadeOfGrey"]
}
}).marker([{
position: [40.8859901, -74.0640706],
icon: "media/images/icon/map-marker.png"
}, {
address: "Munich, Germany",
icon: "media/images/icon/map-marker-two.png"
}, {
address: "Indiana, USA",
icon: "media/images/icon/map-marker-three.png"
}, {
address: "California, USA",
icon: "media/images/icon/map-marker-two.png"
}, {
address: "Airport Blvd, Singapore",
icon: "media/images/icon/map-marker.png"
}, {
address: "Toronto, Canada",
icon: "media/images/icon/map-marker.png"
}]).on('click', function(marker) {
marker.setIcon('media/images/icon/map-marker-four.png');
})
});