Last updated

Mapbox accounts and tokens

Deep Woods Maps draws every map with Mapbox. Each map runs on one of two Mapbox accounts, which you choose on the map's Settings tab under Mapbox account:

  • Deep Woods Mapbox account: no Mapbox account of your own is needed. Your plan includes a number of map views and address lookups each month, and use past that is billed by Deep Woods as overage.
  • Organization Mapbox account: the map uses your own Mapbox tokens, and Mapbox bills map views and lookups to your Mapbox account directly.

Which options you see depends on your plan and on what Deep Woods offers your organization. The Settings tab shows only the options available to that map.

The Deep Woods Mapbox account

When you choose the Deep Woods Mapbox account, the Settings tab shows exactly what the map's plan includes:

  • Map views a month. A view is counted each time the map loads on a page. Previews in the dashboard don't count.
  • Address lookups a month, when the plan includes them. Lookups are used by Find on map and by imports with addresses but no coordinates. If the plan's terms say address lookups aren't included, use your own Mapbox token for them (see Import token).
  • Overage. If the plan has overage, it shows the price per 1,000 views (and per 1,000 lookups, when lookups are included) and the most overage a month. Overage is charged once a month, after the month ends, to the payment method on file for the map's subscription.
  • At the limit. Your sites keep listing your locations, with search and filters, but without the map until the next month, and address lookups stop. Nothing is charged past the limit.

Months are calendar months in UTC.

To use it, tick the agreement under the plan's terms and click Use the Deep Woods Mapbox account. Deep Woods records who agreed and when. If Deep Woods later changes the plan's terms, the Settings tab offers the new terms; the terms you agreed to apply until someone accepts the new ones.

Your usage this month is shown on the Settings tab. When a map nears or passes its allowance, a notice appears on your dashboard home page and the Maps pages.

Positions found by the Deep Woods account

Mapbox's terms don't let Deep Woods show you the coordinates its account looks up. When the Deep Woods account finds a location from its address, the position is saved and shown on the map, but the location shows "Position set" instead of a latitude and longitude, and the Maps API returns no coordinates for it. Coordinates you type, import, or look up with your own Mapbox token are always shown.

If address lookups on the Deep Woods account aren't included, the Locations tab says so. To find locations from their addresses, save your own Mapbox token as the import token; Mapbox bills those lookups to your Mapbox account. Or skip lookups: add Latitude and Longitude columns to your import file, or type the coordinates.

Your own Mapbox account

Create a public token

  1. Sign in at account.mapbox.com, or create a free account.
  2. Under Billing, add a payment method. Mapbox needs one for address lookups whose results can be saved, and for use past its free allowance.
  3. Open Tokens and click Create a token. Name it after your map, for example "Our stores map".
  4. Leave the public scopes as they are. Don't add secret scopes.
  5. Under URL restrictions, add the Deep Woods address shown on the Settings tab (for example https://deepwoods.io). That is all you need: on your website, the map is shown inside a Deep Woods frame, so Mapbox sees the Deep Woods address, not your site's. The restriction stops anyone from using your token anywhere else.
  6. Create the token and copy it. A public token starts with pk..

Then open the map's Settings tab, choose Organization Mapbox account, paste the token under Public token, and click Save. Deep Woods checks the token with Mapbox from your browser and tells you if Mapbox refuses it there.

Never paste a secret token (starting with sk.) as the public token. The public token is visible to anyone who views a page with your map, which is why Deep Woods only accepts pk. tokens there.

Address lookups are permanent geocoding

When Deep Woods finds a location from its address, it keeps the coordinates it gets back. Mapbox allows that only for permanent geocoding, so Deep Woods always asks for it. Permanent geocoding is billed per lookup by Mapbox, at a different rate from map views (see Mapbox pricing), and needs a payment method on your Mapbox account. Without one, Mapbox refuses the lookup and Deep Woods shows "Mapbox refused this request (403)".

To avoid lookups entirely, give your locations coordinates: type them in, or add Latitude and Longitude columns to your import file. See Add and import locations.

Visitor searches are temporary geocoding

When a visitor searches your map for a place, such as a postal code or a city, Deep Woods looks the place up with your public token. The result is only used to sort the list and move the map, never saved, so it is Mapbox's temporary geocoding, which Mapbox bills per search at its own rate (see Mapbox pricing). Searches that match a location's name don't call Mapbox. See How do visitors search the map?

Import token (optional)

Public token onlyPublic token + import token
Shows the mapThe public tokenThe public token
Looks addresses upIn your browser, with the public tokenOn the Deep Woods server, with the import token
StoredShown in your embedEncrypted, never shown again

An import token runs lookups on the Deep Woods server, which sends no web address, so create it without URL restrictions: same public scopes, no secret scopes. Paste it under Import token on the Settings tab. Deep Woods stores it encrypted and only uses it for address lookups. To stop using it, click Remove.

An import token also works with the Deep Woods Mapbox account: the map is shown with the Deep Woods account, and addresses are looked up with your token and billed to your Mapbox account.