androidgoogle-mapsgoogle-maps-android-api-2google-maps-api-2google-indoor-maps

indoor map returns false after the first run, setIndoorEnable


I am working with google map fragment. In onCreateView i call this function:

googlemap.setIndoorEnabled(true);

For the first run it is working but after this run others are wrong.

System.out.println(googlemap.isIndoorEnabled());

returns with false.

What should i do?


Solution

  • According to google docs about setIndoorEnabled(boolean enabled) :

    Sets whether indoor maps should be enabled. Currently, indoor maps can only be shown on one map at a time and by default, this is the first map added to your application. To enable indoor maps on another map, you must first disable indoor maps on the original map. If you try to enable indoor maps when it is enabled on another map, nothing will happen and this will return false. When Indoor is not enabled for a map, all methods related to indoor will return null, or false.