Saltar al contenido principal

Maps in chat

Location messages in the MonoPhone app show a street map with a pin. By default the map comes from the public OpenStreetMap tile servers and shows "© OpenStreetMap contributors".

When to use your own tiles​

The OpenStreetMap servers are run by volunteers, and their tile usage policy limits heavy use. A company with many users who share locations often should use its own tile server, or a map provider's tiles with the provider's key.

Set the tiles​

The setting is part of the company chat policy and is changed through the API (needs settings:write):

  1. Read the current policy with GET /api/v1/chat/policy and keep its ETag.
  2. Send it back with PUT /api/v1/chat/policy and If-Match, adding:
    • map_tile_url: an https:// address template with {z}, {x} and {y}, for example https://tiles.example.com/{z}/{x}/{y}.png (at most 512 characters). A provider's key goes in the template.
    • map_attribution: the credit line the tiles require, for example © Example Maps (one line, at most 200 characters).
  3. The apps read the tiles from GET /api/v1/chat/map the next time a chat opens.

Set map_tile_url to null to go back to OpenStreetMap. The change is recorded in the activity log (chat.policy_changed).

The web console keeps showing the OpenStreetMap preview for location messages.