I am using the JavaScript API to check if the view is created for all the layers and based on it I am showing a spinner in my application to indicate the end user that the layer loading is in progress and once the layer are loaded the spinner is stopped.
I am using the whenLayerView method but the internal API which renders the layers image takes time and I do not have any control to show the application loading state.Please suggest which method I can use here to have access to an event for displaying a loading state in the browser until the layers image is fetched.
Version - 4.26.0Reference - https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#whenLayerView
Image API - /MapServer/export?bbox=-13672105.657400718%2C7676081.658810125%2C-12602598.757634586%2C7925572.119132928&bboxSR=102100&imageSR=102100&size=1749%2C408&dpi=96&format=png32&transparent=true&layers=show%3A0%2C1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13&f=image
I would recommend watching the updating property on the View. For example:
view.watch("updating", function(newValue, oldValue, propertyName, target) { activityIndicator.style.display = ((newValue) ? "inline" : "none"); });
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.