Our app displays maps from different venues. A feature I’m building lets users view sales and see the store’s location on the map. Some maps have stores in more than one location or a large store with the sale location in multiple locations. Zooming to one location isn’t hard, but how to determine the zoom level when I need to show multiple locations?
The easiest way to do this is to allow the Mappedin SDK to perform the calculations for you. You can use the MPICamera.focusOn() method, which accepts multiple nodes or polygons. When you pass in more than one location the camera pans and zooms so that all locations on the map are visible. Have a look at Focus the Camera on Targets in our Camera Guide.
Always nice to let the SDK do the work. That’s what I needed.