Popup for Basemaps?

127
2
2 weeks ago
jjgarrett0
New Contributor II

Is there a way to use popups on the basemaps? Specifically the World Imagery layer. I have a request to include satellite imagery source dates in the popups, but I can't seem to find a straight forward way of setting up popups for the basemaps.

 

Thanks!

0 Kudos
2 Replies
Justin_Greco
Occasional Contributor II

There is no way to display a pop up for a Tile Layer.  What you could do is have a click event on your map view, then query the World Image service using that point (https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/0/query).  Since there can be different imagery at the same location at different zoom levels you’d need to include a where statement to check if your current zoom level is between the MinZoomLevel and MaxZoomLevel.  The response will return a SRC_DATE2 field, which is the source date.  Then display a popup at the click location for the returned polygon.

0 Kudos
Justin_Greco
Occasional Contributor II

An easier option would be to add https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/0 to your map as a feature layer, by default it appears fully transparent with popups enabled.

0 Kudos