Can i invoke any java script function or code behing file on change of zoom level of maps
How to get zoom changed event
Ajay,
We don't have zoom level changed event; but instead, we have extent changed event, depending on this, you can check if current zoom level is changed. You can select For example:
Put the following code in the code behind to register a client extent changed event:Map1.OnClientExtentChanged = "OnMap1ExtentChanged";
Put the following code the implement the client event.var lastLevel = null;
var tgMap = null;
var OnMapCreated = function(map) {
tgMap = map;
}
var OnMap1ExtentChanged = function() {
if (tgMap) {
var isLevelChanged = false;
if (lastLevel) {
if (lastLevel != tgMap.zoom) {
isLevelChanged = true;
}
}
if (isLevelChanged) {
//...Write your logic here.
}
lastLevel = tgMap.zoom;
}
}
Let me know if you have more questions.
Thanks,
Howard