ThinkGeo.com    |     Documentation    |     Premium Support

ScaleBarAdornmentLayer crashes at runtime

Hi,



the following code builds fine but makes the application crash at runtime (unhandled exception while drawing).



 ScaleBarAdornmentLayer scaleLineAdornmentLayer = new ScaleBarAdornmentLayer();
        scaleLineAdornmentLayer.Location = AdornmentLocation.LowerRight;
        scaleLineAdornmentLayer.UnitFamily = UnitSystem.Metric;
        scaleLineAdornmentLayer.HasMask = true;
        scaleLineAdornmentLayer.MaskBrush = new GeoSolidBrush(GeoColor.FromArgb(150, GeoColor.StandardColors.White));
        scaleLineAdornmentLayer.MaskContour = new GeoPen(GeoColor.StandardColors.Transparent);
        scaleLineAdornmentLayer.DisplayUnitString["Meter"] = "m";
        scaleLineAdornmentLayer.DisplayUnitString["Kilometer"] = "km";
        bkgOverlay.Layers.Add("ScaleLineAdornmentLayer", scaleLineAdornmentLayer);



Please advise.

Patrick.

oops, this is for android forum, can you move it ?

Hi Patrick,



This is a bug and we fixed it today. Our workmate will send you the new package later today. Please check the attachment for the code we tested.



Thanks,
Howard

MainActivity.cs.zip (1.41 KB)