I need to center points on the map

158
2
Jump to solution
03-22-2022 08:03 AM
stivenstiven
New Contributor III

I have 2 points with their coordinates, I need to center those 2 points and have the map adjust so that those 2 points are displayed on the map, I'm using the goTo() method but it only lets me add a single location to center

Captura de Pantalla 2022-03-22 a la(s) 10.00.08 a.m..png

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor II

The view.goTo() method can also take an array of graphics or geometries so you can pass multiple values at once.

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo

https://codepen.io/odoe/pen/OJzRrGM?editors=0010

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor II

The view.goTo() method can also take an array of graphics or geometries so you can pass multiple values at once.

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo

https://codepen.io/odoe/pen/OJzRrGM?editors=0010

0 Kudos
stivenstiven
New Contributor III

thanks that helped me

0 Kudos