ThinkGeo.com    |     Documentation    |     Premium Support

How to change size of Adornment Layers

I am using MapSuite 9 for Xamarin Forms and I am adding a ScaleBar and a ScaleLine to a Map. Using the following code:

            ScaleBarAdornmentLayer scaleBarLayer = new ScaleBarAdornmentLayer();
            scaleBarLayer.Location = AdornmentLocation.LowerRight;
            scaleBarLayer.IsVisible = true;
            scaleBarLayer.UnitFamily = UnitSystem.Imperial;
            mapView.AdornmentOverlay.Layers.Add("ScaleBar", scaleBarLayer);

            ScaleLineAdornmentLayer scaleLineLayer = new ScaleLineAdornmentLayer();
            scaleLineLayer.Location = AdornmentLocation.LowerLeft;
            scaleLineLayer.IsVisible = true;
            scaleLineLayer.UnitSystem = ScaleLineUnitSystem.ImperialAndMetric;
            mapView.AdornmentOverlay.Layers.Add("ScaleLine", scaleLineLayer);

I get the following results

:

How can I make the Bar and/or Line large enough to be readable?

Hi Michael,

There are some options in adornment layer to control scale styles. You can refer the following code to control scale style:
scaleBarLayer.BarPen = new GeoPen(new GeoSolidBrush(new GeoColor(125, 125, 125)), 3);
scaleBarLayer.TextStyle.Font = new GeoFont(“Microsoft Sans Serif”, 11);
scaleBarLayer.XOffsetInPixel = -10;
scaleBarLayer.YOffsetInPixel = -10;

The scale line has the same behavior.

If you have any questions, please feel free to contact us.

Thanks,

Don