【发布时间】:2016-11-10 22:41:53
【问题描述】:
我在这样的参数中获取地图起点和终点 lat lng (58.39847354300152, 15.579836368560791) 并且必须为两者设置两个不同的标记..现在我只能设置一个标记开始或结束..如何设置对于两者
function markerStartEnd(map,startPoint,endPoint,startTime,endTime){
var anchor = new google.maps.Point(20,41),
size = new google.maps.Size(41,41),
origin = new google.maps.Point(0,0),
icon = new google.maps.MarkerImage('../../static/js/start.png',size,origin,anchor);
new google.maps.Marker({icon:icon,map:map,position:startPoint});
new google.maps.Label({ position: startPoint, map: map, content:startTime});
icon = new google.maps.MarkerImage('../../static/js/end.png',size,origin,anchor);
new google.maps.Marker({icon:icon,map:map,position:endPoint});
new google.maps.Label({ position: endPoint, map: map, content:endTime});
}
【问题讨论】:
标签: javascript jquery google-maps google-maps-api-3 google-maps-markers