Mapbox adds interactive maps, place search, routing and static map images to your app.
What you can ask for#
Show a map of my three shops with pins and a popup for each.
Add address search to the checkout form.
Draw the driving route between two addresses and show the distance.
Connect Mapbox#
Step 1: Find the connector
Open Tools, then Connectors, and search for Mapbox. You can also go to Settings, then Connectors, in your dashboard.
Step 2: Select Connect
Select Connect to open the secure form.
Step 3: Enter the details
Fill in Public token (optional) and Secret token (optional). Hidden fields show as dots; use the eye icon to check what you typed. Enter a public token, a secret token, or both. At least one is needed.
Step 4: Save
Select Save connection. Swarmz encrypts the credentials and only decrypts them to call Mapbox for you. Everyone in your workspace can then use the connection.
Where to find your credentials#
In Mapbox, open your access tokens. A public token starts with pk. and is used for maps in the browser, so restrict it to your site's address. A secret token starts with sk. and is for server requests, so give it only the scopes it needs. With both saved, server work prefers the secret token.
What the AI can and can't do#
- Show maps, search addresses, reverse geocode and plan routes.
- Create static map images.
- Requests count against your Mapbox account and its token limits.
- Apps you publish can call this connector too, not just the builder.
- Changes ask for your approval by default. You can adjust this under Agent permissions on the connection. See What an integration can access.
Troubleshooting#
The map is blank.
Check the public token and that its URL restriction includes your site address.
Search fails on the server.
Add a secret token with the scopes for the service you use.
Saving fails.
Enter at least one token.
General steps for any connector are in Connect an integration. Keys and secrets are covered in Secrets and API keys. To remove it, see Disconnect an integration.
What Swarmz can do with it
Interactive maps
Use a restricted public token with Mapbox GL JS in the browser.
Geocoding
Forward and reverse geocode through the server gateway.
Directions
Calculate routes for driving, walking, or cycling.
Static maps
Download bounded static map images without exposing the secret token.
More in Maps & media
Still stuck?
A person from Swarmz Support can take a look.