# Attribution Layer

Before publishing your app to users, you should credit any sources you use, according to their Terms of Service.

There are two built in methods to provide attribution, `RichAttributionWidget` and `SimpleAttributionWidget`, but you can also build your own using a simple `Align` widget.

{% hint style="warning" %}
You must comply with the appropriate restrictions and terms of service set by your tile server. Failure to do so may lead to any punishment, at the tile server's discretion.

This library and/or the creator(s) are not responsible for any violations you make using this package.

*The OpenStreetMap Tile Server (as used above) ToS can be* [*found here*](https://operations.osmfoundation.org/policies/tiles)*. Other servers may have different terms.*
{% endhint %}

{% hint style="success" %}
Please consider crediting flutter\_map. It helps us to gain more awareness, which helps make this project better for everyone!
{% endhint %}

## `RichAttributionWidget`

{% embed url="<https://pub.dev/documentation/flutter_map/latest/flutter_map/RichAttributionWidget-class.html>" %}

An animated, interactive attribution layer that supports both logos/images (displayed permanently) and text (displayed in a popup controlled by an icon button adjacent to the logos).

It is heavily customizable (in both animation and contents), and designed to easily meet the needs of most ToSs out of the box.

<div align="center" data-full-width="false"><figure><img src="https://content.gitbook.com/content/SFuYRJZsfLx0EidjdMud/blobs/Nn8rdeayP30e5RLoziZP/ClosedRichAttribution.png" alt="An icon and a button displayed over a map, in the bottom right corner"><figcaption><p>Closed <code>RichAttributionWidget</code></p></figcaption></figure> <figure><img src="https://content.gitbook.com/content/SFuYRJZsfLx0EidjdMud/blobs/0dYGKWZv98yKbI45396g/OpenedRichAttribution.png" alt="A white box with attribution text displayed over a map" width="375"><figcaption><p>Opened <code>RichAttributionWidget</code>, as in the example app</p></figcaption></figure></div>

<pre class="language-dart"><code class="lang-dart">children: [
  RichAttributionWidget(
    attributions: [
<strong>      // Suggested attribution for the OpenStreetMap public tile server
</strong>      TextSourceAttribution(
        'OpenStreetMap contributors',
        onTap: () => launchUrl(Uri.parse('https://openstreetmap.org/copyright')),
      ),
    ],
  ),
],
</code></pre>

For more information about configuration and all the many options this supports, see the in-code API documentation.

## `SimpleAttributionWidget`

{% embed url="<https://pub.dev/documentation/flutter_map/latest/flutter_map/SimpleAttributionWidget-class.html>" %}

We also provide a more 'classic' styled box, similar to those found on many web maps. These are less customizable, but might be preferred over `RichAttributionWidget` for maps with limited interactivity.

<figure><img src="https://content.gitbook.com/content/SFuYRJZsfLx0EidjdMud/blobs/emdZ6HAlqQTzLDNv9nS3/SimpleAttribution.png" alt=""><figcaption><p><code>SimpleAttributionWidget</code>, as in the example app</p></figcaption></figure>

```dart
children: [
  SimpleAttributionWidget(
    source: Text('OpenStreetMap contributors'),
  ),
],
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fleaflet.dev/layers/attribution-layer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
