Ok I am not sure I am understanding you. Let me summarize again what the problem is and what I have done.
Orignally I did not need projection. I added project to my code when I used GoogleMaps layer and then Virtual EArth Layer. I am using Proj4Projection.
I am using Visual Studio 2008. When I was programming my project and debugging there was no problem. The first time I actually published this website to a web server, I used our development Windows 2003 / IIS 6 web server. I received error message form the published website because it could not find Proj4Extension.DLL. I added all the DLL from my distribution of ThinkGeo Web Suite to the System32 directory of the development web server. The applicaiton then ran fine and all functionality was working.
Later on in the process, I published to our development Windows 2008 / IIS 7 web server since this will be the OS of our client when the project is deployed. I received the same error message about Proj4Extension.DLL. I copied the same DLLs I had copied to the IIS server to the IIS 7 server’ system32 directory (both servers are 32bit). Now on IIS 7, everytime I try and load a map that has a projection, the web site basically times out and I get the following message in the Applicaiton Event Log.
“Faulting application w3wp.exe, version 7.0.6002.18005, time stamp 0x49e023cf, faulting module ntdll.dll, version 6.0.6002.18005, time stamp 0x49e03821, exception code 0xc0000374, fault offset 0x000afaf8, process id 0x12d4, application start time 0x01cb86815ae8f0f2.”
I removed the code for projection of the map and the project loads fine. I made a very basic project and projected the map. This one line of code being in the Map causes it to crash.
Map1.CurrentExtent = proj4.ConvertToExternalProjection(rec);
If instead I do
Map1.CurrentExtent = rec;
it will load. BUT I need projection
I tried it on a different Windows 2008 / IIS 7 web server and I get the same results. I am attaching the code for my loadmap function that includes projection.
protected void LoadMap()
{
Map1.CustomOverlays.Clear();
int id = 0;
if (ddlMapChooser.SelectedValue != “”)
{
id = Convert.ToInt32(ddlMapChooser.SelectedValue);
}
else
{
id = 1;
}
//EyascoWebFramework.BLL.Map.Map map = EyascoWebFramework.BLL.Map.Map.GetMapByID(Convert.ToInt32(ddlMapChooser.SelectedValue));
EyascoWebFramework.BLL.Map.Map map = EyascoWebFramework.BLL.Map.Map.GetMapByID(id);
Proj4Projection proj4 = new Proj4Projection();
proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();
RectangleShape rec = new RectangleShape(map.MapMinLong, map.MapMaxLat, map.MapMaxLong, map.MapMinLat);
//Setting up the Map
Map1.Width = map.MapWidth;
Map1.Height = map.MapHeight;
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml(map.MapBackgroundColor));
//Map1.CurrentExtent = new RectangleShape(map.MapMinLong, map.MapMaxLat, map.MapMaxLong, map.MapMinLat);
proj4.Open();
Map1.CurrentExtent = proj4.ConvertToExternalProjection(rec);
proj4.Close();
Map1.MapTools.PanZoomBar.Enabled = map.MapShowDashboard;
Map1.MapTools.PanZoomBar.IsGlobeButtonEnabled = false;
Map1.MapTools.MeasureMapTool.Enabled = map.MapShowDashboard;
Map1.MapTools.MeasureMapTool.MeasureType = MeasureType.None;
//Map1.MapTools.AnimationPanMapTool.Enabled = true;
//Set the Infobar
InfoBar.Width = map.MapWidth - 220;
//GoogleOverlay Googlayer = new GoogleOverlay();
//Googlayer.JavaScriptLibraryUri = new Uri(ConfigurationManager.AppSettings[“GoogleUri”]);
//Googlayer.GoogleMapType = GoogleMapType.Physical;
//Googlayer.IsBaseOverlay = false;
//Creating the Base layer
//WorldMapKitWmsWebOverlay mapoverlay = new WorldMapKitWmsWebOverlay();
//mapoverlay.TransitionEffect = TransitionEffect.Stretching;
//mapoverlay.IsBaseOverlay = false;
VirtualEarthOverlay ve = new VirtualEarthOverlay(“VirtualEarth Map”);
ve.JavaScriptLibraryUri = new Uri(ConfigurationManager.AppSettings[“VEUri”]);
ve.VirtualEarthMapType = ThinkGeo.MapSuite.WebEdition.VirtualEarthMapType.Aerial;
LayerOverlay dynamicOverlay = new LayerOverlay(“Feature Layer”);
dynamicOverlay.IsBaseOverlay = false;
//Creating the Feature Layer Alarm Icons
InMemoryFeatureLayer FL = createFeatureLayer(map.MapMinLong, map.MapMaxLat, map.MapMaxLong, map.MapMinLat, id);
ThinkGeo.MapSuite.Core.Style FS = getFeatureStyle();
FL.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(FS);
PointStyle ps = new PointStyle();
ps.RequiredColumnNames.Add(“stnID”);
ps.RequiredColumnNames.Add(“display”);
ps.RequiredColumnNames.Add(“stnName”);
ps.RequiredColumnNames.Add(“lastValue”);
FL.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(ps);
FL.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping;
FL.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.SuppressPartialLabels = false;
FL.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 40;
FL.DrawingMarginPercentage = 50;
FL.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
FL.DrawingFeatures += new EventHandler<DrawingFeaturesEventArgs>(FL_DrawingFeatures);
FL.FeatureSource.Projection = proj4;
dynamicOverlay.Layers.Add(FL);
//Creating the Feature Layer Text Labels
InMemoryFeatureLayer FL2 = createFeatureLayer(map.MapMinLong, map.MapMaxLat, map.MapMaxLong, map.MapMinLat, id);
FL2.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.CreateSimpleTextStyle(“stnName”, “Arial”, 7, DrawingFontStyles.Bold, GeoColor.StandardColors.Black, GeoColor.StandardColors.White, 5, -20, -12);
FL2.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.RequiredColumnNames.Add(“stnID”);
FL2.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.RequiredColumnNames.Add(“display”);
FL2.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.RequiredColumnNames.Add(“stnName”);
FL2.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.RequiredColumnNames.Add(“lastValue”);
FL2.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping;
FL2.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.SuppressPartialLabels = false;
FL2.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 40;
FL2.DrawingMarginPercentage = 50;
FL2.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
FL2.DrawingFeatures += new EventHandler<DrawingFeaturesEventArgs>(FL_DrawingFeatures);
FL2.FeatureSource.Projection = proj4;
dynamicOverlay.Layers.Add(FL2);
//Creating the Feature Layer For Last Values
InMemoryFeatureLayer FL3 = createFeatureLayer(map.MapMinLong, map.MapMaxLat, map.MapMaxLong, map.MapMinLat, id);
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.CreateSimpleTextStyle(“lastValue”, “Arial”, 7, DrawingFontStyles.Regular, GeoColor.StandardColors.Black, -15, 25);
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.RequiredColumnNames.Add(“stnID”);
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.RequiredColumnNames.Add(“display”);
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.RequiredColumnNames.Add(“stnName”);
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.RequiredColumnNames.Add(“lastValue”);
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping;
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.BestPlacement = true;
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 40;
FL3.DrawingMarginPercentage = 50;
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.SuppressPartialLabels = false;
AreaStyle AS3 = AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.LightYellow, GeoColor.StandardColors.Black);
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.Mask = AS3;
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.MaskMargin = 2;
FL3.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.AllowLineCarriage = true;
FL3.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
FL3.DrawingFeatures += new EventHandler<DrawingFeaturesEventArgs>(FL_DrawingFeatures);
FL3.FeatureSource.Projection = proj4;
dynamicOverlay.Layers.Add(FL3);
//Creating the marker layer
SimpleMarkerOverlay markerOverlay = new SimpleMarkerOverlay(“MarkerOverlay”);
markerOverlay = createMarkerLayer(id);
//Creating the Shape Layer from local files
ShapeFileFeatureLayer shapelayer1 = new ShapeFileFeatureLayer(MapPath(“app_data/MAINS.shp”));
ShapeFileFeatureLayer.BuildIndexFile(MapPath(“app_data/MAINS.shp”));
shapelayer1.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1;
shapelayer1.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
shapelayer1.FeatureSource.Projection = proj4;
LayerOverlay ShapeFiles1 = new LayerOverlay(“Shape Layer”);
ShapeFiles1.IsBaseOverlay = false;
//Add the Shape Layer to the Layer Overlay Object
ShapeFiles1.Layers.Add(shapelayer1);
//Add the base map Layer Overlay object to the Map
//Map1.CustomOverlays.Add(mapoverlay);
Map1.CustomOverlays.Add(ve);
//Add the shapefile overlay
Map1.CustomOverlays.Add(ShapeFiles1);
//Add feature Layer
dynamicOverlay.TileType = TileType.SingleTile;
Map1.CustomOverlays.Add(dynamicOverlay);
//Add marker Layer
Map1.CustomOverlays.Add(markerOverlay);
//Fill chart Types Dropdown Chooser.
odsChartTypes.SelectParameters[“mapID”].DefaultValue = id.ToString();
buttonGrid.DataBind();
Filter(“ALL”);
}
The DLL listed below are the DLL I added to the system32 directory that came from my map suite distribution
MapSuiteProjectionX86.DLL
MapSuiteRasterTiffX86.DLL
msvcp71.DLL
msvcr71.DLL
Proj4ExtensionX86.DLL
TiffWrapperX86.DLL
and the Folder
MapSuiteGeoRasterx86
What should I do, am I suing projection in my code incorrectly? Am I putting the DLLs in the wrong place?
Thanks,
Leon