You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
I'm using resources without transparency. Clickable region seems to be much more bigger than image and this is important issue when we have a lot of markers. Also, on 4.1.0 it works fine and area contains only marker.
@mpuchala thank you for reaching out. To give you a some background on marker click handling. Currently we take Android motionEvent and calculate a rectangle from it. The rectangle size is based on the average icon width/height and some additional tolerance:
This rectangle is passed into cpp code and we will be returned all the markers in that rectangle. Using averages here is a very basic way of solving this issue and we could definitely use a more complex approach here.
this is important issue when we have a lot of markers
If possible I would advice you to look into using markers of a similar size. This will improve the clickable area issue but imo also improve consistency in your map design.
Despite the fact I have usually same size icons sometimes it works unstable. When I was analyzing your code I found potential bug. Please take a look on MapView class. In loadIconForMarker(Marker marker) method we have:
when tobrun explained how the code works I was really scratching my head. I just don't really know how everything works under the hood. I was thinking that the pin has width and height and position forming a rect, i tapped the map, I clicked on a pin (touch/mouse position x and y) and then check if that (x,y) is within the bounds of that pin.
I just realized, this works fine on a very very small environment just like on video games. But we are talking about a very very large map and we can't just check all pins on the map if the touch location is within a rect. So at least how it originally works made sense to me.
This thing is a severe bug... Anyone who is using clickable markers, which are anchored at the bottom (that's a really common case) must accept the bad user experience (#7307).
MarkerView clicks are now handled back on the Android SDK View level since Move MarkerView click handling back to View#setOnClickListener #8272, this gives you the expected UX and this approach doesn't suffer from anchoring or average size icons. Feel free to test out beta.3 for this.
Apologies @neonwarge04, I still had to update this issue to the latest state. With 5.0.2 we reverted the changes made for onTouch in the migration of 4.x -> 5.x (#8585). This issue is still applicable for both Markers as MarkerViews.
Activity
[-][Android] Markers problem[/-][+][Android] Marker problems - too big clickable area[/+][-][Android] Marker problems - too big clickable area[/-][+][Android] Too big marker's clickable area[/+]tobrun commentedon Oct 25, 2016
@mpuchala thank you for reaching out. To give you a some background on marker click handling. Currently we take Android motionEvent and calculate a rectangle from it. The rectangle size is based on the average icon width/height and some additional tolerance:
This rectangle is passed into cpp code and we will be returned all the markers in that rectangle. Using averages here is a very basic way of solving this issue and we could definitely use a more complex approach here.
If possible I would advice you to look into using markers of a similar size. This will improve the clickable area issue but imo also improve consistency in your map design.
[-][Android] Too big marker's clickable area[/-][+]Marker clickable area[/+]mpuchala commentedon Oct 25, 2016
@tobrun thanks for clarification.
Despite the fact I have usually same size icons sometimes it works unstable. When I was analyzing your code I found potential bug. Please take a look on MapView class. In
loadIconForMarker(Marker marker)method we have:averageIconWidthis mixed withaverageIconHeightwhen you're setting it. I don't think it's kind of workaround more like oversight, isn't it?tobrun commentedon Oct 25, 2016
I noticed the same thing today, I have a fix for that in #5639
tobrun commentedon Dec 7, 2016
Adding here that improving this system should also take in account anchoring as noted in #7307.
pnull commentedon Jan 31, 2017
Any chance that this will be fixed soon? We have serious problems with this offset bug..
MikeKasperlik commentedon Feb 9, 2017
Yep we see this too in our App
galacticappster04 commentedon Mar 17, 2017
when tobrun explained how the code works I was really scratching my head. I just don't really know how everything works under the hood. I was thinking that the pin has width and height and position forming a rect, i tapped the map, I clicked on a pin (touch/mouse position x and y) and then check if that (x,y) is within the bounds of that pin.
I just realized, this works fine on a very very small environment just like on video games. But we are talking about a very very large map and we can't just check all pins on the map if the touch location is within a rect. So at least how it originally works made sense to me.
mariusboepple commentedon Mar 17, 2017
This thing is a severe bug... Anyone who is using clickable markers, which are anchored at the bottom (that's a really common case) must accept the bad user experience (#7307).
This should be of higher priority...
tobrun commentedon Mar 17, 2017
Small update on this issue:
galacticappster04 commentedon Apr 7, 2017
Has this been implemented on the v5.0.2? Please confirm. If so close this issue.
tobrun commentedon Apr 7, 2017
Apologies @neonwarge04, I still had to update this issue to the latest state. With 5.0.2 we reverted the changes made for onTouch in the migration of 4.x -> 5.x (#8585). This issue is still applicable for both Markers as MarkerViews.
tobrun commentedon Apr 19, 2017
Tracking latest state in #8159