Openlayers鼠标点击事件不响应

 

Openlayers 鼠标点击事件不响应,(

  marker.events.register(‘mousedown’, marker, function(evt) { alert(evt); OpenLayers.Event.stop(evt); });

我把 map.addLayers([ol_wms, markers, drawlayer]); 改为

map.addLayers([ol_wms, drawlayer, markers]);

即Vector 放在 markers 之前,可能是图层覆盖的原因,要响应的图层,应放在最后;

否则像我之前那样,点击的是 drawlayer 图层;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

转载自:https://blog.csdn.net/u010778358/article/details/84383571

You may also like...