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

Colorizer for DynamicLayer added in code behind

3 Answers 83 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sumith Jayasuriya
Top achievements
Rank 1
Sumith Jayasuriya asked on 22 Feb 2011, 08:17 PM
I have an application using RadMap that shows zip code or carrier route boundaries (MapPoygons) in a DynamicLayer.  I have ExtendedData properties for each MapShape.  I want to use the Colorizer.  Can you show me how to intialize the colorizer when the DynamicLayer is added in code behind?

Right now when I find the DynamicLayer using RadMap.FindName the colorizer evaluates to Nothing.  So I am unable to set the Colorizer.ExtendedPropertyName or call Colorizer.Prepare().

Thanks
Sumith

3 Answers, 1 is accepted

Sort by
0
Sumith Jayasuriya
Top achievements
Rank 1
answered on 22 Feb 2011, 11:51 PM
I created a New ColorMeasureScale with the required properties and set DynamicLayer.Colorizer = ColorMeasureScale and everything is working alright when I set the Min and Max values manually.

Since the MapShapes are created in the DyanmicSource what is the appropriate time (event) to call the Colorizer.Prepare method to set the Min and Max values?

Thanks
Sumith   

0
Andrey
Telerik team
answered on 25 Feb 2011, 08:14 AM
Hello Sumith Jayasuriya,

The DynamicLayer gets items by request so you never know whether all items have been read or not. So you can't use automatic methods to calculate Min and Max values with DynamicLayer, because it will provide different results depends on the number of items that have been read already. The only way is set MinValue and MaxValue properties manualy. For example, if you get data to show from the SQL server then you can execute 2 requests to calculate Min and Max values before the actual data reading.

Best wishes,
Andrey Murzov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Dipti
Top achievements
Rank 1
answered on 29 Dec 2011, 07:03 AM
Hi Sumith,

I need to do something very similar, if possible can you please share you code.

Thanks.
~Dipti
Tags
Map
Asked by
Sumith Jayasuriya
Top achievements
Rank 1
Answers by
Sumith Jayasuriya
Top achievements
Rank 1
Andrey
Telerik team
Dipti
Top achievements
Rank 1
Share this question
or