I have a MapControl that needs to be populated with multiple objects (500+). These objects are a kind of POI. When the user clicks on the object (pushpin), I show more information about the POI. So I need:
- A
MapControl capable of handling a large number of child objects - Catching a
Tapped Event
To achieve the second goal, I decided to define my own button template:
<maps:MapControl x:Name="Map"> <maps:MapItemsControl ItemsSource="{Binding Pushpins}"> <maps:MapItemsControl.ItemTemplate> <DataTemplate> <Image Width="40" Height="40" Source="{ ... }" Tapped="OnPushpinTappedAsync" maps:MapControl.Location="{Binding Location}" maps:MapControl.NormalizedAnchorPoint="{Binding AnchorPoint}" /> </DataTemplate> </maps:MapItemsControl.ItemTemplate> </maps:MapItemsControl> </maps:MapControl>
This works fine, except for the fact that the visualization of this approach is AWFULL. Every time I move a map, every Pushpin flickers. As if they are not, I do not know, connected with the situation. They are also lagging behind. It looks very bad. The rendering of these facilities is really small.
An alternative is to add elements to the MapControl MapElements property. This makes the rendering of these objects really enjoyable. But then I lose my binding ability and will have to get around it - I'm not a big fan of it. There is also a second problem - from what I read, rendering objects from the MapElements collection is the best deal. Therefore, this does not guarantee that it will be successful. And this is not an option for me, since in the future I plan to add clustering functionality, so I need to have full control over what is displayed on the map and what is not.
Do you have an idea why these MapControl elements flicker so much? What can I do to prevent this? Thanks in advance for any hint or answer.
source share