In our app we are using dynamicly generated shapes on theRadMap via map shapes.
All shapes areimplimented as Datatemplates on map Information layers. And it all works ok, until we come to MapEllipse.
An attempt tp bind MapEllipse location to the Location property of the model, Exception is thrown, beacuse Locatuion is mot a Dependency Property.
Is there any way to solve the prolem, excep implemening new calss, based on MapEllipse with custom DependencyProperty?
5 Answers, 1 is accepted
Can you check out the InformationLayerDataBindingInDataTemplate RadMap SDK example which shows how you can bind the MapLayer.Location attached property to a property in your model? Please, give this approach a try and let me know if you find it helpful.
Thank you for reply!
It seems, that variant doesn'tseems to work. My initial code .
It works wellwith size changing, but any attempts to bind location only finish with Exception. But if I hardcode Location coordinates, it works perfectly.
I tried to use same pattern, as you suggested
But in that way the circle just does not appear ath the Map.
The point is using MapEllipse, because it is not affected by Zoom and covers same territory not deppending on the Zoom level.
Maybe I don't get some point of Ellipse and Map Ellipse?
Thank ypu once more!
Thank you for the update.
Please, note that placing Map Shapes such as MapEllipse inside DataTemplates is not fully supported. In your scenario, you can use an Ellipse as in the referenced SDK example from my previous reply.
On a side note, we generally encourage switching to VisualizationLayer (VL) since it has some improvements over the InformationLayer.
Hope this helps.
Thank you for reply!
You mentioned Visualization Layer. So, if I understand ypu correctly,if I use VL and EllipseData, insteared of IL and MapEllipse, Location binding and Dynamic generation of the ellipse willwork correctly?
And anothwer question: can VL Item be clickable on tha map?
Thank you once again!
The Map Shape Data objects implemented for the VisualizationLayer such as EllipseData cannot be put in a DataTemplate since they are not dependency objects. This, however allows them to be created in a background thread.
As for clicking an item when using the VisualizationLayer, you can check out the VisualizationLayerItemsSelection SDK example.