I’m finally back trying to get our map ported to your v10 library.
My latest boondoggle appears to be related to drawing an adornment layer previously based on your sample for the Scale Units Adornment (or something like that, it just shows the scale of the map) layer. Everything seems fine up to the point where I try to draw the scale units adornment layer in an overloaded DrawCore of the our class derived from AdornmentLayer.
Ultimately our type structure has a UserControl derived class that contains your WinformsMap. In it’s OnLoad we use BeginInvoke to defer (POST Message) loading all the static layers (layers (shape, etc) and adornment layers). Eventually this results in a call to draw the Scale Units by calling WinformsMap.Refresh( WinformsMap.AdornmentOverlay ). Class name WinformsMap substituted for our instance variable name. Anyway, that calls DrawCore, and we call canvas.DrawArea (argument values confirmed to be reasonable) resulting in the following exception (cleaned methods for our portion). Without knowing what was null in your code, I’m at a loss to figure this out.
Obfuscation bites us again by making what should be easy hard when any intellectual property having enough value to be worth stealing only slightly harder to figure out.
“Object reference not set to an instance of an object.”
at 4EU=.30U=.5UU=(GeoColor color)
at 4EU=.30U=.6EU=(GeoSolidBrush brush)
at ThinkGeo.MapSuite.Drawing.PlatformGeoCanvas.2kU=(GeoBrush brush, IEnumerable1 areaPointsCache) at ThinkGeo.MapSuite.Drawing.PlatformGeoCanvas.1UU=(IEnumerable
1 screenPoints, GeoPen outlinePen, GeoBrush fillBrush, Single xOffset, Single yOffset, PenBrushDrawingOrder penBrushDrawingOrder, Graphics graphics)
at ThinkGeo.MapSuite.Drawing.PlatformGeoCanvas.DrawAreaCore(IEnumerable1 screenPoints, GeoPen outlinePen, GeoBrush fillBrush, DrawingLevel drawingLevel, Single xOffset, Single yOffset, PenBrushDrawingOrder penBrushDrawingOrder) at ThinkGeo.MapSuite.Drawing.GeoCanvas.DrawArea(IEnumerable
1 screenPoints, GeoPen outlinePen, GeoBrush fillBrush, DrawingLevel drawingLevel, Single xOffset, Single yOffset, PenBrushDrawingOrder penBrushDrawingOrder)
at CustomUnitScaleBarAdornmentLayer.DrawOpaqueBackground(GeoCanvas canvas, Single xPos, Single yPos, Single barLength) in CustomUnitScaleBarAdornmentLayer.cs:line 86
at CustomUnitScaleBarAdornmentLayer.DrawCore(GeoCanvas canvas, Collection1 labelsInAllLayers) in CustomUnitScaleBarAdornmentLayer.cs:line 65 at ThinkGeo.MapSuite.Layers.Layer.ZyU=(GeoCanvas canvas, Collection
1 labelsInAllLayers)
at ThinkGeo.MapSuite.Layers.Layer.Draw(GeoCanvas canvas, Collection1 labelsInAllLayers) at ThinkGeo.MapSuite.WinForms.AdornmentOverlay.DrawCore(GeoCanvas canvas) at ThinkGeo.MapSuite.WinForms.Overlay.EFM=(GeoCanvas canvas) at ThinkGeo.MapSuite.WinForms.Overlay.Draw(GeoCanvas canvas) at ThinkGeo.MapSuite.WinForms.WinformsMap.y1I=(Graphics graphics, RectangleShape extent, Overlay overlay) at ThinkGeo.MapSuite.WinForms.WinformsMap.xFI=(RectangleShape drawingExtent, RectangleShape extent) at ThinkGeo.MapSuite.WinForms.WinformsMap.41I=(RectangleShape extent) at ThinkGeo.MapSuite.WinForms.WinformsMap.gRU=(Int32 delayInterval, RectangleShape extent) at ThinkGeo.MapSuite.WinForms.WinformsMap.Refresh(RectangleShape extent, IEnumerable
1 overlays)
at ThinkGeo.MapSuite.WinForms.WinformsMap.Refresh(RectangleShape extent, Overlay overlay)
at ThinkGeo.MapSuite.WinForms.WinformsMap.Refresh(Overlay overlay)
at StaticMap.set_ShowCompass(Boolean value) in StaticMap.cs:line 128
at CustomMap.LoadStateFromConfigFile() in CustomMap.cs:line 317
at CustomMap.Initialize() in CustomMap.cs:line 106
at CustomMapControl.InitializeStatic() in CustomMapControl.cs:line 345