var polyline = null, map = null, pcenter = null;
map = new plus.maps.Map("map", {
resizeEnable: true,
zoom: 15
});
pcenter = new plus.maps.Point(117.724639, 36.207);
map.centerAndZoom(pcenter, 12);
createMarker(pcenter);
var pointr = new plus.maps.Point(117.725395, 36.207);
drawGreenLine(pcenter.startLong, pcenter.startLat, point.endLong, point.endLat);
上面是map操作,下面是画折线Polyline,点击折线,没有反应,不会弹出2222
function drawGreenLine( startLong, startLat, endLong, endLat) {
polyline = new plus.maps.Polyline([
new plus.maps.Point(startLong, startLat), //起始点的经纬度
new plus.maps.Point(endLong, endLat) //终止点的经纬度
]);
polyline.setStrokeColor("#1296db");
polyline.setLineWidth(6);
polyline.setStrokeOpacity(0.6);
polyline.onclick = function(overlay) {
alert(2222);
}
map.addOverlay(polyline);
}
点击折线,没有反应,不会弹出2222,为什么,是不是bug????
7***@qq.com (作者)
OverlayClickEventHandler那这个回调函数怎么使用,文档中提到
void onClick( overlay ) {
// Click code
}
overlay可以是Marker、Bubble、Circle、Polyline、Polygon对象的引用。
2018-08-22 11:33