Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper way to handle Markers on Scene Update #1525

Closed
ac87 opened this issue May 30, 2017 · 3 comments
Closed

Proper way to handle Markers on Scene Update #1525

ac87 opened this issue May 30, 2017 · 3 comments
Assignees

Comments

@ac87
Copy link

ac87 commented May 30, 2017

I've updated to the latest version and now have the change to fix #1464, so if the scene changes all markers are invalidated/removed, subsequently my test app now crashes toggling raster/vector.

I see the comment from @tallytalwar "document the behavior such that the user handles readding of any marker in the asyncSceneLoad/Update callback."

Before I make my own events to update all markers, does this callback not yet exist (in Android)? or am I looking in the wrong place?

@hjanetzek
Copy link
Member

Hi @ac87, thanks for the report! There is indeed no good way to recreate markers on scene updates at the moment. I'll look into this now.

@hjanetzek
Copy link
Member

It probably works if you set a ViewCompleteListener after the call to applySceneUpdates like this

mapController.setViewCompleteListener(new ViewCompleteListener() {
   mapController.removeAllMarkers();
   ... recreate markers ...
});

@ac87
Copy link
Author

ac87 commented Aug 9, 2017

The 0.8.0 update for this is working well for me thanks.

One subtle additional change (in case anyone else was using it) was where I was previously advised to use something like:

mapController.queueEvent(reloadRunnable);
 
private Runnable reloadRunnable = new Runnable() {
        @Override
        public void run() {
            mapController.loadSceneFile(getBaseScene(isVector), getSceneUpdates());
        }
    };

This queuing to the mapcontroller is no longer required and if left in causes concurrent modification exceptions, the scene can now be loaded directly without the queue.

@ac87 ac87 closed this as completed Aug 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants