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

MapPolygon Styling

1 Answer 148 Views
Map
This is a migrated thread and some comments may be shown as answers.
Nicholas
Top achievements
Rank 1
Nicholas asked on 10 Apr 2012, 12:38 AM
Hi,

I am having an issue with styling MapPolygons. I am able to style some settings such as the tooltip but am unsuccessful in styling other aspects like the border.

What I am trying to do is apply an Effect to a MapPolygon when the mouse is over it. Below is a Xaml snippet of my style, which doesn't work with or without the trigger. 

<Style x:Key="zoneStyle" TargetType="telerik:MapPolygon">
    <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="Effect">
                <Setter.Value>
                    <DropShadowEffect ShadowDepth="3" BlurRadius="3" Color="Purple"/>
                </Setter.Value>
            </Setter>
        </Trigger>
    </Style.Triggers>
</Style>

Applying a BorderBrush in the style doesn't work either. Is there something I am missing?

Thanks in advance.

Nick

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 12 Apr 2012, 11:13 AM
Hello Nicholas,

The map shape objects use regular Silverlight shapes for visualization. The map shapes provide the same set of the painting properties as the regular Silverlight shapes provide (Fill, Stroke, StrokeThikness and so on). These properties are combined in the MapShapeFill object. So you always can refer to the MSDN as well as to the Telerik documentation for detailed information about painting properties:
 
http://msdn.microsoft.com/en-us/library/cc189073(v=vs.95).aspx
http://msdn.microsoft.com/en-us/library/system.windows.shapes.shape(v=vs.95).aspx
http://www.telerik.com/help/silverlight/allmembers_t_telerik_windows_controls_map_mapshapefill.html
 
For example, the MapPolygon shape can use Fill, Stroke and StrokeThikness properties:

<Style x:Key="zoneStyle" TargetType="telerik:MapPolygon">
    <Setter Property="Fill" Value="Azure" />
    <Setter Property="Stroke" Value="Red" />
    <Setter Property="StrokeThickness" Value="2" />
</Style>

Unfortunately triggers and effects aren't supported for map shape objects.

Regards,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Map
Asked by
Nicholas
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or