OsmSharp / ui

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

How Move Map marker with my position #189

Closed valentinoMalloggia closed 9 years ago

valentinoMalloggia commented 9 years ago

I want to change the position of map marker with my position but don't work i try like this: How can i do? thx _locationManager.LocationsUpdated += (o, e) => { if(e.Locations != null && e.Locations.Length > 0) { if(PositionMarker != null) { // PositionMarker.Location = new GeoCoordinate(e.Locations[0].Coordinate.Latitude, e.Locations[0].Coordinate.Longitude+0.0001); //i try like this but don't works _mapView.RemoveMarker(PositionMarker); _mapView.AddMarker(PositionMarker);

                }
            }
        };
xivk commented 9 years ago

@valentinoMalloggia Probably you need to also do this on the UI-thread. Should work as you are doing it. Also setting marker.Location should also update it.

valentinoMalloggia commented 9 years ago

Yes , i've found the solution thx