Hi Vivek,
I think it’s easy for you to do on server side, because after a postback, all events will be re-registered on client side again, but a little complicated on client side using JavaScript, please check the code below:
function handleMapClick(enable) {
var map = Map1.GetOpenLayersMap();
var clickHandlerControl = null;
for (var i = 0; i < map.controls.length; i++) {
if (map.controls.handler && map.controls.handler.CLASS_NAME == 'OpenLayers.Handler.Click') {
clickHandlerControl = map.controls;
break;
}
}
if (clickHandlerControl) {
if (enable) {
clickHandlerControl.handler.activate();
} else {
clickHandlerControl.handler.deactivate();
}
}
}
function handleMarkerClick(enable) {
var map = Map1.GetOpenLayersMap();
var markerOverlay = map.getLayer('markerOverlay id');
for (var i = 0; i < markerOverlay.markers.length; i++) {
if (enable) {
GetHookedClickEventMarker(markerOverlay.markers, markerOverlay)
else{
markerOverlay.events.remove(etype);
}
}
}
Please modify the MarkerOverlay's id mentioned in the script and have a try. Any question please let us know. Regards. Johnny