map.extent.getWidth() / map.width
rMap.map.disableScrollWheelZoom(); on(dom.byId(a),(!has("mozilla") ? "mousewheel" : "DOMMouseScroll"), function(e){ scroll(e) }); on(map,"zoom-end",function(){locked=false;applyZoom()}); on(map,"zoom-start",function(){locked=true;newScale=-1;}); var newScale = -1; var locked = false; var timer; function scroll(e) { var s = e[(!has("mozilla") ? "wheelDelta" : "detail")] * (!has("mozilla") ? 1 : -1); if( !locked ) { rMap.map.onZoomStart(); newScale = rMap.map.getScale(); } if(s>0) newScale = newScale*0.8; else newScale = newScale*1.2; clearTimeout(timer); timer = setTimeout(function(){rMap.map.onZoomEnd();},1500); } function applyZoom() { rMap.map.setScale(newScale); }This correctly queues the scale change up on the client and commits it to a server request as one transaction. The problem is that it does not provide user input that it is doing so (the default behavior of the map object uses a matrix transform on the image to show it zoom in or out.) If I submit a setScale() call with each mouse event, the user has to wait for the map to update before they can submit another.I guess what I want to know is if there's a way to call the function responsible for that transform in the map object, or duplicate it in a way that will not interfere with the map object and/or break on a framework update.
rMap.map.disableScrollWheelZoom(); on(dom.byId(a),(!has("mozilla") ? "mousewheel" : "DOMMouseScroll"), function(e){ scroll(e) }); on(map,"zoom-end",function(){locked=false;applyZoom()}); on(map,"zoom-start",function(){locked=true;newScale=-1;}); var newScale = -1; var locked = false; var timer; function scroll(e) { var s = e[(!has("mozilla") ? "wheelDelta" : "detail")] * (!has("mozilla") ? 1 : -1); if( !locked ) { rMap.map.onZoomStart(); newScale = rMap.map.getScale(); } if(s>0) newScale = newScale*0.8; else newScale = newScale*1.2; clearTimeout(timer); timer = setTimeout(function(){rMap.map.onZoomEnd();},1500); } function applyZoom() { rMap.map.setScale(newScale); }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.