Releases: mapbox/mapbox-gl-js
0.42.1
🐛 Bug fixes
- Workaround for map flashing bug on Chrome 62+ with Intel Iris Graphics 6100 cards #5704
- Rerender map when
map.showCollisionBoxes
is set tofalse
#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
⚠️ 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 fortext-field
andicon-image
#5599 - Split
curve
expression intostep
andinterpolate
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
inqueryRenderedFeatures
#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-driventext-size
#5632 - Improve validation to catch uses of deprecated function syntax #5667
- Permit altitude coordinates in
position
field in GeoJSON #5608
v0.41.0
⚠️ Breaking changes
- Removed support for paint classes #3643. Instead, use runtime styling APIs or
Map#setStyle
. - Reverted the
canvas
sourcecontextType
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 bothfeature.properties.land_use_category
andfeature.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 scalecircle-radius
issquare_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
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-animatedCanvasSource
s #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
0.40.0 (September 13, 2017)
⚠️ Breaking changes
Map#addImage
now requires the image as anHTMLImageElement
,ImageData
, or object withwidth
,height
, and
data
properties with the same format asImageData
. It no longer accepts a rawArrayBufferView
in the second
argument andwidth
andheight
options in the third argument.canvas
sources now require acontextType
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
v0.39.0
0.39.0 (July 21, 2017)
⚠️ Breaking changes
GeolocateControl
breaking changes #4479- The option
watchPosition
has been replaced withtrackUserLocation
- The camera operation has changed from
jumpTo
(not animated) tofitBounds
(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 newfitBoundsOptions
option (defaults to 15).
- The option
- Anchor
Marker
s at their center by default #4751 @andrewharvey - Increase
significantRotateThreshold
for theTouchZoomRotateHandler
#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 aMarker
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
andtrackuserlocationend
events - New
LngLat.toBounds
method to extend a point location by a given radius to aLngLatBounds
object
- New option
- 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
andcircle-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 exposecluster_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 onsourcedata
events for reloading tiles #4987 - Fix bug causing categorical property functions to error on non-ascending order stops #4996
⚒ Development workflow changes
- Use flow to type much of the code base #4629 #4903 #4909 #4910 #4911 #4913 #4915 #4918 #4932 #4933 #4948 #4949 #4955 #4966 #4967 #4973 💪 @jfirebaugh @vicapow
- Use style specification to generate flow type #4958
- Explicitly list which files to publish in
package.json
#4819 @tomscholz - Move render test ignores to a separate file #4977
- Add code of conduct #5015 💖
v0.38.0
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
aftertext-offset
to keep labels upright when intended #4779 [Potentially breaking⚠️ but considered a bugfix] - Prevent exceptions thrown by empty GeoJSON tiles 4803
Accessibility improvements 🔉
- Add
aria-label
to popup close button #4799 @andrewharvey
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
v0.37.0
0.37.0 (May 2nd, 2017)
⚠️ Breaking changes
- Removed
LngLat#wrapToBestWorld
New features 🚀
- Improve popup/marker positioning #4577
- Add
Map#isStyleLoaded
andMap#areTilesLoaded
events #4321 - Support offline sprites using
file:
protocol #4649 @oscarfonts
Bug fixes 🐛
- Fix fullscreen control in Firefox #4666
- Fix rendering artifacts that caused tile boundaries to be visible in some cases #4636
- Fix default calculation for categorical zoom-and-property functions #4657
- Fix scaling of images on retina screens #4645
- Rendering error when a transparent image is added via
Map#addImage
#4644 - Fix an issue with rendering lines with duplicate points #4634
- Fix error when switching from data-driven styles to a constant paint value #4611
- Add check to make sure invalid bounds on tilejson don't error out #4641
Development workflow improvements 💻
v0.36.0
0.36.0 (April 19, 2017)
New features ✨
- Replace LogoControl logo with the new Mapbox logo #4598
Bug fixes 🐛
- Fix bug with the BoxZoomHandler that made it glitchy if it is enabled after the DragPanHandler #4528
- Fix undefined behavior in
fill_outline
shaders #4600 - Fix
Camera#easeTo
interpolation on pitched maps #4540 - Fix
easeTo
to cross anti-meridian if the path will be closer, likeflyTo
#4602 - Fix
flyTo
/easeTo
not to cross anti-meridian ifmaxBounds
is set #4602 - Fix issues with categorical zoom-and-property functions #4614
Development workflow improvements 🤓
- Fix crash on missing
style.json
in integration tests gl-style-composite
is now executable in line with the other tools @andrewharvey #4595gl-style-composite
utility now throws an error if a name conflict would occur between layers @andrewharvey #4595