Packages

mapbox-gl

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

Your version

0.40.0

13 Sep 2017Where it was published

0.54.1 is the newest release of 0.40.x.

In short

2 breaking10 new18 fixed

  • breaking

    Map#addImage now requires the image as an HTMLImageElement, ImageData, or object with width, height, and data properties with the same format as ImageData. It no longer accepts a raw ArrayBufferView in the second argument and width and height options in the third argument.

  • breaking

    canvas sources now require a contextType option specifying the drawing context associated with the source canvas. #5155

Release note

:warning: Breaking changes

  • breaking

    Map#addImage now requires the image as an HTMLImageElement, ImageData, or object with width, height, and
    data properties with the same format as ImageData. It no longer accepts a raw ArrayBufferView in the second
    argument and width and height options in the third argument.

  • breaking

    canvas sources now require a contextType option specifying the drawing context associated with the source canvas. #5155

:sparkles: Features and improvements

  • Correct rendering for multiple fill-extrusion layers on the same map #5101

  • Add an icon-anchor property to symbol layers #5183

  • Add a per-map transformRequest option, allowing users to provide a callback that transforms resource request URLs #5021

  • Add data-driven styling support for

  • Add support for SDF icons in Map#addImage() #5181

  • Added nautical miles unit to ScaleControl #5238 (h/t @fmairesse)

  • Eliminate the map-wide limit on the number of glyphs and sprites that may be used in a style #141. (Fixed by #5190, see also mapbox-gl-native#9213

  • Numerous performance optimizations (including #5108 h/t @pirxpilot)

:bug: Bug fixes

  • Add missing documentation for mouseenter, mouseover, mouseleave events #4772

  • Add missing documentation for Marker#getElement() method #5242

  • Fix bug wherein removing canvas source with animate=true leaves map in render loop #5097

  • Fix fullscreen detection on Firefox #5272

  • Fix z-fighting on overlapping fills within the same layer #3320

  • Fix handling of fractional values for layer.minzoom #2929

  • Clarify coordinate ordering in documentation for center option #5042 (h/t @karthikb351)

  • Fix output of stop functions where two stops have the same input value #5020 (h/t @edpop )

  • Fix bug wherein using Map#addLayer() with an inline source would mutate its input #4040

  • Fix invalid css keyframes selector #5075 (h/t @aar0nr)

  • Fix GPU-specific bug wherein canvas sources caused an error #4262

  • Fix a race condition in symbol layer handling that caused sporadic uncaught errors #5185

  • Fix bug causing line labels to render incorrectly on overzoomed tiles #5120

  • Fix bug wherein NavigationControl triggered mouse events unexpectedly #5148

  • Fix bug wherein clicking on the NavigationControl compass caused an error in IE 11 #4784

  • Remove dependency on GPL-3-licensed fast-stable-stringify module #5152

  • Fix bug wherein layer-specific an event listener produced an error after its target layer was removed from the map #5145

  • Fix Marker#togglePopup() failing to return the marker instance #5116

  • Fix bug wherein a marker's position failed to adapt to the marker element's size changing #5133

  • Fix rendering bug affecting Broadcom GPUs #5073