我有两个示例代码:
地图:https://drive.google.com/file/d/0B6Pit3BhPYj4Y0xjMnNabXRicTg/view
标记:https://drive.google.com/file/d/0B6Pit3BhPYj4Z2x5TElQb25kcHc/view
我想要做的是将标记(从文件2)放到地图上(1)(具有重叠图像)。
有谁知道怎么做?
答案 0 :(得分:0)
回答这个问题:Change marker icon with matching id
var marker_new = new Array();
var url = "";
switch (marker.id){
case 1: break;
case 2: break;
case 3:url = "http://exampl.com/yellow.png";
case 4: break;
case 5: break;
}
marker_new[i] = google.maps.Marker({
icon: url;
position: place.geometry.location,
map: map
});
<强>更新强> 例如:http://jsfiddle.net/uL2Lshu6/7/