This is a migrated thread and some comments may be shown as answers.

Move a MapEllipse by drap And drop

1 Answer 88 Views
Map
This is a migrated thread and some comments may be shown as answers.
Gauthier
Top achievements
Rank 1
Gauthier asked on 05 Dec 2013, 02:44 PM
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 :

        <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

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 10 Dec 2013, 09:33 AM

Hi Gauthier,


First of all, in the Q2 2013 release we've introduced new visualization engine in the RadMap. It has been designed from scratch to have better performance. The new engine is based on the VisualizationLayer class. I would recommend you to give it a try. You can find documentation and examples of the new layer here:

RadMap Visualization Layer Introduction
RadMap DataBinding Demo
RadMap ClusterVirtualization Demo

The VisualizationLayer also contains the GetBestView method and it should work correct in your case.

Unfortunately the MapShapes do not support behaviors. So you should implement 'drag and drop' using mouse events.


Regards,

Andrey Murzov

Telerik

TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.

Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.

Sign up for Free application insights >>
Tags
Map
Asked by
Gauthier
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or