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

Publish your style

Once you've finished adding data and styling your map, the next step is to add it to a web or mobile application. This section covers everything you can do with your published style.

Mapbox Studio topics covered in this section:

with the dataset editor

Upload

with the dataset editor

Dataset

by exporting your dataset

Tileset

on the styles page

Template style

in the style editor

Custom style

containing your tileset in the style editor

Add data to style

in the style editor

Style data

in the style editor

Publish

Draft vs. production style URLs

For each style you create in Mapbox Studio, there is both a draft and production style URL available:

  • Use the draft style URL to quickly iterate and get feedback on your style without impacting map styles being used in applications already in production.
  • Use the production style URL when your style is ready for end users in a production application.

When making edits to your style in the style editor, the updated style is saved as a draft in your account. The draft style URL will include all edits to your style up to that point. The production style URL will only include edits you have made before hitting the Publish button.

Do not use draft styles in production applications

Draft style URLs are intended for prototyping and iteration — they are not cached and are heavily rate-limited. If you use a draft style URL in a production application, it could cause degraded performance and blank maps for your end users due to rate limiting. Do not use draft style URLs in production.

Publish

Before using your style in a production application, you need to publish it inside the style editor. When making edits to your style in the style editor, the updated style is saved as a draft in your account. Changes made in the style editor will not be reflected in the production version of your style until you explicitly publish it using the Publish button.

Share button

Inside the style editor, there is a Share button in the top toolbar. This button will open a modal with all the available options for sharing or using your style as either a draft or production-ready style in an application.

For both draft and production versions of your style, there are three options for using the style:

  • Share: A URL that can be shared with anyone.
  • Develop: Convenient access to the resources needed to use your style on various platforms.
  • Download: Download a zipped folder with the style JSON and all necessary assets.

Read more about each option below.

Share URL

The Share URL provides a staging address for your map style. It gives you a quick way to share your map with others to get feedback, collaborate on designs, or to show off your creative work. Click the clipboard button clipboard to copy the share URL to your clipboard. Paste it into a browser window to see your style.

Develop

Your style URL and access token are provided in the share modal so you can use your custom style in a web, mobile, or third party application. A style URL is how you refer to your map style . Combined with your access token, it allows you to access and use your map with any of the Mapbox products.

Style URL

A complete style URL, for example mapbox://styles/mapbox/standard, contains three parts:

  • mapbox://styles - points to Mapbox's Styles API
  • mapbox - the Mapbox username of the style owner
  • standard - the style's unique ID

If you are using the draft version of your style, /draft will be appended to the end of the style URL like this:

  • mapbox://styles/examples/ck3z58tz90gqf1bs6e4xnzrz4/draft
Note

The mapbox://styles notation for Mapbox styles is an alias to the full Styles API URL: https://api.mapbox.com/styles/v1/standard.

Access token

Mapbox uses access tokens to associate your apps and tool usage with your account. Every account has a default public access token, but you can create new access tokens as well. You can find your access tokens on the Access Tokens page of your Developer Console.

Platforms

Toggle to the platform that is relevant to your project for related resources.

Web

The Web option provides the resources necessary to initialize your map style on a webpage using Mapbox GL JS.

Mapbox GL JS is a JavaScript library for creating interactive maps with Mapbox styles. This API harnesses the power of GL-driven maps, including smooth zooming, map bearing and pitch, and vector data available for interaction and styling in the browser. You can use custom styles created in the Mapbox Studio style editor, or the default styles we provide, and programmatically add additional data including GeoJSON, images, or even video!

For information on using a Mapbox Studio style with Leaflet, see the Leaflet section below.

Right-to-left support in Mapbox GL JS

Mapbox Studio loads the mapbox-gl-rtl-text plugin, which adds support for text in the Arabic and Hebrew languages, by default. This plugin is not bundled with Mapbox GL JS. You must set it using the setRTLTextPlugin method in Mapbox GL JS.

iOS, Android, and Unity

The iOS, Android, and Unity options provide the resources necessary to use your map style with one of our mobile Maps SDKs.

Third party

The Third party options provide the resources necessary to use your custom map style with various third-party applications including ArcGIS Online, Tableau, CARTO, and Fulcrum.

Both Mapbox template styles and your custom styles designed in Mapbox Studio come with a WMTS endpoint that can be used to add your styles to desktop GIS applications. You can use the following endpoint with any of your custom styles:

https://api.mapbox.com/styles/v1/YOUR_MAPBOX_USERNAME/YOUR_STYLE_ID/wmts?access_token=YOUR_MAPBOX_ACCESS_TOKEN

This WMTS endpoint allows you to use this map in:

Download

Download a zip file that contains all pieces of your style, including a JSON document adhering to the Mapbox Style Specification, the sprite containing all icons and images used in the style, and all fonts used in the style. This can be stored locally, altered in a text editor, uploaded to your account, or shared with other Mapbox Studio users.

Leaflet

Leaflet is an open-source JavaScript library for mobile-friendly interactive maps. You can add a Mapbox Studio style to a Leaflet map using the Mapbox Static Tiles API to generate raster tiles from your Mapbox Studio style.

Use the L.TileLayer class to add the raster tiles to your Leaflet map:

var map = L.map('map')
.setView([38.8929, -77.0252], 14)
.addLayer(
L.tileLayer(
'https://api.mapbox.com/styles/v1/YOUR_MAPBOX_USERNAME/YOUR_STYLE_ID/tiles/256/{z}/{x}/{y}?access_token=YOUR_MAPBOX_ACCESS_TOKEN,
{
maxZoom: 19,
attribution:
'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> © <a href="https://www.mapbox.com/about/maps/">Mapbox</a> <strong><a href="https://labs.mapbox.com/contribute/" target="_blank">Improve this map</a></strong>'
}
)
);

Attribution and Terms of Service

Whether you're creating a custom style with Mapbox Studio or building a mobile app with the Android SDK, all Mapbox tools are governed by our attribution requirements and our terms of service. For more information about either of these requirements, contact Mapbox Support.

このpageは役に立ちましたか?