Skip to content

How to use the Mapbox styles?

João Ribeiro edited this page Oct 25, 2018 · 2 revisions

To use the Mapbox styles you must be using the Leaflet API:

$nagMapR_MapAPI = 1;

  1. You must register and confirm your e-mail on the Mapbox website.

  2. After confirming your email, access the studio page.

  3. On the studio page, in the styles area you can create a new style based on an existing one.

    • Select the 'More options':

Mapbox Studio Page

  1. In the panel that opens select the style you want to use as the base:

Mapbox Studio Page

  1. On the editing page:
    • Make the desired changes.
    • When you finish select pusbish.

Style editing page

  1. In the panel that opens select the desired option:
    • I always recommend using 'Publish as new', because sometimes the changes end up having no effect on existing styles.

Style editing page

  1. In the panel that opens, select the following options:
    • Select the tab: Use;
    • Then the option: Third party;
    • Then select: CARTO;
    • Copy the generated link;

Style editing page

  1. The copied link must be informed in the style variable:
$nagMapR_LeafletStyle = 'https://api.mapbox.com/styles/v1/***/***/tiles/256/{z}/{x}/{y}@2x?access_token=***'

João Carlos.

Veja aqui em Português.