メインコンテンツまでスキップ

Transfer styles between accounts

There are three approaches to transferring styles between accounts. The first two approaches are true transfers of Mapbox styles from one account to another, but differ depending on whether the style is public or private. The second approach involves referencing a public style from another Mapbox account within your own application.

For public styles saved in your account, you can generate a special link that allows other users to copy your style to their account.

If your style is not already public, you can make it public by:

  1. Visiting your Styles page,
  2. Clicking on the share share icon next to the style you would like to make public, then
  3. Clicking the Make public button.
  4. You will be prompted to confirm that you would like to make your style public. If you are sure, click the Make public confirmation button.

Once your style is public, you will see a copyable link in that style's share menu. To copy your style to a new account, navigate to this link while logged in to the destination account and click on the Copy style button.

Approach 2: Download and re-upload a private style

Transferring private styles between accounts allows you to own a style and make changes to it from a single Mapbox account without making the style public.

You can transfer Mapbox assets between accounts if you have access to the account you're transferring from or if you're given the necessary files.

Styles made with Mapbox Studio can be downloaded in JSON format and re-uploaded as a new style. To download a style, open the style in the Mapbox Studio style editor, click the Share button, and click the link next to the Download option. You can download draft or production versions of your styles.

You can then upload the JSON file to another Mapbox account:

  1. Unzip the folder you downloaded.
  2. Log into the second account.
  3. Click the Upload style link next to the New style button.
  4. Select the style.json file inside the unzipped folder and upload.

If you added any custom icons or fonts to your style, you'll need to add them back manually. Open your newly uploaded style in Mapbox Studio, then:

  1. To add fonts, click Fonts and then Upload new font. Drag and drop the contents of the fonts folder from your downloaded style into the appropriate area.
  1. To add icons (images), click Images and then Upload SVG Image. Drag and drop the contents of the icons folder from your downloaded style into the appropriate area.

Approach 3: Reference a public style

By referencing public styles, you can use Mapbox styles created on other Mapbox accounts in your own application. This approach can be particularly useful if your organization has multiple Mapbox accounts each with their own custom styles, fonts, and sprites.

In this scenario, you have a style from Account A and you’d like Account B to use that style in an application.

By default, Mapbox styles are Private. Navigate to your Styles page and open the menu for the style you want to share. Select Make public.

Once you set the style to Public, you can reference the style within any application by copying the Style URL within the Styles page.

Special note: A Public URL can be referenced by any application using any access token.

Here’s a quick example of how this might look using our Mapbox GL JS library:

mapboxgl.accessToken = '<ACCESS TOKEN FROM ACCOUNT B>';
const map = new mapboxgl.Map({
container: 'map', // container id
style: '<PUBLIC STYLE URL FROM ACCOUNT A>', // stylesheet location
center: [-74.5, 40], // starting position [lng, lat]
zoom: 9 // starting zoom
});
このpageは役に立ちましたか?