In my App, I need a function to detect map's zoom in/out. Referring to
https://community.esri.com/t5/arcgis-api-for-javascript/detect-change-in-zoom-when-complete/m-p/540607
I added the following code in the script:
$('#viewDiv').mousedown(function() {
context._mapClick(context);
});
$("#viewDiv").on('wheel', function() {
context._mapClick(context);
});
......
_mapClick: function (context) {
debugger;
context.esriModules.watchUtils.watch(context.view, "zoom", onZoomChange);
function onZoomChange(newValue, oldValue, propertyName, target) {
debugger;
if (!target.updating && oldValue > newValue) {
contx.crimeTable.clearSelection();
}
}
},
In Chrome's debugging, the _mapClick: function () does fire, but after debugging; the function onZoomChange() is not implemented. What's wrong in my coding? Thanks if you can help.