Git Product home page Git Product logo

mapsindoorsandroid's People

Contributors

fhansenmp avatar namine92 avatar timmikkelsen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapsindoorsandroid's Issues

Unable to add place id

Unable to add place id for my custom location. Can you please guide me how can I add my place or building instead of some fix places by you.

Problem while setting up app for testing

Hi,

I've tried to install the app for testing, but had a few issues:

  • It complained about a img for the splash screen; I've solved this deleting all references for this image

  • Now it doesn't find the class PositionProviderAggregator, from package com.mapsindoors.stdapp.positionprovider and looks like this is a class I can't just throw away

please let me know if I did something wrong

Regards

Lifecycle issues of MapControl causes crashes

I'm using play-services-maps:17.0.1 and mapsindoorssdk:3.8.2 on Android 11.

I'm having troubles understanding the lifecycle of MapControl. I have a Fragment in an Activity with a BottomNavigationView, this Fragment is a root fragment. The layout contains a MapView.

In the Fragment I'm creating the MapControl instance in onCreate(). I'm calling all the corresponding lifecycle functions like onPause, onStop and I'm calling onDestroy in the fragment's onDestroy() method.

I can select that tab and the map loads and I can navigate away and the fragment gets created and destroyed properly and everything seems to work. If however I select the same tab again, the BottomNavigationView simply navigates to the root, so it creates another instance of the Fragment and replaces the previous one. The lifecycle calls are as follows:

D/MapFragment: onPause (A)
D/MapFragment: onStop (A)
D/MapFragment: onCreate (B)
D/MapFragment: onViewCreated (B)
D/MapFragment: onStart (B)
D/MapFragment: onMapReady (B)
D/MapFragment: init ready (B)
D/MapFragment: onDestroyView (A)
D/MapFragment: onDestroy (A)
D/MapFragment: onResume (B)

As you can see, at some point two fragments are created, and thus two instances of MapControl, and towards the end A's MapControl.onDestroy() is called, while Fragment B is on its way to be onResumed(). The crash shortly after this is:

java.lang.IllegalStateException: MPTileManager not initialized
        at com.mapsindoors.mapssdk.bd.a(SourceFile:50)
        at com.mapsindoors.mapssdk.MapControl.i(SourceFile:1272)
        at com.mapsindoors.mapssdk.MapControl.lambda$ZX8O3Ril9ls7u4dd5Y-EAazNVMU(Unknown Source:0)
        at com.mapsindoors.mapssdk.-$$Lambda$MapControl$ZX8O3Ril9ls7u4dd5Y-EAazNVMU.onFloorSelected(Unknown Source:2)
        at com.mapsindoors.mapssdk.MapControl$4.onFloorSelected(SourceFile:2593)
        at com.mapsindoors.mapssdk.y$1.onFloorSelectionChanged(SourceFile:247)
        at com.mapsindoors.mapssdk.MPDefaultFloorSelector$1.onFloorSelectionChanged(SourceFile:260)
        at com.mapsindoors.mapssdk.x.a(SourceFile:122)
        at com.mapsindoors.mapssdk.MPDefaultFloorSelector.setSelectedFloor(SourceFile:3133)
        at com.mapsindoors.mapssdk.y.b(SourceFile:232)
        at com.mapsindoors.mapssdk.MapControl.a(SourceFile:34130)
        at com.mapsindoors.mapssdk.-$$Lambda$3hb4avGSsp4gi7bhey3dcNt2N9g.onBuildingFoundAtCameraTargetListener(Unknown Source:2)
        at com.mapsindoors.mapssdk.MapControl.a(SourceFile:50717)
        at com.mapsindoors.mapssdk.MapControl.lambda$t-HamEMeFNntxRJWaMWTjyvnhYk(Unknown Source:0)
        at com.mapsindoors.mapssdk.-$$Lambda$MapControl$t-HamEMeFNntxRJWaMWTjyvnhYk.onVenueFoundAtCameraTargetListener(Unknown Source:2)
        at com.mapsindoors.mapssdk.MapControl.a(SourceFile:3709)
        at com.mapsindoors.mapssdk.MapControl.b(SourceFile:1477)
        at com.mapsindoors.mapssdk.MapControl.D(SourceFile:1253)
        at com.mapsindoors.mapssdk.MapControl.lambda$cAhyURrfd3euk6HAjCamFVWCM7c(Unknown Source:0)
        at com.mapsindoors.mapssdk.-$$Lambda$MapControl$cAhyURrfd3euk6HAjCamFVWCM7c.onCameraIdle(Unknown Source:2)
        at com.google.android.gms.maps.zzx.zzb(com.google.android.gms:play-services-maps@@17.0.1:1)
        at com.google.android.gms.maps.internal.zzo.zza(com.google.android.gms:play-services-maps@@17.0.1:1)
        at com.google.android.gms.internal.maps.zzb.onTransact(com.google.android.gms:play-services-maps@@17.0.1:3)
        at android.os.Binder.transact(Binder.java:1079)
        at dr.aZ(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (150408-0):2)
        at com.google.maps.api.android.lib6.impl.ac.a(:com.google.android.gms.dynamite_mapsdynamite@[email protected] (150408-0):2)

I know that MapControl keeps track of how many instances are created as it would not allow me to create more than two instances. So there certainly is room for race conditions due to global state.

Am I using MapControl correctly, or am I meant to make it a singleton? How would the limitation of only two instances work if I wanted to add those fragments into the back stack?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.