Hi Gary,
is this what you mean? I tried and it didn’t work at all. Could you give me an example?
Proj4Projection proj4_NAD83 = new Proj4Projection();
proj4_NAD83.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
proj4_NAD83.InternalProjectionParametersString = “+proj=lcc +datum=NAD83 +lon_0=-94d15 +lat_1=47d3 +lat_2=45d37 +lat_0=45 +x_0=800000 +y_0=100000 +to_meter=0.3048006096012192 +no_defs”;
proj4_NAD83.Open();
ShapeFileFeatureLayer _shapeFile;
ShapeFileFeatureLayer.BuildIndexFile(Server.MapPath("~/App_Data/WoodburySite_pt.shp"), BuildIndexMode.DoNotRebuild);
_shapeFile = new ShapeFileFeatureLayer(Server.MapPath("~/App_Data/WoodburySite_pt.shp"), ShapeFileReadWriteMode.ReadOnly);
_shapeFile.Name = “CAD”;
FeatureCache featureCache_DataSource = new FeatureCache();
_shapeFile.FeatureSource.GeoCache = featureCache_DataSource;
_shapeFile.FeatureSource.GeoCache.IsActive = true;
_shapeFile.FeatureSource.Projection = proj4_NAD83;
layerOverlay = (LayerOverlay)map.CustomOverlays[“CAD”];
InMemoryFeatureLayer _layer_CAD = (InMemoryFeatureLayer)layerOverlay.Layers[“CADLayer”];
_layer_CAD.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.FillSolidBrush.Color = GeoColor.FromArgb(100, GeoColor.StandardColors.RoyalBlue);
_layer_CAD.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = GeoColor.StandardColors.Blue;
_layer_CAD.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen = new GeoPen(GeoColor.FromArgb(200, GeoColor.StandardColors.Red), 5);
_layer_CAD.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolPen = new GeoPen(GeoColor.FromArgb(255, GeoColor.StandardColors.Green), 8);
_layer_CAD.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
_layer_CAD.Open();
_layer_CAD.FeatureSource.Open();
_shapeFile.FeatureSource.Open();
_layer_CAD.FeatureSource.BeginTransaction();
foreach (Feature _f in _shapeFile.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns))
{
_layer_CAD.FeatureSource.AddFeature(_f);
}
_layer_CAD.FeatureSource.CommitTransaction();
_shapeFile.FeatureSource.Close();
string _layer_CAD_Bb = _layer_CAD.GetBoundingBox().GetWellKnownText();
<div id=“Map3” class=“MapZ”>
@{
Html.ThinkGeo().Map(“Map3”, System.Web.UI.WebControls.Unit.Percentage(100), System.Web.UI.WebControls.Unit.Percentage(100))
.MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.StandardColors.White)))
//.CurrentExtent(-20037508.34, -20037508.34, 20037508.34, 20037508.34)
.MapUnit(GeographyUnit.Meter)
.MapTools(mapTools =>
{
mapTools.OverlaySwitcherMapTool().Enabled(true);
mapTools.MouseCoordinateMapTool().Enabled(false);
mapTools.PanZoomBarMapTool().Enabled(false);
mapTools.LoadingImageMapTool().Enabled(false);
mapTools.TouchMapTool().Enabled(true);
mapTools.MouseMapTool().Enabled(true);
mapTools.KeyboardMapTool().Enabled(false);
mapTools.ScaleLineMapTool().Enabled(false);
mapTools.PanZoomMapTool().IsGlobeButtonEnabled(false).Enabled(true);
})
.MarkerOverlay(overlay =>
{
overlay.Name(“MarkerOverlay”)
.IsBaseOverlay(false)
.Columns(col => col.Add(new FeatureSourceColumn(“LocationType”, “INTEGER”, 32)))
.ZoomLevelSet(zoomlevelSet =>
{
MarkerClassBreak classBreak0 = new MarkerClassBreak(0);
MarkerClassBreak classBreak1 = new MarkerClassBreak(1);
classBreak1.DefaultMarkerStyle.WebImage = new ThinkGeo.MapSuite.MvcEdition.WebImage(@"/App_Themes/img/Places/High Detail/48x48/Places - High Detail Headquarters.png", 48, 48);
classBreak1.DefaultMarkerStyle.WebImage.ImageOffsetX = 0;
classBreak1.DefaultMarkerStyle.WebImage.ImageOffsetX = 0;
MarkerClassBreak classBreak2 = new MarkerClassBreak(2);
classBreak2.DefaultMarkerStyle.WebImage = new ThinkGeo.MapSuite.MvcEdition.WebImage(@"/App_Themes/img/Places/High Detail/32x32/Places - High Detail Office Building 1.png", 32, 32);
classBreak2.DefaultMarkerStyle.WebImage.ImageOffsetX = 0;
classBreak2.DefaultMarkerStyle.WebImage.ImageOffsetY = 0;
MarkerClassBreak classBreak3 = new MarkerClassBreak(3);
classBreak3.DefaultMarkerStyle.WebImage = new ThinkGeo.MapSuite.MvcEdition.WebImage(@"/App_Themes/img/Places/High Detail/24x24/Places - High Detail Industrial 2.png", 24, 24);
classBreak3.DefaultMarkerStyle.WebImage.ImageOffsetX = 0;
classBreak3.DefaultMarkerStyle.WebImage.ImageOffsetY = 0;
ClassBreakMarkerStyle classBreakStyle = new ClassBreakMarkerStyle(“LocationType”);
classBreakStyle.ClassBreaks.Add(classBreak0);
classBreakStyle.ClassBreaks.Add(classBreak1);
classBreakStyle.ClassBreaks.Add(classBreak2);
classBreakStyle.ClassBreaks.Add(classBreak3);
classBreakStyle.ColumnName = “LocationType”;
zoomlevelSet.ZoomLevel01.CustomMarkerStyle = classBreakStyle;
zoomlevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
});
})
.DynamicOverlay(overlay =>
{
})
.StaticOverlay(overlay =>
{
})
.HighlightOverlay(overlay =>
{
})
.CustomOverlays(overlays =>
{
overlays.WmsOverlay(“WMS Overlay”)
.WebImageFormat(WebImageFormat.Jpeg)
.Parameters(paras =>
{
paras.Add(“LAYERS”, “WorldMapKitRL_SPHMCT_Simplified”);
paras.Add(“STYLES”, “DEFAULT”);
paras.Add(“SRS”, “EPSG:900913”);
})
.ServerUris(uris =>
{
for (int x = 0; x <= 7; x++)
{
uris.Add(new Uri(“GEOWMS.USAC.MMM.COM:80/WmsHandler.axd”));
uris.Add(new Uri(“GEOWMS.USAC.MMM.COM:81/WmsHandler.axd”));
uris.Add(new Uri(“GEOWMS.USAC.MMM.COM:82/WmsHandler.axd”));
uris.Add(new Uri(“GEOWMS.USAC.MMM.COM:83/WmsHandler.axd”));
uris.Add(new Uri(“GEOWMS.USAC.MMM.COM:85/WmsHandler.axd”));
uris.Add(new Uri(“GEOWMS.USAC.MMM.COM:86/WmsHandler.axd”));
}
})
.TileType(TileType.MultipleTile).TileHeight(256).TileWidth(256)
.TransitionEffect(TransitionEffect.Stretching)
.WrapDateline(WrapDatelineMode.WrapDateline)
.IsBaseOverlay(true);
InMemoryFeatureLayer PrimaryDesignCenterLayer = new InMemoryFeatureLayer();
InMemoryFeatureLayer SecondaryDesignCenterLayer = new InMemoryFeatureLayer();
InMemoryFeatureLayer ProductionPlant = new InMemoryFeatureLayer();
overlays
.LayerOverlay(“PDC”).Name(“PDC”)
.WrapDateline(WrapDatelineMode.WrapDateline)
.Layer(“PrimaryDesignCenterLayer”, PrimaryDesignCenterLayer).Name(“PrimaryDesignCenterLayer”).IsVisible(true).IsBaseOverlay(false)
.TileType(TileType.MultipleTile).TransitionEffect(TransitionEffect.Stretching);
overlays
.LayerOverlay(“SDC”).Name(“SDC”)
.WrapDateline(WrapDatelineMode.WrapDateline)
.Layer(“SecondaryDesignCenterLayer”, SecondaryDesignCenterLayer).Name(“SecondaryDesignCenterLayer”).IsVisible(true).IsBaseOverlay(false)
.TileType(TileType.MultipleTile).TransitionEffect(TransitionEffect.Stretching);
overlays
.LayerOverlay(“PDP”).Name(“PDP”)
.WrapDateline(WrapDatelineMode.WrapDateline)
.Layer(“ProductionPlant”, ProductionPlant).Name(“ProductionPlant”).IsVisible(true).IsBaseOverlay(false)
.TileType(TileType.MultipleTile).TransitionEffect(TransitionEffect.Stretching);
InMemoryFeatureLayer CADLayer = new InMemoryFeatureLayer();
overlays
.LayerOverlay(“CAD”).Name(“CAD”)
.WrapDateline(WrapDatelineMode.WrapDateline)
.Layer(“CADLayer”, CADLayer).Name(“CADLayer”).IsVisible(true).IsBaseOverlay(false)
.TileType(TileType.MultipleTile).TransitionEffect(TransitionEffect.Stretching);
})
.Render();
}
</div>