This question is locked. New answers and comments are not allowed.
Hi,
I try to do a drag and drop operation on the map. I have a MapPolyline and a MapRectangle. I want to drop the rectangle onto the MapPolyline to add the coordinate of the dragged MapRectangle to the polyline.
I use the following markup:
In code behind I wired up the DragInfo, DragQuery, DropInfo and DropQuery events at the user control level, but with the above markup the are never hit.
If I set the AllowDrag on the RectangleLayer and the AllowDrop on the RadMap, then the drag operation starts, but on drop I have the RectangleLayer as Source and the RadMap as destination. But I want to have the MapRectangle as Source and the Polyline as Destination.
EDIT: I figured out that drag an drop works fine on normal UIElements such as Ellipse or Rectangle. If I exchange my drag source MapRectangle with a Rectangle I can drag it. If I replace my MapPolyline with a Line I can drop the Rectangle to it. I can provide a sample if you tell me where to upload it. I tested this with Q1 2011.
While a Rectangle can replace the MapRectangle, the Line can not replace the MapPolyline, because it is not properly projected to geographical coordinats.
What am I doing wrong?
Greetings,
Tobias.
I try to do a drag and drop operation on the map. I have a MapPolyline and a MapRectangle. I want to drop the rectangle onto the MapPolyline to add the coordinate of the dragged MapRectangle to the polyline.
I use the following markup:
<
telerik:RadMap
x:Name
=
"radMap"
Center
=
"40, -100"
ZoomLevel
=
"7"
MouseClickMode
=
"None"
>
<
telerik:RadMap.Provider
>
<
telerik:OpenStreetMapProvider
/>
</
telerik:RadMap.Provider
>
<
telerik:InformationLayer
Name
=
"LineLayer"
>
<
telerik:MapPolyline
Stroke
=
"Red"
StrokeThickness
=
"15"
telerik:RadDragAndDropManager.AllowDrop
=
"True"
>
<
telerik:MapPolyline.Points
>
<
telerik:LocationCollection
>
<
telerik:Location
Latitude
=
"40"
Longitude
=
"-100"
/>
<
telerik:Location
Latitude
=
"41"
Longitude
=
"-100"
/>
<
telerik:Location
Latitude
=
"41"
Longitude
=
"-101"
/>
</
telerik:LocationCollection
>
</
telerik:MapPolyline.Points
>
</
telerik:MapPolyline
>
</
telerik:InformationLayer
>
<
telerik:InformationLayer
Name
=
"RectangleLayer"
>
<
telerik:MapRectangle
Width
=
"10"
Height
=
"10"
Location
=
"40, -101"
Fill
=
"Green"
telerik:RadDragAndDropManager.AllowDrag
=
"True"
/>
</
telerik:InformationLayer
>
</
telerik:RadMap
>
In code behind I wired up the DragInfo, DragQuery, DropInfo and DropQuery events at the user control level, but with the above markup the are never hit.
If I set the AllowDrag on the RectangleLayer and the AllowDrop on the RadMap, then the drag operation starts, but on drop I have the RectangleLayer as Source and the RadMap as destination. But I want to have the MapRectangle as Source and the Polyline as Destination.
EDIT: I figured out that drag an drop works fine on normal UIElements such as Ellipse or Rectangle. If I exchange my drag source MapRectangle with a Rectangle I can drag it. If I replace my MapPolyline with a Line I can drop the Rectangle to it. I can provide a sample if you tell me where to upload it. I tested this with Q1 2011.
While a Rectangle can replace the MapRectangle, the Line can not replace the MapPolyline, because it is not properly projected to geographical coordinats.
What am I doing wrong?
Greetings,
Tobias.