Skip to content

Commit 118e87d

Browse files
committed
Update MIGRATION_GUIDE_v3.md
1 parent 3030405 commit 118e87d

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

MIGRATION_GUIDE_v3.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Migrate to Mapbox GL JS v3
22

3-
Mapbox GL JS v3 enables the **Mapbox Standard Style**, a new realistic **3D lighting** system, building and terrain **shadows** and many other visual enhancements, and an ergonomic API for using a new kind of rich, evolving, configurable map styles and seamless integration with custom data.
3+
Mapbox GL JS v3 enables the [**Mapbox Standard Style**](https://www.mapbox.com/blog/standard-core-style), a new realistic **3D lighting** system, **3D models** for landmarks, building and terrain **shadows** and many other visual enhancements, and an ergonomic API for using a new kind of rich, evolving, configurable map styles and seamless integration with custom data.
44

55
## Update Dependencies
66

7-
Mapbox GL JS v3 is supported in most modern browsers. Mapbox GL JS v3 is backwards-compatible and existing layers and APIs will continue to work as expected. To use the new Mapbox GL JS v3 beta in your project, you need to import it using the Mapbox GL JS CDN or install the `mapbox-gl` npm package.
7+
Mapbox GL JS v3 is supported in most modern browsers. Mapbox GL JS v3 is backwards-compatible and existing layers and APIs will continue to work as expected. To use the new Mapbox GL JS v3 in your project, you need to import it using the Mapbox GL JS CDN or install the `mapbox-gl` npm package.
88

99
### Mapbox CDN
1010

1111
Include the JavaScript and CSS files in the <head> of your HTML file. The CSS file is required to display the map and make elements like Popups and Markers work.
1212

1313
```html
14-
<script src='https://api.mapbox.com/mapbox-gl-js/v3.0.0-beta.1/mapbox-gl.js'></script>
15-
<link href='https://api.mapbox.com/mapbox-gl-js/v3.0.0-beta.1/mapbox-gl.css' rel='stylesheet' />
14+
<script src='https://api.mapbox.com/mapbox-gl-js/v3.0.0/mapbox-gl.js'></script>
15+
<link href='https://api.mapbox.com/mapbox-gl-js/v3.0.0/mapbox-gl.css' rel='stylesheet' />
1616
```
1717

1818
Include the following code in the `<body>` of your HTML file.
@@ -37,13 +37,13 @@ const map = new mapboxgl.Map({
3737
Install the npm package.
3838

3939
```shell
40-
npm install --save [email protected]-beta.1
40+
npm install --save [email protected]
4141
```
4242

4343
Include the CSS file in the `<head>` of your HTML file. The CSS file is required to display the map and make elements like Popups and Markers work.
4444

4545
```html
46-
<link href='https://api.mapbox.com/mapbox-gl-js/v3.0.0-beta.1/mapbox-gl.css' rel='stylesheet' />
46+
<link href='https://api.mapbox.com/mapbox-gl-js/v3.0.0/mapbox-gl.css' rel='stylesheet' />
4747
```
4848

4949
If you're using a CSS loader like [webpack css-loader](https://webpack.js.org/loaders/css-loader/), you can import the CSS directly in your JavaScript.
@@ -74,13 +74,15 @@ To use Mapbox GL JS, you need to have a Mapbox [access token](https://docs.mapbo
7474

7575
### The Mapbox Standard style
7676

77-
We're excited to announce the launch of Mapbox Standard, our latest Mapbox style, now accessible to all customers in a beta version. The new Mapbox Standard core style enables a highly performant and elegant 3D mapping experience with powerful dynamic lighting capabilities, and an expertly crafted symbolic aesthetic.
77+
We're excited to announce the launch of Mapbox Standard, our latest Mapbox style, now accessible to all customers. The new Mapbox Standard core style enables a highly performant and elegant 3D mapping experience with powerful dynamic lighting capabilities, landmark 3D buildings, and an expertly crafted symbolic aesthetic.
7878

7979
With Mapbox Standard, we are also introducing a new paradigm for how to interact with map styles. When you use this style in your application we will continuously update your basemap with the latest features with no additional work required from you. This ensures that your users will always have the latest features of our maps. You can get more information about the available presets and configuration options of the Standard style in the style documentation.
8080

8181
* The Mapbox Standard Style is now enabled by default when no `style` option is provided to the `Map` constructor. Or, you can still explicitly set the style by passing the URL to the `style` option of the `Map` constructor.
8282

83-
* The Mapbox Standard style features 4 light presets: "Day", "Dusk", "Dawn", and "Night". The style light preset can be changed from the default, "Day", to another preset with a single line of code:
83+
* The Mapbox Standard Style offers a dynamic way to personalize your maps. The map's appearance can be changed using the `map.setConfigProperty` method, where you reference the Standard Style as `basemap`, followed by the configuration property, like light preset or label visibility, and then specify the desired value.
84+
85+
* The Mapbox Standard style features 4 light presets: "Day", "Dusk", "Dawn", and "Night". After the style has loaded, the light preset can be changed from the default, "Day", to another preset with a single line of code:
8486

8587
```js
8688
map.on('style.load', () => {
@@ -109,15 +111,16 @@ Property | Type | Description
109111
`lightPreset` | `String` | Switches between 4 time-of-day states: `dusk`, `dawn`, `day`, and `night`.
110112
`font` | `Array` | Defines font family for the style from predefined options.
111113

112-
### Custom data layers
113-
114-
Mapbox Standard is making adding your own data layers easier for you through the concept of `slot`s. `Slot`s are pre-specified locations in the style where your layer will be added to (such as on top of existing land layers, but below all labels). To do this, we've added a new `slot` property to each `Layer`. This property allows you to identify which `slot` in the Mapbox Standard your new layer should be placed in. To add custom layers in the appropriate location in the Standard style layer stack, we added 3 carefully designed slots that you can leverage to place your layer. These slots will remain stable, so you can be sure that your own map won't break even as the basemap evolves automatically.
114+
Mapbox Standard is making adding your own data layers easier for you through the concept of `slot`s. `Slot`s are predetermined locations in the style where your layer will be added to (such as on top of existing land layers, but below all labels). To do this, we've added a new `slot` property to each `Layer`. This property allows you to identify which `slot` in the Mapbox Standard your new layer should be placed in. To add custom layers in the appropriate location in the Standard style layer stack, we added 3 carefully designed slots that you can leverage to place your layer:
115115

116116
Slot | Description
117117
--- | ---
118118
`bottom` | Above polygons (land, landuse, water, etc.)
119119
`middle` | Above lines (roads, etc.) and behind 3D buildings
120-
`top` | Above all existing layers in the style
120+
`top` | Above POI labels and behind Place and Transit labels
121+
not specified | If there is no identifier, the new layer will be placed above all existing layers in the style
122+
123+
> During 3D globe and terrain rendering, GL JS aims to batch multiple layers together for optimal performance. This process might lead to a rearrangement of layers. Layers draped over globe and terrain, such as `fill`, `line`, `background`, `hillshade`, and `raster`, are rendered first. These layers are rendered underneath symbols, regardless of whether they are placed in the `middle` or `top` slots or without a designated slot.
121124
122125
Set the preferred `slot` on the `Layer` object before adding it to your map and your layer will be appropriately placed in the Standard style's layer stack.
123126

@@ -138,21 +141,15 @@ map.addLayer({
138141

139142
Like with the classic Mapbox styles, you can still use the layer position in `map.addLayer(layer, beforeId)` method when importing the Standard Style. But, this method is only applicable to custom layers you have added yourself. If you add two layers to the same slot with a specified layer position the latter will define order of the layers in that slot.
140143

141-
Standard is aware of the map lighting configuration using the `measure-light` expression, which returns you an aggregated value of your light settings. This returns a value which ranges from 0 (darkest) to 1 (brightest). In darker lights, you make the individual layers light up by using the new `*-emissive-stength` expressions, which allow you to add emissive light to different layer types and for example keep texts legible in all light settings. If your custom layers seem too dark, try adjusting the emissive strength of these layers.
142-
143-
### Customizing Standard
144-
145-
The underlying design paradigm to the Standard style is different from what you know from the classic core styles. Mapbox manages the basemap experience and surfaces key global styling configurations - in return, you get a cohesive visual experience and an evergreen map, always featuring the latest data, styling and rendering features compatible with your SDK. The configuration options make interactions with the basemap simpler than before. During the beta phase, we are piloting these configurations - we welcome feedback on the beta configurations. If you have feedback or questions about the Standard beta style reach out to: [[email protected]](mailto:[email protected]).
146-
147-
You can customize the overall color of your Standard experience easily by adjusting the 3D light settings. Individual basemap layers and/or color values can’t be adjusted, but all the flexibility offered by the style specification can be applied to custom layers while keeping interaction with the basemap simple through `slot`s.
144+
When using the Standard style, you get the latest basemap rendering features, map styling trends and data layers as soon as they are available, without requiring any manual migration/integration. On top of this, you'll still have the ability to introduce your own data to the map and control your user's experience. If you have feedback or questions about the Mapbox Standard style reach out to: [[email protected]](mailto:[email protected]).
148145

149146
Our existing, classic Mapbox styles (such as [Mapbox Streets](https://www.mapbox.com/maps/streets), [Mapbox Light](https://www.mapbox.com/maps/light), and [Mapbox Satellite Streets](https://www.mapbox.com/maps/satellite)) and any custom styles you have built in Mapbox Studio will still work like they do in v2, so no changes are required.
150147

151148
### Lighting API
152149

153150
The new Standard style and its dynamic lighting is powered by the new Style and Lighting APIs that you can experiment with. The following experimental APIs can be used to control the look and feel of the map.
154151

155-
In GL JS v3 we've introduced new experimental lighting APIs to give you control of lighting and shadows in your map when using 3D objects: `AmbientLight` and `DirectionalLight`. We've also added new APIs on `FillExtrusionLayer` and `LineLayer` to support this 3D lighting styling. Together, these properties can illuminate 3D objects to provide a more realistic and immersive map experience for your users. Set these properties at runtime to follow the time of day, a particular mood, or other lighting goals in your map.
152+
In GL JS v3 we've introduced new experimental lighting APIs to give you control of lighting and shadows in your map when using 3D objects: `AmbientLight` and `DirectionalLight`. We've also added new APIs on `FillExtrusionLayer` and `LineLayer` to support this 3D lighting styling and enhance your ability to work with 3D model layers. Together, these properties can illuminate your 3D objects such as buildings and terrain to provide a more realistic and immersive map experience for your users. Set these properties at runtime to follow the time of day, a particular mood, or other lighting goals in your map.
156153

157154
### Style API and expressions improvements
158155

@@ -165,27 +162,22 @@ We have introduced a new set of expressions to enhance your styling capabilities
165162
* Introduced `raster-value` expression: Returns the raster value of a pixel computed via `raster-color-mix`.
166163
* Introduced `distance` expression: Returns the shortest distance in meters between the evaluated feature and the input geometry.
167164

168-
Mapbox GL JS v3 also introduces a new set of style properties:
165+
Mapbox GL JS v3 also introduces a new set of paint properties:
169166

170167
* `background`:
171168
* `background-emissive-strength`
172169
* `circle`:
173170
* `circle-emissive-strength`
174171
* `fill`:
175172
* `fill-emissive-strength`
176-
* `fill-extrusion`:
177173
* `fill-extrusion-ambient-occlusion-ground-attenuation`
178174
* `fill-extrusion-ambient-occlusion-ground-radius`
179-
* `fill-extrusion-ambient-occlusion-intensity`
180-
* `fill-extrusion-ambient-occlusion-radius`
181175
* `fill-extrusion-ambient-occlusion-wall-radius`
182-
* `fill-extrusion-edge-radius`
183176
* `fill-extrusion-flood-light-color`
184177
* `fill-extrusion-flood-light-ground-attenuation`
185178
* `fill-extrusion-flood-light-ground-radius`
186179
* `fill-extrusion-flood-light-intensity`
187180
* `fill-extrusion-flood-light-wall-radius`
188-
* `fill-extrusion-rounded-roof`
189181
* `fill-extrusion-vertical-scale`
190182
* `icon`:
191183
* `icon-emissive-strength`
@@ -199,6 +191,10 @@ Mapbox GL JS v3 also introduces a new set of style properties:
199191
* `text`:
200192
* `text-emissive-strength`
201193

202-
## Known issues
194+
## Known issues and limitations
203195

204196
To report new issues with Mapbox GL JS v3, create a [bug report](https://github.com/mapbox/mapbox-gl-js/issues/new?template=Bug_report.md) on GitHub.
197+
198+
* Discontinued WebGL 1 support. WebGL 2 now mandatory for GL JS v3 usage, aligned with universal [browser support](https://caniuse.com/webgl2).
199+
* During 3D globe and terrain rendering, GL JS aims to batch multiple layers together for optimal performance. This process might lead to a rearrangement of layers. Layers draped over globe and terrain, such as `fill`, `line`, `background`, `hillshade`, and `raster`, are rendered first. These layers are rendered underneath symbols, regardless of whether they are placed in the `middle` or `top` slots or without a designated slot
200+
* In Safari 17 private browsing mode, Apple's Advanced Privacy Protection introduces [noise](https://developer.apple.com/documentation/safari-release-notes/safari-17-release-notes#Private-Browsing) into key fingerprinting areas like 2D Canvas and WebGL and may cause unexpected terrain spikes in GL JS v3.

0 commit comments

Comments
 (0)