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

Color MapShapes with country code

1 Answer 67 Views
Map
This is a migrated thread and some comments may be shown as answers.
Olivier
Top achievements
Rank 1
Olivier asked on 21 Apr 2011, 10:04 AM
Hello !

I have a little problem with the radmap component,
I'm explain :

I would like to color each country of a europe shape files with one conditions (if the country is available (green) or not(red) for our salesboard)

I try to do that with the extendedproperty and the event "PreviewReadCompleted"

but when i implement there :
 
private void PreviewReadCompleted(object sender, PreviewReadShapesCompletedEventArgs eventArgs)
{
    if (eventArgs.Error == null)
    {
        foreach (FrameworkElement element in eventArgs.Items)
        {
            var shape = element as IExtendedData;
            if (shape != null)
            {
                // setup the property value
                this.SetExtendedPropertyFromDatabase(shape);
            }
        }
    }
}
 
/// <summary>
/// Emulates setting a value from database to extended data.
/// </summary>
private void SetExtendedPropertyFromDatabase(IExtendedData shape)
{
 
    // setup the property value
    shape.ExtendedData.SetValue(this.extendedPropertyName, true);
}



What the best way to determine the country is ratached to the shape actually process ?

Thans for you work and your anwser, if you need more details, just ask me =)

(Sorry for my english ^^)

Best regards

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 26 Apr 2011, 06:44 AM
Hello Olivier,

I am not sure I understand your question completely. The extended data by itself does not concern  the coloring of the shapes. It is just data. Extended data can be used by ColorMeasureScale colorizer to set color to the shape if it is specified for the information layer. You can find an example here:

http://demos.telerik.com/silverlight/#Map/Heatmap
http://demos.telerik.com/silverlight/#Map/USA

You can set fill for the shape object using its properties: Fill, Stroke, StrokeThikness and so on.

Kind regards,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Map
Asked by
Olivier
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or