2 Answers, 1 is accepted
Both the Telerik MapEllipse and the native WPF Ellipse elements do not support setting elements inside of them.
Instead, what comes to my mind, would be to place the MapPinPoint instance on top of the ellipse. To do so, retrieve the location of the ellipse using the MapLayer.GetLocation method and calculate the location on which the MapPinPoint is going to be placed on top of the ellipse. Then, based on the chosen position, you could set a new location using the MapLayer.SetLocation method. Finally, to display it on the RadMap control, add it to the Items collection of the InformationLayer instance (I assume that this layer is used since the MapPinPoint element is utilized).
I have prepared a sample project for you to test regarding this inquiry.
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
First of all, thank you very much for the answer, it helped me a lot.
I have certain PinPoints that probably because their HotSpot is different, I can't put the PinPoint in the center of the Ellipse.
I have attached a KML file that creates one PinPoint, I would appreciate it if you could show me how I put the ellipse around it when the PinPoint is in the center of the circle
var hotSpot = (HotSpot)mapPinPoint.GetValue(MapLayer.HotSpotProperty);
var location = (Location)mapPinPoint.GetValue(MapLayer.LocationProperty);
And it doesn't work well for the PinPoint I attached here
This is my code right now
To achieve this, you could calculate the Location of the Ellipse element when using the MapLayer.SetLocation method. The Location instance that will be returned for the MapPinPoint element could be used to calculate this location.
The following code snippet shows a sample implementation of this suggestion:
var pinPointLocation = (Location)mapPinPoint.GetValue(MapLayer.LocationProperty); MapLayer.SetLocation(ellipse, new Location(pinPointLocation.Latitude + 6, pinPointLocation.Longitude - 11));
The produced result is as follows:
However, the location of the Ellipse would have to be manually recalculated each time a zoom is performed, in order for the MapPinPoint element to appear in its center. Each time a zoom is performed, the ZoomChanged event occurs, which could be utilized when implementing this functionality. In addition, I think that the Zoom article of the RadMap control's documentation could be useful when implementing this functionality.