Skip to main content
All CollectionsIntegrationsSet up location services
How to set up Mapbox or Google Maps for location services
How to set up Mapbox or Google Maps for location services

This article describes how to enable location services in your marketplace.

Juho Makkonen avatar
Written by Juho Makkonen
Updated over 3 weeks ago

Your marketplace may use geolocation services to help providers and customers connect. The most common use of geolocation services is to power search by location, where customers search by location to discover listings nearby. If you plan to use locations in your marketplace, you must integrate a geolocation service.

You don't need to configure a map provider to try out location services in your Test marketplace. Your Test environment already has Mapbox configured.

You can use Mapbox or Google Maps as your geolocation service provider. These must be configured when you are setting up your Live environment if you want to use location search.
​
If you are not sure which one to choose, we recommend Mapbox due to its generous free tier. It also doesn't use cookies, which means it is more compatible with EU's GDPR regulation.

How to use Mapbox as your location provider

  1. Locate the Default public token or, if you wish to create a new one, click + Create a token, give it a name, and make sure all Public scopes are selected. Create the token

  2. Copy the token value

    1. It should look something like pk.aRanDoMStringofLetterSaNDNumbERs

  3. In your Sharetribe Console Live environment, navigate to Integrations > Map

  4. Select "Mapbox"

  5. Paste the token into the field

  6. Press "Save changes"

You're done! Mapbox is now powering your location services.

How to use Google Maps as your location provider

  1. Click on the "Get started" button in the top bar, and follow the instructions to generate your key

  2. After generating your key, you need to enable certain Google Maps capabilities:

    1. Select the project you've created earlier in step 2

    2. At the top of the page, select "+ ENABLE APIS AND SERVICES" or select "Library" in the left side menu to to display the "API Library" tab

    3. Enable the following capabilities, or make sure they are already enabled:

      1. "Places API (New)" (Be careful not to select the legacy and now deprecated "Places API", even if still listed as available)

      2. "Maps Static API"

      3. "Maps JavaScript API"

  3. Go back to your dashboard then navigate to "Credentials" in the left-side menu

  4. Find your API key then, on the right end side of the row, press "Show key" and copy the key (it should look something like aRanDoMStringofLetterSaNDNumbERs)

  5. In your Sharetribe Console Live environment, navigate to Integrations > Map

  6. Select "Google Maps"

  7. Paste the key into the field

  8. Press "Save changes"

You're done! Google Maps is now powering your location services.

In addition to the setup above, make sure to follow API security best practices with your Google Maps API keys. For example, restricting your API key to your Live marketplace ULR will prevent unauthorised use that would impact your billing.

Did this answer your question?