一:事件冒泡
lineLayer.on('click', function(e){
if(!$.isEmptyObject(e.graphic.attributes)
&& $.isFunction(e.graphic.attributes.onClick))
e.graphic.attributes.onClick(e.graphic.attributes, e.screenPoint);//TODO 暫時只返回了業務數據,需要根據實際應用再做添加
// 阻止事件冒泡
var ev = e || window.event;
if (ev.stopPropagation) {
ev.stopPropagation();
} else if (window.event) {
window.event.cancelBubble = true;// 兼容IE
}
});
}