Select to view content in your preferred language

Dynamic aggregation layer and time slider

901
5
Jump to solution
09-17-2022 06:50 AM
BradSkopyk
New Contributor III

I am new to working with ArcGIS API for JS, but have done some work with the ESRI leaflet library. I would like to create a map with this API that would visualize an dynamically aggregated time series of historical health in Mexico that is published on my portal (https://elcamaleon.binghamton.edu/server/rest/services/muni_event_aggregation/MapServer)

The data is published as a map image layer.

Basically, I'd like to produce a simple map as per this timeslider tutorial

Can anyone point me in the direction of any examples that use a timeslider to visualize a dynamically-aggregated mapimage layer?

I am sorry to be so vague.

0 Kudos
1 Solution

Accepted Solutions
JohnGrayson
Esri Regular Contributor

Here's that same tutorial but slightly modified to your MapImageLayer service:

https://codepen.io/john-grayson/pen/VwxbgBR

Please note that you can't use the individual FeatureLayer directly as some of the TimeInfo properties have not been configured.

View solution in original post

5 Replies
JohnGrayson
Esri Regular Contributor

Here's that same tutorial but slightly modified to your MapImageLayer service:

https://codepen.io/john-grayson/pen/VwxbgBR

Please note that you can't use the individual FeatureLayer directly as some of the TimeInfo properties have not been configured.

BradSkopyk
New Contributor III

Gosh, that looks so easy, but it's not, at least for me. I see that you used the load() method. I'll have to figure that out, but thank you! I may be back with other related questions, specifically about A) how to change symbology classes in a dynamic layer and b) how to show pop-ups that honor the dynamic row_count. But I should play with that first and come back later when, most likely, I fail. Many thanks!

0 Kudos
JohnGrayson
Esri Regular Contributor

Please make sure to submit unrelated issues as new questions so we don't confuse things later on.

0 Kudos
TanuHoque
Esri Regular Contributor

Hi @BradSkopyk 

I'm glad @JohnGrayson was able to help you out  (Thanks John). I'm not a JS API developer.

As you see below in the screenshot that in the Map Viewer (both enterprise and arcgis online), you can change symbology as well as enable popup for map image layer.

TanuHoque_0-1663797271095.png


here are a few samples that I found from JS API help and I thought you might find them helpful:
1. how to change symbols for a sub layer off a map image layer: https://developers.arcgis.com/javascript/latest/sample-code/layers-mapimagelayer-renderers/

2. for popup, please start from this sample and they have a bunch of samples in there. https://developers.arcgis.com/javascript/latest/sample-code/intro-popuptemplate/. Since popup works against sublayers off a map image layer (which is a bit different than feature layer), you need to define the template for the sublayer.

I was not able to find any existing sample showing how popup can be configured for a sub layer off a map image layer, but I was able to put together something very quickly thanks to all available help/sample code the ArcGIS JS API team put together and made available to everyone. https://codepen.io/thoquews/pen/JjvyOVq 

Also, you might want to check this help out as well: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html  

Hope you will find this helpful

Best regards
Tanu

0 Kudos
BradSkopyk
New Contributor III

Thank you @TanuHoque . This was very helpful. Unfortunately, the workflow that you suggested for the popups does not produce dynamic values that respond dynamically to the timeslider extent. I am still having difficulty with pop-ups, but have started a new thread.  If you have further suggests, please respond at the new thread.