Select to view content in your preferred language

I need to center points on the map

702
2
Jump to solution
03-22-2022 08:03 AM
stiven
by
Emerging Contributor

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
Honored Contributor

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
Honored Contributor
0 Kudos
stiven
by
Emerging Contributor

thanks that helped me

0 Kudos