ThinkGeo.com    |     Blog    |     Wiki    |     Support

Attribution for OSM overlay

When I set the attribution for the OpenStreetMapOverlay I don’t see the attribution display anywhere on the map display. In WPF it displays in the lower right corner.

Hi Richard,

For Android the attribution don’t works for now, our developer will look into it and see whether we can support it.

Any update I will let you know.

Regards,

Ethan

Hi Richard,

It looks we cannot add it for Android, but we have a workaround about it.

The result looks like:

And here is the sample about how to implement it, you can modify the x offset and y offset value for different text:

    public class AttributionAdornmentLayer : AdornmentLayer
{
    protected override void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)
    {
        canvas.DrawTextWithScreenCoordinate("Powered by ThinkGeo", new GeoFont("Arial", 10), new GeoSolidBrush(GeoColors.Black), canvas.Width - 150, canvas.Height - 30, DrawingLevel.LabelLevel);
        base.DrawCore(canvas, labelsInAllLayers);
    }
}

         AttributionAdornmentLayer attributionLayer = new AttributionAdornmentLayer();
        map1.AdornmentOverlay.Layers.Add(attributionLayer);

Wish that’s helpful.

Regards,

Ethan