Closed klattimer closed 11 years ago
I've discovered a bug in the tileview which is related (but possibly not the cause of) the following issue.
On this line https://github.com/moagrius/TileView/blob/master/src/com/qozix/tileview/TileView.java#L459
you'll see that the tileview calls up to markerManager.removeView when it should be calling up to markerManager.removeMarker - by removing the view the markerManager's internal markerMap is never updated with the markers which are being removed from the view.
Fixing the above bug fixes only half of the problem I'm having, the second part of the problem is that the view rect is not correctly set for the view by the time the marker is tapped, I've created a really horrific hack which works for now but isn't ideal. I'm not entirely certain why the call to onLayout isn't updating the rect correctly but I will keep digging until I find the right way to resolve this.
Very good to know (and good catch by you) to find the removeView/marker mistake - I'll correct that right away.
For the second issue, you might try removing the onChanged test - that was a late add and should work in theory but I really didn't test it explicitly - I assumed the changed boolean params is being correctly passed by the system.
Also, you are free to use standard View listeners (e.g., View.OnClickListener) rather than the MarkerEventListener interface - I'm not sure if that's appropriate for your app, but it's certainly a more familiar set of functionality.
Fixed and committed.
If I zoom my map and tap on the markers which are on screen after the zoom has finished I'm able to tap the markers and get an expected response. However if I scroll without zooming, the markers which were not on screen after the zoom do not respond to events. These markers are on screen so therefore should be tappable.
However I am using the onScrollChanged event to change which markers are added/removed to/from the map (we compute which markers overlap and group those together into one marker so the user is always able to tap the markers).