Hi, Thanks for your reply.
I’ve modified your ‘DrawThematicFeatures’ sample to use our file and it fails in the same way.
In this reply it won’t let me add attachments, so let’s hope selecting the whole class will work.
I added (27700, 27700) because that’s what I found in a post by one of your guys earlier. Without it I don’t get my features drawn at all. The .prj file has ‘PROJCS[“British National Grid (ORD SURV GB)”,GEOGCS[“unnamed”,DATUM[“D_OSGB_1936”,SPHEROID[“Airy - 1848”,6377563,299.319997677743]],PRIMEM[“Greenwich”,0],UNIT[“degree”,0.0174532925199433]],PROJECTION[“Transverse_Mercator”],PARAMETER[“latitude_of_origin”,49],PARAMETER[“central_meridian”,-2],PARAMETER[“scale_factor”,0.9996012717],PARAMETER[“false_easting”,400000],PARAMETER[“false_northing”,-100000],UNIT[“METER”,1]]’ which I’ve looked up to mean 27700.
I’ve also used the projection constructor with this string, but the same error ocurrs.
I’ve read your text, but I’m not calling Open()
using System;
using ThinkGeo.MapSuite.Core;
namespace CSSamples
{
public partial class DrawThematicFeatures : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"));
Map1.CurrentExtent = new RectangleShape(-140, 60, 140, -60);
Map1.MapUnit = GeographyUnit.DecimalDegree;
// Draw thematic features
ClassBreakStyle classBreakStyle = new ClassBreakStyle(“POP_CNTRY”);
classBreakStyle.ClassBreaks.Add(new ClassBreak(double.MinValue, AreaStyles.Grass1));
classBreakStyle.ClassBreaks.Add(new ClassBreak(1000000, AreaStyles.Evergreen2));
classBreakStyle.ClassBreaks.Add(new ClassBreak(10000000, AreaStyles.Evergreen1));
classBreakStyle.ClassBreaks.Add(new ClassBreak(50000000, AreaStyles.Crop1));
classBreakStyle.ClassBreaks.Add(new ClassBreak(100000000, AreaStyles.Forest1));
//ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(MapPath("~/SampleData/world/cntry02.shp"));
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(MapPath("~/SampleData/emb/hsp_r46_region.shp"));
worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(AreaStyles.Country1);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(classBreakStyle);
worldLayer.FeatureSource.Projection = new Proj4Projection(27700, 27700);
Map1.StaticOverlay.Layers.Add(“WorldLayer”, worldLayer);
// The following two lines of code enable the client and server caching.
// If you enable these features it will greatly increase the scalability of your
// mapping application however there some side effects that may be counter intuitive.
// Please read the white paper on web caching or the documentation regarding these methods.
//Map1.StaticOverlay.ClientCache.CacheId = “WorldOverlay”;
//Map1.StaticOverlay.ServerCache.CacheDirectory = MapPath("~/ImageCache/" + Request.Path);
}
}
}