Hi I would like to show a simple image as map.
Just to test this case, I created a new wpf user control.
And on load event handler of map I'm just doing;
wpfMap1.MapUnit = GeographyUnit.Meter;
GdiPlusRasterLayer gdiPlusRasterLayer = new GdiPlusRasterLayer(@"D:\__nanodems__\common\BinaryData\Maps\TestMap.bmp");
gdiPlusRasterLayer.UpperThreshold = double.MaxValue;
gdiPlusRasterLayer.LowerThreshold = 0;
ThinkGeo.MapSuite.WpfDesktopEdition.LayerOverlay layerOverlay = new ThinkGeo.MapSuite.WpfDesktopEdition.LayerOverlay();
layerOverlay.Layers.Add(gdiPlusRasterLayer);
gdiPlusRasterLayer.Open();
wpfMap1.CurrentExtent = gdiPlusRasterLayer.GetBoundingBox();
gdiPlusRasterLayer.Close();
wpfMap1.Overlays.Add(new WorldMapKitWmsWpfOverlay { Projection = WorldMapKitProjection.SphericalMercator });
wpfMap1.Overlays.Add(layerOverlay);
wpfMap1.Refresh();
If computer is connected to the internet everything is fine. But if there is no internet connection, it crashed right after map is loaded with "Object reference not set to an instance of an object."
And stack trace is below;
at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.DrawException(GeoCanvas geoCanvas, Exception exception) at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.Draw(GeoCanvas geoCanvas) at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.KxU=(Object LBU=) at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Many thanks