Mapbox GL JS
Mon
Wed
Fri
JunJulAugSepOctNovDecJanFebMarAprMayJun
LessMore
Releases13Avg4/moVersionsv3.21.0 to v3.25.0
Last Checked
3h ago
Latest
v3.25.0
import * as mapboxgl from 'mapbox-gl/esm') so that modern bundlers can eliminate small unused parts of the code. Replace mapboxgl.accessToken with Map accessToken option. Most of the bundle still can't be statically eliminated, but this release also improves lazy loading of code at runtime, with more improvements on the way.Map getLayerProperty and setLayerProperty to support layer-level properties (minzoom, maxzoom, filter, slot, appearances)TileProvider API to accept ImageBitmap for raster and raster-dem providers.GeolocateControl ready event and setShowAccuracyCircle, setShowUserHeading, setFitBoundsOptions, setShowUserLocation methods.KeyboardHandler disablePan/enablePan methods.DragRotateHandler disablePitch/enablePitch methods.TouchZoomRotateHandler disableTapDragZoom/enableTapDragZoom methods.Map setLanguage, getLanguage, setWorldview, getWorldview as stable public methods (previously private).package.json slightly improving NPM install size and time.Cutoff is currently disabled on terrain warning on Standard style.model-line-cutout-mode property.line-emissive-strengthline-blend-additive-clamp property.idle event.line-trim-offset property without lineMetrics.fill-extrusion layers when terrain is enabled in specific edge cases.TileProvider for raster and raster-dem sources, adding support for PMTiles with raster tiles.import mapboxgl from 'mapbox-gl/esm').line-dasharray not working.scale-factor being applied twice to icons with feature-dependent icon-size.baseApiUrl is not a Mapbox host.TileProvider API, a mechanism for extending GL JS with custom vector tile providers.TileProvider API and an official plugin (``mapbox-gl-pmtiles-provider.js`) that loads on demand.line-blend-mode property for rendering lines using additive or multiply blending.setWorldview not updating layout properties correctly.*-cutoff-fade-range properties.clip layer not clipping fill-extrusion ambient occlusion.mapbox-gl-unminified.js bundle in the distribution — please switch to either mapbox-gl.js, mapbox-gl-dev.js, or the new esm-min/mapbox-gl.js ESM bundle.spriteFormat Map option — now Mapbox styles will always use vector icons, while non-Mapbox styles will continue using classic raster sprites.@types/mapbox__point-geometry package that was causing some Typescript builds to fail.line-z-offset and line-elevation-reference.text-size-scale-range and icon-size-scale-range style properties.Map#setScaleFactor/Map#getScaleFactor methods for controlling symbol layer scaling.text-field.raster-elevation-reference paint property to elevate raster layers relative to ground instead of sea level.line-elevation-ground-scale layout property to scale elevated lines with terrain exaggeration.browserslist.pitch and distance expressions in filters.setFeatureState.Map#setNearClipOffset/Map#getNearClipOffset methods to control the near clip offset when ortohographic projections are used.RasterArrayTileSource#reload() not working correctly.ModelSource.NavigationControl.visibility: none in case properties were changed.fill-extrusion layer, overriding clip layer's behaviour.visibility property in clip layers.raster-color precision for fine-grained value ranges.icon-size.scaleFactor support for images within text-field.showButton option to GeolocateControl that allows hiding the control button.followUserLocation option and setFollowUserLocation method to GeolocateControl to control whether the map follows the user's location.GeolocateControl timeout handling.text-rotate, text-size, and text-offset properties in appearances.shadow-draw-before-layer property to directional light, allowing control over shadow draw order in the layer stack.model-allow-density-reduction property to model layers. (h/t @JoshuaJMoore)icon-text-fit rendering with an incorrect size.icon-size not working correctly with coalesce expressions.raster-color interpolation when using nearest raster-resampling.GeolocateControl error event (h/t @lucavb).dynamic: true mode.AttributionControl links sanitization.icon-size using the default value instead of the layout-defined one.ModelSource.setModels while models are still loading.map.getStyle() output.@mapbox/mapbox-gl-style-spec for direct imports.line-emissive-strength data-driven.extra_bounds property of raster and vector sources.model layer.building layer.building layer performance.raster-array layers not working on iOS < 18.4.setData.AttributionControl.Map setLayerProperty that combines setLayoutProperty & setPaintProperty into one method for convenience.model source and layer.sourcedata event data.queryRenderedFeatures for model layers.GeolocationPosition to geolocate event listeners.scaleFactor.queryRasterValue method for querying values in raster-array layers.icon-image-use-theme property.hsla expression performance.queryRasterValue results to 12 decimal digits to fix precision issues."Infinity" and similar ids.GL_INVALID_VALUE console warning on Mapbox Satellite Standard and a few other styles.*-occlusion-opacity properties didn't have any effect.glyphs URL template from the root style instead of their own.split expression to divide a string into an array of substrings based on a specified delimiter.icon-image-cross-fade.raster layers from a single raster-array source.setData on large datasets.interpolate expression will interpolate between non-alpha-premultiplied colors. The change might affect raster-particle-color, line-gradient, and heatmap-color.rgb expression will return non-premultiplied-alpha color.["worldview"] expression, which returns the current worldview of the map.model-translation support for batched model layers.mapbox-gl-rtl-text v0.3.0 plugin not loading in certain configurations.text-variable-anchor disappearing.mouseleave without mouseenter.color-use-theme property of 3D lights.config expressions (h/t @brncsk) #13453.setStyle with the same URL of an import.wrapTileId property to CustomLayerInterface to control whether tile IDs are wrapped across world copies during rendering.line-pattern-cross-fade, fill-pattern-cross-fade, and fill-extrusion-pattern-cross-fade properties for smooth transitions between pattern images.extra_bounds in TileJSON for more fine-grained control over tile requests, particularly when dealing with sparse data coverage.setData on symbol layers could cause flickering.CustomSourceInterface TypeScript type that was missing in the public interface.line-gradient validation to work not only on GeoJSON, but also on vector tile sources if they have mapbox_clip_start and mapbox_clip_end properties precomputed.styleimagemissing event not firing in certain scenarios.undefined passed in Marker options not falling back to default values.at expression does not interpolate anymore. Please use at-interpolated if you want to keep the old behavior.at-interpolated expression as the interpolated counterpart to the at expression.altitude marker property to adjust elevation. (h/t @yangtanyu) #13335.getCooperativeGestures and setCooperativeGestures map methods to control cooperative gestures logic after the map is initialized.getGlyphsUrl and setGlyphsUrl map methods to manage the glyphs endpoint URL.pitchRotateKey map option to override the modifier key for rotate and pitch handlers.*-use-theme properties.queryRenderedFeatures not working on duplicated model layers.mouseenter and mouseleave with Interactions API.icon-size.queryRenderedFeatures not working on styles with custom layers.line-join: none.queryRenderedFeatures and querySourceFeatures with featureset, fix filter option to apply to featureset selectors rather than original properties, and add featureNamespace validation.queryRenderedFeatures missing source, sourceLayer and layer properties in resulting features where they should be present.featureset property to target in addInteraction and queryRenderedFeatures options.snow and rain style properties.to-hsla expression.*-use-theme property to override the color theme for specific layers.color-theme overrides in imports.mouseenter, mouseover, mouseleave, and mouseout events for addInteraction.featuresets and layers in the Map#queryRenderedFeatures.clip layer is now stable and no longer marked experimental.line-z-offset would sometimes break layer rendering order.featuresets, an upcoming way to query features in Mapbox Standard and other fragment-based styles.Map addInteraction/removeInteraction methods that make it easier to manage map interactions like clicking and hovering over features.line-cross-slope and line-elevation-reference properties.scaleFactor map option and setScaleFactor method to increase map label size (useful for improving accessibility or adjusting text size for different devices).line-progress expression in non-data-driven line properties.addImport calls.symbol-z-offset not working properly.line-emissive-strength not being applied to patterned lines.background-pitch-alignment property of the background layer, which is set to map by default but can now be set to viewport. Useful for highlighting individual features by dimming the rest of the map with a semitransparent background.top, right, bottom, and left) (h/t @Ethan-Guttman).retainPadding option for camera movement methods, which can be set to false for pre-v3.4 padding behavior.config expression support in layer filter.symbol-z-offset and symbol-elevation-reference.fill-z-offset property for fill layers.Map#fitBounds for the alternative projections.Map#setPaintProperty and Map#setLayoutProperty methods.string event type in Map event handlers.RequestTransformFunction, ResourceType, and RequestParameters types.fill-extrusion-line-width rendering for large polygonssymbol-z-order is set to auto.minzoom and maxzoom properties were ignored by clip layers.clip layers.cast-shadows property type.setStencilMode-related error in the console with the dev build.fill-exturion layer by introducing fill-extrusion-line-width and fill-extrusion-line-alignment properties. Set fill-extrusion-line-width to a non-zero value to render walls instead of a solid extrusion.circle-blur values.data field.clip-layer-scope property to limit clip layer to a specific style fragment.Map idle method to check whether a map is idle.isSourceLoaded flag on sourcedata event for already loaded sources.load event when all tiles fail to load.dynamic mode is updated too frequently.dynamic mode.Map getLayer not working properly with custom layers.line-trim-offset on very long lines.fill-extrusion-cutoff-fade-range.icon-occlusion-opacity/text-occlusion-opacity properties to opt-in to new occlusion behavior.@types/mapbox-gl are not fully compatible with the new first-class typings. Users relying on the community typings may experience breaking changes. Please remove the @types/mapbox-gl dependency and refer to the v3.5.0 migration guide for instructions on upgrading, resolving common issues, and asking questions regarding the migration to the first-class typings. We welcome your feedback and contributions to make Mapbox GL JS better.color-theme property and Map setColorTheme method to enable colorization with a lookup table (LUT) images.updateData for GeoJSON sources in dynamic mode.icon-occlusion-opacity and text-occlusion-opacity properties to fade symbols behind models and landmarks.line-occlusion-opacity property to fade lines behind 3D objects.clip layer to filter out rendering data.line-z-offset property for a non-globe view.model-cutoff-fade-range property to control fade out of faraway 3D buildings.line-pattern on long lines and higher zooms.line-trim-color and line-trim-fade-range properties to customize rendering of lines trimmed with line-trim-offset.Map getSlots method for listing available slots of a style.updateData calls.raster-particle layer animation.model-front-cutoff property for Meshopt-encoded models.setTerrain.style.load event missing style property.queryRenderedFeatures on areas with missing DEM tiles when terrain is enabled.dynamic: true option for GeoJSON sources that enables partial update API with source.updateData method. Further optimizations for this mode are expected in future releases.Map setConfig, getConfig, setSchema and getSchema methods for batch setting of style configuration options.config option for the Map constructor and setStyle methods for conveniently setting style configuration options on map initialization.icon-color-saturation, icon-color-contrast, icon-color-brightness-min and icon-color-brightness-max to control symbol layer appearance.line-join mode: none to improve line pattern distortions around joins.model-id property to support URIs (in addition to style-defined model references).devtools UI.flyTo ignoring padding in its options.cameraForBounds on globe view. (h/t @jonasnoki) #13126preloadOnly not preloading tiles from style imports.queryRenderedFeatures for non-integer ID in non-tiled model sourcesmodel-scale property for large number of 3D models.raster-particle layer on globe view.raster-array data.symbol-z-elevate.raster-particle layer on certain Android devices.raster-array source type, representing a new experimental Mapbox Raster Tile format which encodes series of tiled raster data (such as weather time series).raster-particle layer which animates particles of different speed and color based on underlying raster-array data.addImport, moveImport, updateImport, and removeImport API methods.getSlot, and setSlot API methods to control layers' slots.queryRenderedFeatures.raster-elevation support for tiled raster sources.config expression support in fog.maxZoom.setStyle.z offset when the opacity is evaluated at 0 on the zoom change.format expression in the config expression.symbol-sort-key property.devtools: true in Map options.map.areTilesLoaded.fill-extrusion-flood-light-ground-radius property.fill-extrusion-cutoff-fade-range property.map.flyTo with padding option was setting and overriding map's padding.url or tiles is missing from source, i.e. in MapTiler source.config expression chaining through nested styles and other issues related to config scope.config and format expressions not working together.fill-extrusions not being displayed in alternative projections.raster-elevation property for elevating raster layers to a constant height (e.g. clouds over globe).raster-emissive-strength and fill-extrusion-emissive-strength properties for controlling 3D lighting on buildings and raster layers.Map getConfigProperty method for getting current style config values.config support in terrain options.null.minValue, maxValue, stepValue, values, type) when evaluating config options.