We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Map not refreshed when updating MapMarker location


Started using the updated SfMaps control - first of all - WOW!!!!

Excellent performance, great looking.

One issue - when I update the Latitude/Longitude properties of  the MapMarker it does not update.

I found a work-around - I multiply the zoom by 0.9999 and map refreshes, but since I update 10 times a second,

it prevents me from manual zooming.

I naturally don't want to use this work-around, How can I refresh the map upon single/batch updates of the markers?

3 Replies

RS Ragul Subramani Syncfusion Team December 23, 2022 10:44 AM UTC

We have checked the reported problem “Map not refreshed when updating MapMarker location” by prepared the simple sample and updated the MapMarker’s Latitude and Longitude dynamically. But we are unable to reproduce the reported problem on our end. Could you please check the tested sample and video from the attachment? If still you face the problem, please revert us by modifying the sample based on your application scenario along with replication procedure. This would be help us to provide a better solution at the earliest.

Attachment: MapDemo_a509a926.zip

DR Dror December 23, 2022 01:48 PM UTC

Found my error....

I wasn't sure what was the type of Layer.Markers, only looked at it as IEnumerable, so I inserted new value - List<MapMarkers> which messed everthing.

Why not expose it as ObservableCollection<MapMarker> as it is? Would make things much clearer

Anyway - works great



RS Ragul Subramani Syncfusion Team December 27, 2022 02:07 PM UTC

We changed the Markers type in .NET MAUI SfMaps to IEnumurable<MapMarkers> rather than ObservableCollection<MapMarker>. We received feedback in the Xamarin SfMaps as in many cases, users extended the MapMarkers to the custom markers and set the collection type to ObservableCollection<CustomMarker>. Due to this, the new type cannot be assigned to Markers (type is ObservableCollection<MapMarker>). So, we used the Markers type is IEnumurable in the .NET MAUI Maps. 

Live Chat Icon For mobile
Up arrow icon