Select to view content in your preferred language

Detecting Zoom Start and end, and pan in 4.x

05-15-2024 02:12 PM
New Contributor II

I am migrating an older web interface to the newer java api 4.x. In the older interface I could make calls, such as these to detect when the map was zoomed in, out, or panned.

dojo.connect(map, "onZoomStart", showLoadingSpinner);
dojo.connect(map, "onPanStart", showLoadingSpinner);

I can do something similar with the following code, but it is not as granular and a bit difficult to detect when different parts of the interface have been updated, including when the process is complete. For example if the sketch is active, I believe it trips the updating. Are there any better suggestions of detecting these actions?

const handle = reactiveUtils.when(
() => view.updating,
() => {
{ once: false }


Thanks for your time!


0 Kudos
1 Reply
New Contributor III

If your methods are navigating via the goTo() method, you could watch the 'animating' property

From the example:
  () => view.animation,
  (response) => {
    if(response?.state === "running"){
      console.log("Animation in progress");
    } else{
     console.log("No animation");
James from
0 Kudos