Hi,
I have to show some 'POIs' on a map.
The POIs collection is bound using a typical MVVM approach.
Once the map is loaded, a 'best fit' must be applied to see all the POIs as closely as possible.
Finally, I must be able to change the location of the POIs by using drap and drop.
In my first attempt, I used MapPinPoint as elements for the POIs.
The 'move' operation was working fine, but unfortunately the GetBestView gave strange results.
(In fact I had to call it several times in order to really get the best view)
Here is the xaml for the pin point :
Based on the decompiled code, I assumed my issue with 'GetBestView' was due to the fact that MapPinPoint wasn't a 'MapShape'
Thus, I decide to give it a chance with 'MapEllipse' :
Then the 'GetBestView()' just works fine, but unfortunately, I'm don't know how I can nicely implements the 'drag and drop' feture for MapShape.
Can you please provide some help ?
Thx
I have to show some 'POIs' on a map.
The POIs collection is bound using a typical MVVM approach.
Once the map is loaded, a 'best fit' must be applied to see all the POIs as closely as possible.
Finally, I must be able to change the location of the POIs by using drap and drop.
In my first attempt, I used MapPinPoint as elements for the POIs.
The 'move' operation was working fine, but unfortunately the GetBestView gave strange results.
(In fact I had to call it several times in order to really get the best view)
Here is the xaml for the pin point :
<DataTemplate x:Key="ObstructionPointItemTemplate" DataType="mapLayers:ObstructionPointViewModel"> <telerik:MapPinPoint telerik:MapLayer.Location="{Binding Path=Location}" ToolTip="{Binding Label}" > <i:Interaction.Behaviors> <behaviors:PointBehavior/> <!--This behavior allows the drap and drop move--> </i:Interaction.Behaviors> </telerik:MapPinPoint> </DataTemplate>
Based on the decompiled code, I assumed my issue with 'GetBestView' was due to the fact that MapPinPoint wasn't a 'MapShape'
Thus, I decide to give it a chance with 'MapEllipse' :
<DataTemplate x:Key="ObstructionPointItemTemplate" DataType="mapLayers:ObstructionPointViewModel"> <telerik:MapEllipse Width="0.1" Height="0.1" telerik:MapLayer.Location="{Binding Path=Location}" Fill="{StaticResource PointFill}" ToolTip="{Binding Label}" Stroke="{StaticResource ObstructionPointColor}" StrokeThickness="2" > </telerik:MapEllipse> </DataTemplate>
Then the 'GetBestView()' just works fine, but unfortunately, I'm don't know how I can nicely implements the 'drag and drop' feture for MapShape.
Can you please provide some help ?
Thx