3 Answers, 1 is accepted
You can use following code for this purpose:
the Telerik team
I have another similar question. When adding items to the information layer (for example an ellipse) I noticed that the item is being added at the specified coordinates using it's top-left corner as the starting point. Is it possible to add items centered? In other words, I want the location chosen to designate the center of the ellipse.
Thanks to this post http://www.telerik.com/community/forums/wpf/map/how-to-position-images-without-using-pinpoint.aspx , I was able to solve the above issue by using the VerticalAlignment and HorizontalAlignment properties and setting them to "Center".
The RadMap supports two ways to align FrameworkElement around the location.
The first one is using of VerticalAlignment and HorizontalAlignment properties.
HorizontalAlignment.Right (default) - the element is located to the right of the location.
HorizontalAlignment.Left - the element is shifted to the left of the location.
HorizontalAlignment.Center - the element is centered over the location.
VerticalAlignment.Bottom (default) - the element is located at the bottom of the location.
VerticalAlignment.Top - the element is shifted to the top of the location.
VerticalAlignment.Center - the element is centered over the location.
The second approach is using of the HotSpot definition. The HotSpot can be defined for the whole element as well as for any children inside. Hot spot is a position inside or outside the element which is bound to the geographical location is specified for the framework element. You can see how it can be implemented in our RadMap demo:
For more information please see the Using of the Hot Spot documentation topic:
If you use the MapEllipse shape, then you can use the following sample method to get centered ellipse:
the Telerik team