I have implemented a vector layer(using JavaScript) in OpenLayers which has a point geometry.
Now my requirement is to show menu just beside the point whenever we do right-click on the point.
Can we do this in OpenLayers?
I have implemented a vector layer(using JavaScript) in OpenLayers which has a point geometry.
Now my requirement is to show menu just beside the point whenever we do right-click on the point.
Can we do this in OpenLayers?
there is an information here about right click select feature. i havent try it but it looks like it works.
myMap is OpenLayers.Map object and myVectorLayer is... OpenLayers.Layer.Vector.
myMap.div.oncontextmenu = function noContextMenu(e) { if(!e){ //dear IE... var e = window.event; e.returnValue = false; } var f = myVectorLayer.getFeatureFromEvent(e); alert(f); //f is the pointed vector.feature :) return false; //Prevent display of browser context menu } i hope it helps you...
myMap.div ? TypeError: map.div is undefined ...