Hi Haimo,
Regarding “marker should
stay in center when the user moved the map”:
You can achieve this behavior by using the
MapTileLayer.CenterChanged event. This event is triggered whenever the center
of the map changes due to user actions such as zooming or panning.
In the CenterChanged event handler, you can get the new
center coordinates of the map and update the position of the MapMarker to these
coordinates, ensuring the marker remains fixed at the center of the map, as shown
in the following code snippet:
[C#]:
|
private void
MapTileLayer_CenterChanged(object sender, Syncfusion.Maui.Maps.CenterChangedEventArgs
e)
{
if (e.Center != null)
{
this.mapMarker.Latitude =
e.Center.Latitude;
this.mapMarker.Longitude =
e.Center.Longitude;
}
}
|
This approach will keep the
marker aligned with the center of the map as the user pans or zooms. We have
prepared a sample demonstrating this solution, which is attached for your
reference. Please review the sample and let us know if it meets your requirements.
If you have any further questions or require assistance
with any other aspect, please feel free to reach out. We are here to help.
Regards,
Vishal O.
Attachment:
MapMarkerDemo_11a9c3e8.zip