Packages

mapbox-gl

3.34.2 · 3 Nov 2026SEE LICENSE IN LICENSE.txt6M / weekRepositoryHomepagenpmAtom feed

Your version

0.45.0

7 May 2018Where it was published

0.54.1 is the newest release of 0.45.x.

In short

2 breaking20 new27 fixed

  • breaking

    Evented#fire and Evented#listens are now marked as private. Though Evented is still exported, and fire and listens are still functional, we encourage you to seek alternatives; a future version may remove their API accessibility or change its behavior. If you are writing a class that needs event emitting functionality, consider using EventEmitter or similar libraries instead.

  • breaking

    The "to-string" expression operator now converts null to an empty string rather than to "null". #6534

Release note

Breaking changes

  • breaking

    Evented#fire and Evented#listens are now marked as private. Though Evented is still exported, and fire and listens are still functional, we encourage you to seek alternatives; a future version may remove their API accessibility or change its behavior. If you are writing a class that needs event emitting functionality, consider using EventEmitter or similar libraries instead.

  • breaking

    The "to-string" expression operator now converts null to an empty string rather than to "null". #6534

Features and improvements

  • :rainbow: Add line-gradient property #6303

  • Add abs, round, floor, and ceil expression operators #6496

  • Add collator expression for controlling case and diacritic sensitivity in string comparisons #6270

  • Add CSS linting to test suite (h/t @jasonbarry) #6071

  • Add support for configurable maxzoom in raster-dem tilesets #6103

  • Add Map#isZooming and Map#isRotating methods #6128, #6183

  • Add support for Mapzen Terrarium tiles in raster-dem sources #6110

  • Add preventDefault method on mousedown, touchstart, and dblclick events #6218

  • Add originalEvent property on zoomend and moveend for user-initiated scroll events (h/t @stepankuzmin) #6175

  • Accept arguments of type value in "length" expressions #6244

  • Introduce MapWheelEvent#6237

  • Add setter for ScaleControl units (h/t @ryanhamley) #6138, #6274

  • Add open event for Popup #6311

  • Explicit "object" type assertions are no longer required when using expressions #6235

  • Add anchor option to Marker #6350

  • HTMLElement is now passed to Marker as part of the options object, but the old function signature is still supported for backwards compatibility #6356

  • Add support for custom colors when using the default Marker SVG element (h/t @andrewharvey) #6416

  • Allow CanvasSource initialization from HTMLElement #6424

  • Add is-supported-script expression 6260

Bug fixes

  • Align raster-dem tiles to pixel grid to eliminate blurry rendering on some devices #6059

  • Fix label collision circle debug drawing on overzoomed tiles #6073

  • Improve error reporting for some failed requests #6126, #6032

  • Fix several Map#queryRenderedFeatures bugs:

    • account for {text, icon}-offset when querying#6135

    • correctly query features that extend across tile boundaries #5756

    • fix querying of circle layer features with -pitch-scaling: 'viewport' or -pitch-alignment: 'map' #6036

    • eliminate flicker effects when using query results to set a hover effect by switching from tile-based to viewport-based symbol querying #6497

  • Preserve browser history state when updating the Map hash #6140

  • Fix undefined behavior when Map#addLayer is invoked with an id of a preexisting layer #6147

  • Fix bug where icon-image would not be rendered if text-field is an empty string #6164

  • Ensure all camera methods fire rotatestart and rotateend events #6187

  • Always hide duplicate labels #6166

  • Fix DragHandler bugs where a left-button mouse click would end a right-button drag rotate and a drag gesture would not end if the control key is down on mouseup #6193

  • Add support for calling {DragPanHandler, DragRotateHandler}#disable while a gesture is in progress #6232

  • Fix GeolocateControl user location dot sizing when Map's <div> inherits box-sizing: border-box; (h/t @andrewharvey) #6227

  • Fix bug causing an off-by-one error in array expression error messages (h/t @drewbo) #6269

  • Improve error message when an invalid access token triggers a 401 error #6283

  • Fix bug where lines with line-width larger than the sprite height of the line-pattern property would render other sprite images #6246

  • Fix broken touch events for DragPanHandler on mobile using Edge (note that zoom/rotate/pitch handlers still do not support Edge touch events #1928) #6325

  • Fix race condition in VectorTileWorkerSource#reloadTile causing a rendering timeout #6308

  • Fix bug causing redundant gl.stencilFunc calls due to incorrect state checking (h/t @yangdonglai) #6330

  • Fix bug where mousedown or touchstart would cancel camera animations in non-interactive maps #6338

  • Fix bug causing a full-screen flicker when the map is pitched and a symbol layer uses non-zero text-translate #6365

  • Fix bug in to-rgba expression causing division by zero 6388

  • Fix bug in cross-fading for *-pattern properties with non-integer zoom stops #6430

  • Fix bug where calling Map#remove on a map with constructor option hash: true throws an error (h/t @allthesignals) #6490

  • Fix bug causing flickering when panning across the anti-meridian #6438

  • Fix error when using tiles of non-power-of-two size #6444

  • Fix bug causing Map#moveLayer(layerId, beforeId) to remove the layer when layerId === beforeId #6542

  • Fix bug causing Map#querySourceFeatures to throw an Uncaught TypeError(#6555)

  • Fix issue where label collision detection was inaccurate for some symbol layers that shared layout properties with another layer #6558