Hi Maryam,
Greetings from Syncfusion. To find out the Current Geo location, we have to refer Xamarin.Essential package. After getting GeoCoordinate location, we need to update this value to map markers to pin on the Maps. Please refer the below code snippet to get the GeoCoordinate points of current location.
[C#]:
private async void AddMarkerInCurrentLocation() { try { // To get the current location var location = await Geolocation.GetLastKnownLocationAsync(); // Add the marker on the current location if (location != null) { CustomMarker marker = new CustomMarker(); marker.Latitude = location.Latitude.ToString(); marker.Longitude = location.Longitude.ToString(); layer.Markers.Add(marker); } } catch (Exception ex) { // Handle not supported on device exception await Application.Current.MainPage.DisplayAlert("Alert", ex.Message, "Ok"); } }
|
Please refer the below help document for adding Markers on Map.
We have prepared a sample based on your requirement and it can be downloaded from the below link.
Regards,
Bharathi.