-
Notifications
You must be signed in to change notification settings - Fork 52
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
Android backbutton handling issue #67
base: master
Are you sure you want to change the base?
Android backbutton handling issue #67
Conversation
Interesting idea. Let's try to go a little further in your idea. If we make independent class for map and create it on map show. Then we can add all handlers to it. And what then we get? A multiple map support. As I see it will also require some feasible (not that hard) changes in code. Actually we have to add list of maps to code and generate for each map unique id. Then add to each method id as parameter. And write useful abstraction in js code. |
Exactly what I was thinking. The issue with that is this could take longer to implement. If we could open up the way for it by the next minor release (by placing only the native event dispatcher and the evented class under JS) we could solve this issue, release, and start thinking over mulltiple map support. If you think further on that idea, you will have a better API for managing maps and markers as well, since you could atomically bind/unbind markers to a map, the click event on markers could be handled trough the map instance event dispatcher, which would fire an event on a respectively marker instance. Seems we do both can see and agree over it, but does the native event emitter (without multiple map for now, just an added callback) is difficult to implement over both Android and iOS? |
Hello guys, What is exactly the issue with markercallback and how it is related to the backbutton? |
@dagatsoin Hello!
Oh really!?! Nice! Are you capturing the touch event per map view?
It happened with me, since markerCallback does sit under a global space instead of a map instance, it will sit there until we change. I have two kinds of maps on the project I'm using it. The first one does have markers and I need the callback for navigation. The second one is a location dragger, it has only one map, you move the map anywhere, it places the marker always in the middle (since we don't have dragged markers) and this allows me to give the user a way to choose a location. The issue was, whenever an user clicked on the second map's marker, it tried to execute things from the first one. I've workaround it by placing a noop js function |
@@ -76,6 +79,7 @@ | |||
private String accessToken; | |||
private CallbackContext callback; | |||
private CallbackContext markerCallbackContext; | |||
private CallbackContext backbuttonCallbackContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be removed, cannot forget it into here.
Ok I see. For a minor release, what about making a map of callbacks identified by the markerId? JS API:
Android:
Back to the features list. To be sure to understand how will be organize the next minor/major release how can we do a roadmap or any other document to decide which feature for which release? On my side the main features are:
|
+1 for feature list
|
Added milestone and roadmap under #68 |
I would opt-in for removing the callback natively for now while hiding a map, I propose this because it seems easier than changing the API, could fix by now. And we could release it as a patch. :D
What do you think? |
@cusspvz , okay fix by now. |
This needs to be reviewed, moved aside from the #42.
@Anothar I had issues before with the
addMarkerCallback
because of the way it is designed to work (by a class shared variable).Will let this aside for us to think on a better way to implement it.
The first idea that comes into my mind is to implement an event dispatcher natively on each map creation that is bind to a Map instance on the JS side. This would make future implementations easier, but not sure how difficult it could be ti implement.