Skip to content

Releases: mapbox/mapbox-gl-js

v0.43.0

21 Dec 19:43
Compare
Choose a tag to compare

⚠️ Breaking changes

  • It is now an error to attempt to remove a source that is in use #5562
  • It is now an error if the layer specified by the before parameter to moveLayer does not exist #5679
  • "colorSpace": "hcl" now uses shortest-path interpolation for hue #5811

✨ Features and improvements

  • Introduce client-side hillshading with raster-dem source type and hillshade layer type #5286
  • GeoJSON sources take 2x less memory and generate tiles 20%–100% faster #5799
  • Enable data-driven values for text-font #5698
  • Enable data-driven values for heatmap-radius #5898
  • Add getter and setter for offset on marker #5759
  • Add Map#hasImage #5775
  • Improve typing for == and != expressions #5840
  • Made coalesce expressions more useful #5755
  • Enable implicit type assertions for array types #5738
  • Improve hash control precision #5767
  • supported() now returns false on old IE 11 versions that don't support Web Worker blob URLs #5801
  • Remove flow globals TileJSON and Transferable #5668
  • Improve performance of image, video, and canvas sources #5845

🐛 Bug fixes

  • Fix popups and markers lag during pan animation #4670
  • Fix fading of symbol layers caused by setData #5716
  • Fix behavior of to-rgba and rgba expressions #5778, #5866
  • Fix cross-fading of *-pattern and line-dasharray #5791
  • Fix colorSpace function property #5843
  • Fix style diffing when changing GeoJSON source properties #5731
  • Fix missing labels when zooming out from overzoomed tile #5827
  • Fix missing labels when zooming out and quickly using setData #5837
  • Handle NaN as input to step and interpolate expressions #5757
  • Clone property values on input and output #5806
  • Bump geojson-rewind dependency #5769
  • Allow setting Marker's popup before LngLat #5893

v0.42.2

21 Nov 21:39
Compare
Choose a tag to compare

🐛 Bug fixes

  • Fix an issue with the scale control being too wide #5715
  • Fix rendering in Safari #5712
  • Fix "Cannot read property 'hasTransition' of undefined" error #5714
  • Fix misplaced raster tiles #5713
  • Fix raster tile fading #5722
  • Ensure that an unset filter is undefined rather than null #5727
  • Restore pitch-with-rotate to nav control #5725
  • Validate container option in map constructor #5695
  • Fix queryRenderedFeatures behavior for features displayed in multiple layers #5172

0.42.1

18 Nov 03:07
Compare
Choose a tag to compare

🐛 Bug fixes

  • Workaround for map flashing bug on Chrome 62+ with Intel Iris Graphics 6100 cards #5704
  • Rerender map when map.showCollisionBoxes is set to false #5673
  • Fix transitions from property default values #5682
  • Fix runtime updating of heatmap-color #5682
  • Fix mobile Safari history.replaceState error #5613

✨ Features and improvements

  • Provide default element for Marker class #5661

v0.42.0

14 Nov 00:04
Compare
Choose a tag to compare

⚠️ Breaking changes

  • Require that heatmap-color use expressions instead of stop functions #5624
  • Remove support for validating and migrating v6 styles
  • Remove support for validating v7 styles #5604
  • Remove support for including {tokens} in expressions for text-field and icon-image #5599
  • Split curve expression into step and interpolate expressions #5542
  • Disallow interpolation in expressions for line-dasharray #5519
  • Map#getLight no longer returns default values; it only returns values explicitly set in the style or at runtime #5682

✨ Features and improvements

  • Improve label collision detection #5150
    • Labels from different sources will now collide with each other
    • Collisions caused by rotation and pitch are now smoothly transitioned with a fade
    • Improved algorithm for fewer erroneous collisions, denser label placement, and greater label stability during rotation
  • Add sqrt expression #5493

🐛 Bug fixes and error reporting improvements

  • Fix viewport calculations for fitBounds when both zooming and padding change #4846
  • Fix WebGL "range out of bounds for buffer" error caused by sorted symbol layers #5620
  • Fix symbol fading across tile reloads #5491
  • Change tile rendering order to better match GL Native #5601
  • Ensure no errors are triggered when calling queryRenderedFeatures on a heatmap layer #5594
  • Fix bug causing queryRenderedSymbols to return results from different sources #5554
  • Fix CJK rendering issues #5544, #5546
  • Account for circle-stroke-width in queryRenderedFeatures #5514
  • Fix rendering of fill layers atop raster layers #5513
  • Fix rendering of circle layers with a circle-stroke-opacity of 0 #5496
  • Fix memory leak caused by actor callbacks #5443
  • Fix source cache size for raster sources with tile sizes other than 512px #4313
  • Validate that zoom expressions only appear at the top level of an expression #5609
  • Validate that step and interpolate expressions don't have any duplicate stops #5605
  • Fix rendering for icon-text-fit with a data-driven text-size #5632
  • Improve validation to catch uses of deprecated function syntax #5667
  • Permit altitude coordinates in position field in GeoJSON #5608

v0.41.0

11 Oct 21:56
Compare
Choose a tag to compare

⚠️ Breaking changes

  • Removed support for paint classes #3643. Instead, use runtime styling APIs or Map#setStyle.
  • Reverted the canvas source contextType option added in 0.40.0 #5449

🐛 Bug fixes

  • Clip raster tiles to avoid tile overlap #5105
  • Guard for offset edgecase in flyTo #5331
  • Ensure the map is updated after the sprite loads #5367
  • Limit animation duration on flyTo with maxDuration option #5349
  • Make double-tapping on make zoom in by a factor of 2 on iOS #5274
  • Fix rendering error with translucent raster tiles #5380
  • Error if invalid 'before' argument is passed to Map#addLayer #5401
  • Revert CanvasSource intermediary image buffer fix #5449

✨ Features and improvements

  • Use setData operation when diffing geojson sources #5332

  • Return early from draw calls on layers where opacity=0 #5429

  • A heatmap layer type is now available. This layer type allows you to visualize and explore massive datasets of points, reflecting the shape and density of data well while also looking beautiful. See the blog post for further details.

  • The value of a style property or filter can now be an expression. Expressions are a way of doing data-driven and zoom-driven styling that provides more flexibility and control, and unifies property and filter syntax.

    Previously, data-driven and zoom-driven styling relied on stop functions: you specify a feature property and a set of input-output pairs that essentially define a “scale” for how the style should be calculated based on the feature property. For example, the following would set circle colors on a green-to-red scale based on the value of feature.properties.population:

    "circle-color": {
      "property": "population",
      "stops": [
        [0, "green"],
        [1000000, "red"]
      ]
    }
    

    This approach is powerful, but we’ve seen a number of use cases that stop functions don't satisfy. Expressions provide the flexibility to address use cases like these:

    Multiple feature properties
    Using more than one feature property to calculate a given style property. E.g., styling land polygon colors based on both feature.properties.land_use_category and feature.properties.elevation.

    Arithmetic
    For some use cases it’s necessary to do some arithmetic on the input data. One example is sizing circles to represent quantitative data. Since a circle’s visual size on the screen is really its area (and A=πr^2), the right way to scale circle-radius is square_root(feature.properties.input_data_value). Another example is unit conversions: feature data may include properties that are in some particular unit. Displaying such data in units appropriate to, say, a user’s preference or location, requires being able to do simple arithmetic (multiplication, division) on whatever value is in the data.

    Conditional logic
    This is a big one: basic if-then logic, for example to decide exactly what text to display for a label based on which properties are available in the feature or even the length of the name. A key example of this is properly supporting bilingual labels, where we have to decide whether to show local + English, local-only, or English-only, based on the data that’s available for each feature.

    String manipulation
    More dynamic control over label text with things like uppercase/lowercase/title case transforms, localized number formatting, etc. Without this functionality, crafting and iterating on label content entails a large data-prep burden.

    Filters
    Style layer filters had similar limitations. Moreover, they use a different syntax, even though their job is very similar to that of data-driven styling functions: filters say, “here’s how to look at a feature and decide whether to draw it,” and data-driven style functions say, “here’s how to look at a feature and decide how to size/color/place it.” Expressions provide a unified syntax for defining parts of a style that need to be calculated dynamically from feature data.

    For information on the syntax and behavior of expressions, please see the documentation.

🔧 Development workflow improvements

  • Made the performance benchmarking runner more informative and statistically robust

v0.40.1

19 Sep 00:22
Compare
Choose a tag to compare

0.40.1 (September 18, 2017)

🐛 Bug fixes

  • Fix bug causing flicker when zooming in on overzoomed tiles #5295
  • Remove erroneous call to Tile#redoPlacement for zoom-only or low pitch camera changes #5284
  • Fix bug where CanvasSource coordinates were flipped and improve performance for non-animated CanvasSources #5303
  • Fix bug causing map not to render on some cases on Internet Explorer 11 #5321
  • Remove upper limit on fill-extrusion-height property #5320

v0.40.0

13 Sep 19:17
Compare
Choose a tag to compare

0.40.0 (September 13, 2017)

⚠️ Breaking changes

  • 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.
  • canvas sources now require a contextType option specifying the drawing context associated with the source canvas. #5155

✨ 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 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

v0.39.1

24 Jul 20:23
Compare
Choose a tag to compare

🐛 Bug fixes

  • Fix packaging issue in 0.39.0 #5025
  • Correctly evaluate enum-based identity functions #5023

v0.39.0

21 Jul 22:55
Compare
Choose a tag to compare

0.39.0 (July 21, 2017)

⚠️ Breaking changes

  • GeolocateControl breaking changes #4479
    • The option watchPosition has been replaced with trackUserLocation
    • The camera operation has changed from jumpTo (not animated) to fitBounds (animated). An effect of this is the map pitch is no longer reset, although the bearing is still reset to 0.
    • The accuracy of the geolocation provided by the device is used to set the view (previously it was fixed at zoom level 17). The maxZoom can be controlled via the new fitBoundsOptions option (defaults to 15).
  • Anchor Markers at their center by default #4751 @andrewharvey
  • Increase significantRotateThreshold for the TouchZoomRotateHandler #4971, @dagjomar

✨ Features and improvements

  • Improve performance of updating GeoJSON sources #4069, @ezheidtmann
  • Improve rendering speed of extrusion layers #4818
  • Improve line label legibility in pitched views #4781
  • Improve line label legibility on curved lines #4853
  • Add user location tracking capability to GeolocateControl #4479, @andrewharvey
    • New option showUserLocation to draw a "dot" as a Marker on the map at the user's location
    • An active lock and background state are introduced with trackUserLocation. When in active lock the camera will update to follow the user location, however if the camera is changed by the API or UI then the control will enter the background state where it won't update the camera to follow the user location.
    • New option fitBoundsOptions to control the camera operation
    • New trackuserlocationstart and trackuserlocationend events
    • New LngLat.toBounds method to extend a point location by a given radius to a LngLatBounds object
  • Include main CSS file in package.json #4809, @tomscholz
  • Add property function (data-driven styling) support for line-width #4773
  • Add property function (data-driven styling) support for text-anchor #4997
  • Add property function (data-driven styling) support for text-justify #5000
  • Add maxTileCacheSize option #4778, @jczaplew
  • Add new icon-pitch-alignment and circle-pitch-alignment properties #4869 #4871
  • Add Map#getMaxBounds method #4890, @andrewharvey @lamuertepeluda
  • Add option (localIdeographFontFamily) to use TinySDF to avoid loading expensive CJK glyphs #4895
  • If config.API_URL includes a path prepend it to the request URL #4995
  • Bump supercluster version to expose cluster_id property on clustered sources #5002

🐛 Bug fixes

  • Do not display FullscreenControl on unsupported devices #4838, @stepankuzmin
  • Fix yarn build on Windows machines #4887
  • Prevent potential memory leaks by dispatching loadData to the same worker every time #4877
  • Fix bug preventing the rtlTextPlugin from loading before the initial style load #4870
  • Fix bug causing runtime-stying to not take effect in some situations #4893
  • Prevent requests of vertical glyphs for labels that can't be verticalized #4720
  • Fix character detection for Zanabazar Square #4940
  • Fix LogoControl logic to update correctly, and hide the <div> instead of removing it from the DOM when it is not needed #4842
  • Fix GeoJSONSource#serialize to include all options
  • Fix error handling in GlyphSource#getSimpleGlyphs#4992
  • Fix bug causing setStyle to reload raster tiles #4852
  • Fix bug causing symbol layers not to render on devices with non-integer device pixel ratios #4989
  • Fix bug where Map#queryRenderedFeatures would error when returning no results #4993
  • Fix bug where Map#areTilesLoaded would always be false on sourcedata events for reloading tiles #4987
  • Fix bug causing categorical property functions to error on non-ascending order stops #4996

⚒ Development workflow changes

v0.38.0

09 Jun 20:23
Compare
Choose a tag to compare

0.38.0 (June 9, 2017)

New features ✨

  • Attenuate label size scaling with distance, improving readability of pitched maps #4547

Bug fixes 🪲

  • Skip rendering for patterned layers when pattern is missing #4687
  • Fix bug with map failing to rerender after webglcontextlost event #4725 @cdawi
  • Clamp zoom level in flyTo to within the map's specified min- and maxzoom to prevent undefined behavior #4726 @ IvanSanchez
  • Fix wordmark rendering in IE #4741
  • Fix slight pixelwise symbol rendering bugs caused by incorrect sprite calculations #4737
  • Prevent exceptions thrown by certain flyTo calls #4761
  • Fix "Improve this map" link #4685
  • Tweak queryRenderedSymbols logic to better account for pitch scaling #4792
  • Fix for symbol layers sometimes failing to render, most frequently in Safari #4795
  • Apply text-keep-upright after text-offset to keep labels upright when intended #4779 [Potentially breaking ⚠️ but considered a bugfix]
  • Prevent exceptions thrown by empty GeoJSON tiles 4803

Accessibility improvements 🔉

Development workflow + testing improvements 🔧

  • Fix equality assertion bug in tests #4731 @IvanSanchez
  • Benchmark results page improvements #4746
  • Require node version >=6.4.0, enabling the use of more ES6 features #4752
  • Document missing pitchWithRotate option #4800 @simast
  • Move Github-specific Markdown files into subdirectory #4806 @tomscholz