Some larger organisations may have not just multiple Venues, but also multiple Solutions in the MapsIndoors system. Therefore, it is naturally important to be able to switch between them.
At it's core, this is done simply by switching out the API key and reloading the system. However, there are a few more steps that can be done to ensure smooth transition between Solutions.
protectedvoidonCreate(Bundle savedInstanceState) {... mMapView =mapFragment.getView();MapsIndoors.load(getApplicationContext(),"YOUR_MAPSINDOORS_API_KEY",null);mapFragment.getMapAsync(this);...}@OverridepublicvoidonMapReady(GoogleMap googleMap) { mMap = googleMap;if (mMapView !=null) {initMapControl(mMapView); }}voidinitMapControl(View view) {MPMapConfig mapConfig =new MPMapConfig.Builder(this, mMap,getString(R.string.google_maps_key), view,true).build();MapControl.create(mapConfig, (mapControl, miError) -> { mMapControl = mapControl;if (miError ==null) {//Orient your map to where you need data to be shown. This could be done by getting the default venue through MapsIndoors and panning the camera there } });}
overridefunonCreate(savedInstanceState: Bundle?) {... MapsIndoors.load(applicationContext, "YOUR_MAPSINDOORS_API_KEY", null) mapFragment.view?.let { mapView = it }...}overridefunonMapReady(googleMap: GoogleMap) { mMap = googleMap mapView?.let { view ->initMapControl(view) }}funinitMapControl(view: View) { MPMapConfig mapConfig = new MPMapConfig.Builder(this, mMap, getString(R.string.google_maps_key), view, true).build();//Creates a new instance of MapControl MapControl.create(config) { mapControl, miError ->if (miError ==null) { mMapControl = mapControl!!//Orient your map to where you need data to be shown. This could be done by getting the default venue through MapsIndoors and panning the camera there } }}
Mapbox
protectedvoidonCreate(Bundle savedInstanceState) {...MapsIndoors.load(getApplicationContext(),"YOUR_MAPSINDOORS_API_KEY",null);...}voidinitMapControl(View view) {MPMapConfig mapConfig =new MPMapConfig.Builder(this, mMapboxMap, mMapView,getString(R.string.mapbox_access_token),true).build();//Creates a new instance of MapControlMapControl.create(mapConfig, (mapControl, miError) -> { mMapControl = mapControl;if (miError ==null) {//Orient your map to where you need data to be shown. This could be done by getting the default venue through MapsIndoors and panning the camera there } });}
overridefunonCreate(savedInstanceState: Bundle?) {... MapsIndoors.load(applicationContext, "YOUR_MAPSINDOORS_API_KEY", null)...}funinitMapControl(view: View) {val config = MPMapConfig.Builder(this, mMap, mapView, getString(R.string.mapbox_access_token),true).build()//Creates a new instance of MapControl MapControl.create(config) { mapControl, miError ->if (miError ==null) {//Orient your map to where you need data to be shown. This could be done by getting the default venue through MapsIndoors and panning the camera there } }}