Search code examples
iosswiftmapkitandroid-mapviewmapkitannotation

Multiple mapView in one app


I'm creating business app which is using mapView for almost all functions. Now I'm considering, is it ok to use two mapView in one app?

To be more specific - I've created mapView and I've made some creations (like annotations etc.). Is it ok to create another mapView in modal view just to present some other function? Is some best practice to multiple using mapView? Should I consider using only one mapView?

Thanks for your help.


Solution

  • Yup, go for it 👍🗺.

    Don't go crazy and use multiple when one would do. For example if you have a map in a controller and want to allow the user to toggle types of annotation on the map, then you should only be toggling the annotations. it would be silly here to have two map views, one with each type of annotation and switch the whole mapviews.

    However if you have different controllers or parts of the app that need maps, map away.