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

Changing the color of MapPolygon borders

1 Answer 79 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 11 Jul 2012, 08:55 PM
Hi everyone,

I have loaded in a KML file containing U.S. zipcode areas which are then filled in via Information.Colorizer. If you look at the attached image, you can see that currently the zipcodes all have a white boarder around them. I'd really like to have a black border. I am trying to set the MapPolyon (and MapPath) Stroke, but that doesn't seem to have an effect. Instead they're coming out white.

foreach (var mapgon in list)
{
    ToolTip tooltip = new ToolTip();
    tooltip.Content = (mapgon.GetType() == typeof(MapPath)) ?
                                    ((MapPath)mapgon).ExtendedData : 
                                    ((MapPolygon)mapgon).ExtendedData;
                     
    tooltip.ContentTemplate = this.Resources["TooltipTemplate"] as DataTemplate;
    ToolTipService.SetToolTip(mapgon, tooltip);
 
    if (mapgon.GetType() == typeof(MapPath))
    {
        MapPath temp = (MapPath)mapgon;
        temp.Stroke = new System.Windows.Media.SolidColorBrush()
        { Color = System.Windows.Media.Color.FromArgb(255, 0, 0, 0) };
        temp.StrokeThickness = 4;
    }
    else
    {
        MapPolygon temp = (MapPolygon)mapgon;
        temp.Stroke = new System.Windows.Media.SolidColorBrush()
        { Color = System.Windows.Media.Color.FromArgb(255, 0, 0, 0) };
        temp.StrokeThickness = 4;
    }
    xInfoLayer.Items.Add(mapgon);
}


Can anyone see what I am doing wrong? Thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 16 Jul 2012, 08:01 AM
Hello Sam,

The Colorizer has a priority. If it is specified for the information layer then filling settings made for the shape object will not be used. So you should change the correspondent value in the colorizer settings. For example:

<telerik:ColorMeasureScale.ShapeFillCollection>
    <telerik:MapShapeFill Fill="White" Stroke="Black" StrokeThickness="2" />
    <telerik:MapShapeFill Fill="Red" Stroke="Black" StrokeThickness="2" />
</telerik:ColorMeasureScale.ShapeFillCollection>


Greetings,
Andrey Murzov
the Telerik team

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

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