This may have been reported previously so please forgive me if it has.
I have a set of shapefiles that need to be projected into a different projection. Additionally, I need to show some of the layers after a certain zoom level. I am having issues with showing the layers if they are set to a zoom level other than 1. The layers starting with a zoom level of 1 work just fine. I've put together a simple example of the problem I am having using the "Use a different projection for a vector layer" sample provided. I've made just a couple of minor alterations to it. The first is I added the PanZoomBar to the map. And secondly, I changed the ZoomLevelSet from ZoomLevel01 to ZoomLevel02. By doing so, no layer appears.
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Map1.BackgroundFillBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"));
Map1.MapUnit = GeographyUnit.DecimalDegree;
// 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.ClientCache.CacheId = "WorldLayer";
// Map1.ServerCache.CacheDirectory = MapPath("~/ImageCache/" + Request.Path);
Map1.IsSingleTile = true;
Map1.PanZoomBar.Enabled = true;
// If want to know more srids, please refer Projections.rtf in Documentation folder.
Proj4Projection proj4Projection = new Proj4Projection(4326, 2163);
ShapeFileLayer worldLayer = new ShapeFileLayer(MapPath("~/SampleData/world/cntry02.shp"));
worldLayer.ZoomLevelSet.ZoomLevel02.DefaultAreaStyle = AreaStyles.GetSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1);
worldLayer.ZoomLevelSet.ZoomLevel02.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.FeatureSource.Projection = proj4Projection; worldLayer.Open();
Map1.CurrentExtent = worldLayer.GetBoundingBox();
worldLayer.Close();
Map1.StaticLayers.Add("WorldLayer", worldLayer);
}
}
Thanks,
Binu
99-differentprojection.txt (1.02 KB)