Hi,
I have a requiremetn to colorcode zipcode areas based on information contained in a mysql database. I aslo have a shapefile that contains the information for zipcode areas (zipcodes.shp)
1. From the mysql database, I retrieve the zipcodes I am interested in, along with the coloding information.
2. I create ShapefileFeatureLayer from the .shp file.
ShapeFileFeatureLayer areaShapeLayer = new ShapeFileFeatureLayer(layerPath);
3. Define a new ValueStyle to added to the ShapefileFeatureLayer.
ValueStyle valueStyle = new ValueStyle();
4. Create a ValueItem for each of the zipcode areas, referencing the appropriate column in the zipcode.shp file and the supplying the relevant coloring.
valueStyle.ColumnName = idColName; foreach(KeyValuePair keyValuePair in uidToArea) { valueStyle.ValueItems.Add(new ValueItem(keyValuePair.Key, new AreaStyle(new GeoPen(GeoColor.SimpleColors.Black), new GeoSolidBrush(MapManager.alignAreas[keyValuePair.Value].GetGeoColor(MapManager.viewLevelIndex))))); } areaShapeLayer.ZoomLevelSet.ZoomLevel05.CustomStyles.Add(valueStyle);
Although this works, it renders very slooow. I initialy added this layer to the DynamicOverlay set since I need to interact with the features. Since it was so slow, I then tried addign it to the StaticOverlay set which sped it up a tad.
Any suggestions how to do this better/more efficient?
Thanks,
Chris