How do I automatically 'Pan' popup to fit the View in arcgis JSAPI

39 Views Asked by At

my popups are being cutoff/out of the view, in an ArcGIS JSAPI build.(4.26x)

I have no trouble using "view.popup.alignment" or "view.popup.dockEnabled" to control the popup location, but those options aren't ideal, and I would like to have the view shift or pan automatically to fit the poupup fully in the map view.

these examples show the shift im looking for-

https://developers.arcgis.com/javascript/latest/sample-code/watch-for-changes/live/index.html

(mapbox example showing the same thing..)

https://www.nps.gov/subjects/geology/geologic-resources-inventory-products.htm

Thanks

1

There are 1 best solutions below

1
Bjorn Svensson On

Maybe not exactly what you're asking for, but you can center the map where you clicked using view.goTo(event.mapPoint);

See codepen example.