Fuse Community

Center and zoom 2 markers in a MapView

I have a Mapview with 2 markers but I need to center the map and auto zoom to show the two markers in the MapView.

It’s possible?

Thanks!

I might be wrong, but I don’t think there’s a ready functionality for that. Instead I’d calculate the center point of the two markers’ GPS coordinates and center the MapView that way. Tricky part is to calculate the zoom, but I’m sure there’s math for that also.

Thanks! I will research for a function in javascript to calculate the center point and zoom of the two markers’ GPS coordinates.