# Recommended Options

## URL Template (`urlTemplate`)

*This parameter is not strictly required, but the map is essentially useless without it specified with a valid URL.*

Takes a string that is a valid URL, which is the template to use when the tile provider constructs the URL to request a tile from a tile server. For example:

```dart
        urlTemplate: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
```

will use the OpenStreetMap Tile Server.

{% hint style="danger" %}
You must comply to your tile server's ToS. Failure to do so may result in you being banned from their services.

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

This package is not responsible for your misuse of another tile server.
{% endhint %}

The '{s}', '{z}', '{x}' & '{y}' parts indicate where to place the subdomain, zoom level, x coordinate, and y coordinate respectively. Not providing at least the latter 3 parts won't necessarily throw an error, but the map won't show anything.

## Package Name (`userAgentPackageName`)

Takes a `String`, which should be the unique package name (eg. com.example.app). For example:

```dart
        userAgentPackageName: 'com.example.app',
```

This string is used to construct a 'User-Agent' header, sent with all tile requests (on platforms other than the web, due to Dart limitations), necessary to prevent blocking by tile servers.

Constructed agents are in the format: 'flutter\_map (packageName)'. If the package name is not specified, 'unknown' is used in place.

{% hint style="warning" %}
Although it is not required, not specifying the correct package name will/may group your applications traffic with other application's traffic. If the total traffic exceeds the server's limits, they may choose to block all traffic with that agent, leading to a 403 HTTP error.
{% endhint %}

## Tile Provider (`tileProvider`)

For more information, see:

{% content-ref url="/pages/x2LzdwedaPxt1VzqBAz4" %}
[Tile Providers](/v3/usage/layers/tile-layer/tile-providers.md)
{% endcontent-ref %}

## Retina Mode (`retinaMode`)

A `bool` flag to enable or disable (default) makeshift retina mode, recommended on supporting devices. If the tile server supports retina mode natively ('@2' tiles), you should use them instead, by including the '{r}' placeholder in the [#url-template-urltemplate](#url-template-urltemplate "mention").

If `true`, the providers should request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution. In this case, you should set `MapOptions`'s `maxZoom` should be `maxZoom - 1` instead.

For example, this is the recommended setup:

```dart
        retinaMode: MediaQuery.of(context).devicePixelRatio > 1.0,
```


---

# 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/v3/usage/layers/tile-layer/recommended-options.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.
