Skip to main content

Switching Solutions

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.

Android

Starting a Solution

To initialise MapsIndoors, do the following:

info

If you are looking for documentation on Android SDK v3, please see here.

protected void onCreate(Bundle savedInstanceState) {
...
mMapView = mapFragment.getView();
MapsIndoors.load(getApplicationContext(), "YOUR_MAPSINDOORS_API_KEY", null);
mapFragment.getMapAsync(this);
...
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;

if (mMapView != null) {
initMapControl(mMapView);
}
}
void initMapControl(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
}
});
}

Switching Solutions

You switch Solutions by changing the active API key using setAPIKey().

We recommend creating your own function to call in the future for this purpose, like the example here with switchSolution():

info

If you are looking for documentation on Android SDK v3, please see here.

protected void switchSolution() {
mMapControl.onDestroy();
MapsIndoors.load(getApplication(), "YOUR_SECONDARY_API_KEY", null);
mMapView.getMapAsync(this);
}