OsmSharp / ui

The UI components.
http://osmsharp.com/
GNU General Public License v2.0
138 stars 91 forks source link

MapMarker click error #187

Open rodionsh opened 9 years ago

rodionsh commented 9 years ago

On Android, when zooming the map and one finger is on a MapMarker the app crashes.

rodionsh commented 9 years ago

The workaround that worked for me was to comment the line that removes the control in:

internal void NotifyMapChangeToControl(double pixelsWidth, double pixelsHeight, View2D view, IProjection projection, MapControl mapControl) { if (mapControl != null && mapControl.Handle != IntPtr.Zero) { ///Maybe check if the control is pressed before romove //this.RemoveView(mapControl.BaseView); if (mapControl.SetLayout(pixelsWidth, pixelsHeight, view, projection)) { this.AddView(mapControl.BaseView, mapControl.BaseView.LayoutParameters); } } }

xivk commented 9 years ago

AddView probably replaces the view when it is added again. Will try and figure out a better way to update the marker position.