Mapbox is a mapping service, and an alternative to Google Maps. It's much simpler to set up: you only need to create two keys.
Why connect Mapbox to Airsquare?
By connecting Mapbox:
You can use our Map widget in the map style of your choice.
You can use our Multi-location map widget, which won't work unless you have Mapbox or Google Maps connected.
We show maps elsewhere on your website (e.g. event pages, organisation directory pages).
We show a "find address" box for shipping / billing addresses in the checkout, allowing customers to quickly find their address and reduce the amount of typing required.
We show maps on your ticket PDFs.
We show a map on 'order shipped' emails which get sent to your customers.
You can use delivery distance/duration based shipping rates.
Mapbox or Google Maps?
Either works for everything above. You only need one.
Mapbox is far quicker to set up, and has a good choice of map styles.
Google Maps is more familiar to most people, and its "find address" box is better outside New Zealand (e.g. Australia, the UK and Ireland).
If you connect both, you choose which one to use under Website > Settings > Maps.
Will I be charged to use Mapbox?
Mapbox offer a generous free tier for each of their services, e.g. tens of thousands of map loads every month.
Unless you have a very large amount of traffic it's unlikely you'd go over this free tier.
See pricing for Mapbox.
How do I connect Mapbox to Airsquare?
We need 2 API keys (Mapbox calls them access tokens):
A Public API key, used by your website's visitors' browsers. It's limited to your website, so nobody else can use it on their own site and run up your bill.
A Private API key, used by our servers (e.g. for shipping rates and the maps in your emails). It's never shown on your website.
Here's what you need to do:
Step 1: Create a Mapbox account
If you don't have a Mapbox account, sign up here:
You may be asked for payment details. This is only used should you go over their free tier.
Step 2: Go to your access tokens
You'll see a 'Default public token'. Leave it alone, we'll create two new ones.
Step 3: Create your 'Public API key'
Click Create a token.
Name it 'Airsquare > Public API Key'.
Leave the Public scopes ticked as they are, and don't tick any Secret scopes.
Under URL restrictions, add each of these addresses:
Replace yourwebsite.com with your own domain name, and yoursite with the first part of your Airsquare address (the address you had before your own domain, ending .airsquare.com).
Click Create token.
Step 4: Create your 'Private API key'
Click Create a token again.
Name it 'Airsquare > Private API Key'.
Leave the Public scopes ticked as they are, and don't tick any Secret scopes.
Leave URL restrictions empty. Our servers can't use a key with URL restrictions, so we'll refuse it if it has any.
Click Create token.
Both keys start with pk. If you see a key starting with sk., that's a secret token for managing your Mapbox account. Don't use it, and never share it.
Step 5: Connect Mapbox to Airsquare
In another window/tab, fire up Airsquare admin and go to Account > Connected Apps.
Click Connect next to Mapbox.
Copy each key from your Mapbox access tokens page into its box: the Public API key and the Private API key.
Click Connect.
We check your Private API key with Mapbox before saving it, and let you know if Mapbox refuses it.
Step 6: Choose your map style
Go to Website > Settings > Maps.
If you also have Google Maps connected, choose Mapbox as your Map provider. If Mapbox is the only one connected, it's used automatically.
Choose a Mapbox style: Standard, Streets, Light, Dark, Outdoors or Satellite streets. If you've designed your own style in Mapbox Studio, choose Your own style and paste in its style URL (it starts with mapbox://styles/).
Click Update.
That's it! Your maps, the checkout's "find address" box, shipping rates and the maps in your emails and PDFs now all use Mapbox.
