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