-
Notifications
You must be signed in to change notification settings - Fork 90
Panning failure on Android due to presence of markers #267
Comments
Has this something to do with you pull-request or is this a different issue? |
Nope; different issue. I have it fixed in my project but it's not very generalized. I'll write more later; I am out sick. |
OK, get well soon! 👍 |
So basically I made the points of interest on the map into non-buttons and wrote a subclass of MapViewSurface that handles the onTap message and cycles through all the map markers to see if one was tap and call the handler. Basically if your map markers are standard buttons than they'll block touches. But if they're non-touchable and taps are dispatched by some other agent than it can work. I think one of my pull requests was about this – exposing something or another to something. Anyway; this bug is no longer an issue to me so you can close this if you want. I can send you the subclass in question by email if you want. |
Hello JoeCooper, Please could You share a source about creating markers, since by some reason I can't find a working such. Thanks in advance. |
I wrote something like this:
And then in my custom MapViewSurface, I override OnTap, and for each control in MapView.Controls, I check if we ought to interpret it as a hit. My custom MapViewSurface then dispatches an event to a multicast delegate.
|
I mean - how you actually creating the markers and adding them to the map ? |
See above. The first section, ending with mapView.AddControl. A "marker" is a particular kind of control with properties we don't want; they're controls which are also buttons. |
When a user attempts to pan the map by placing a finger upon the screen and dragging it, it fails if the finger initially lands on a map marker.
This is a natural consequence of the way the software is organized with markers existing as buttons attached to the map view; touches do not pass through.
I have a solution for my client which involves using touch-ignorant views as markers (TextViews), forking MapViewSurface and overriding OnTap to check if the tap position falls on any marker in the view.
This requires me to fork OsmSharp's Android UI in order to make OnTap virtual.
Could this be better genericized and integrated into the main branch? Or might this be a no-fix situation?
The text was updated successfully, but these errors were encountered: