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

ZIndex for templates

3 Answers 210 Views
Map
This is a migrated thread and some comments may be shown as answers.
Jason D
Top achievements
Rank 1
Veteran
Jason D asked on 18 Jan 2019, 08:33 PM

I have a custom class that I'm adding to a VisualizationLayer. I'm using the following template to display it:

<DataTemplate x:Key="PolygonTemplate">
    <telerik:MapPolygonView Points="{Binding Points}" ShapeFill="{Binding ShapeFill}" />
</DataTemplate>

 

Works great. But I don't know how to get the ZIndex working. I tried adding my own ZIndex (that calls PropertyChanged), inheriting from ExtendedDataProvider, putting Canvas.ZIndex in the template but the z-order of the item never changes. If I use a normal PolygonData with the default template, the z-order updates.

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 23 Jan 2019, 02:31 PM
Hello Jason,

The ZIndex property is not synced between the bindable wrapper object (like MapPolygonView) and the map shape object (like PolygonData). I have logged an item for improving this. You can find it in our feedback portal. I also updated your Telerik points.

In the meantime you can use the MapShapeVisualizationCreated event of VisualizationLayer. The event arguments gives you access to the shape data object and you can set its ZIndex property.
private void VisualizationLayer_MapShapeVisualizationCreated(object sender, MapShapeOperationEventArgs e)
{
    e.Data.ZIndex = 100;
}
Can you please try this and let me know if it helps?

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jason D
Top achievements
Rank 1
Veteran
answered on 23 Jan 2019, 05:01 PM

Will try. Also, the only reason I am doing this is because of the issue I am having with PolygonData:

https://www.telerik.com/forums/binding-question

0
Martin Ivanov
Telerik team
answered on 24 Jan 2019, 07:54 AM
Hello Jason,

I hope this solution helps.

About the issue described in the forum, it is not known so I can't tell what happens. However, if you share more information on the issue - like some runnable code - I can check it and see if I can help.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Map
Asked by
Jason D
Top achievements
Rank 1
Veteran
Answers by
Martin Ivanov
Telerik team
Jason D
Top achievements
Rank 1
Veteran
Share this question
or