Select to view content in your preferred language

how can i center the map between 2 points

332
1
03-18-2022 12:25 PM
stiven
by
New Contributor III

I need to center 2 points so that they are adjusted and centered on the map,  but I don't know with what class I can do this

This is the map and I have 2 points, I want that when I enter the map it fits me and the 2 points are centered in this way:

Captura de Pantalla 2022-03-18 a la(s) 2.27.40 p.m..png

1 Reply
YObaidat
New Contributor III

You could use view.goTo(your points). Then use extent expand method to expand the extent of map view to get results you want.
view.extent = view.extent.expand(1.5); //for example

0 Kudos