Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision circle generation at runtime #9219

Merged
merged 11 commits into from
Mar 30, 2020

Conversation

mpulkki-mapbox
Copy link
Contributor

Collision circle generation logic is currently performed in two different coordinate spaces, tile and label space, and the final decision of which circles to use is made by stitching these results together. First, a certain number of collision circle candidates are pre-generated for each label in tile space. Secondly, circles that should be used in collision check are determined at runtime. Some of the previous work can be found here #5474.

Limitations and problems with this approach becomes apparent quite fast. There seems to be quite a lot of approximation logic in the code that produce correct looking results but start to break down with certain input. The biggest issues we're facing if we were to remove the 60 degree pitch limit:

  1. The number of generated collision circles per label are 300% of what would normally be the max size. This might not be enough as some labels might extend past the padding.
    image
  2. Projection from label space to tile space is a crude approximation that produces inaccurate results. This might result in too few collision circles being used.
  3. Perspective correction is not taken into account when choosing which collision circles to use.
    image

These problems are difficult to solve without modifying the underlying algorithm. It would be possible to increase the number of generated collision circle candidates and improve the tile projection approximation, but it would just move the problem forward and not fix it. This pull requests implements 100% runtime collision circle generation that has already been brought up #5474. Some of the benefits of this approach are:

  • Very simple to implement. Most of the required code is already written and can be reused.
  • You get what you see. Same code is used for rendering and collision checks. No more crude approximations.
  • No need for persistent storage for pregenerated circles.
  • Perspective correction is properly applied for glyphs.

image

The code has been simplified to place collision circles by interpolating between road vertices on the label plane. Interpolation itself is cheap and the label plane information is a by-product that has been already computed during previous steps.

I'm expecting to see reduced number of collision circles especially with distant labels. The old implementation has to use somewhat expensive vertex projection for each collision circle candidate to see if it should be used in the collision check. This does not scale well with distant labels where you might need to go through 20 candidates to only use 4 of them. This is unnecessary as the screen space coverage is already known.

I need to run some benchmarks to see if there's any difference in performance. Debug rendering of collision circle placement is a bit more complex now with only screen space coordinates available, but the performance hit should be small.

@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch from dae7208 to 4c18404 Compare January 28, 2020 15:39
@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch 3 times, most recently from fdfc6c7 to 9139b37 Compare February 14, 2020 16:09
@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch 3 times, most recently from bce3f3e to 449d661 Compare February 21, 2020 10:08
@mpulkki-mapbox
Copy link
Contributor Author

mpulkki-mapbox commented Feb 21, 2020

(update to the previous post)

Overview

This pull request transforms collision circle generation into a runtime operation. Motivation behind the change is to have a more precise and flexible collision detection for line labels that sets no expectations for camera orientation. The new placement logic shares code with rendering to better reflect what's actually visible on the screen.

This has become a relevant issue now that we're ready to support lod-based tile streaming. The current implementation is not a scalable solution to be used with less constrained camera as some corner cases like inaccuracies in collision detection are already present with the 60 degree pitch limitation. Improving line label placement is a prerequisite for increasing the maximum pitch angle and for any 3d-related features we may end up doing in the future.

Stockholm (new)

gh_stockholm_new

Stockholm (master)

gh_stockholm_master

What's new?

The core idea behind this change is quite simple and well defined, but lot of supporting code had to be updated as well.

  1. Collision circles are no longer pre-generated during the symbol layout process
    Collision circles were previously generated during performSymbolLayout in a worker thread as part of the bucket creation process. A certain number of circles were created for each collision feature in tile coordinates and then serialized together with collision boxes. Shapes used for both collision detection and rendering were later deserialized from this array.

    The new role of performSymbolLayout involves evaluating collision circle diameter (previously text height) per feature and setting a flag to notify if collision circle generation should be done at runtime. Pixel based property Text-padding is also applied during runtime.

  2. Collision circle generation at runtime
    Collision circle candidates used in collision check were previously determined by finding positions of the first and last glyph on the label plane and then approximating their distances from the tile anchor. These distances were then compared to circle offsets in order to find the most optimal circle coverage for the label. I found this part of the algorithm particularly difficult to follow as it seemed to use very different numbers for transformations compared to the rendering logic.

    The new approach uses screen space projection of the label path to find the most optimal number of collision circles. The projected path is already available as the very same information is required to determine which pregenerated collision circles to activate. The usage of this data should add no extra costs as collision checks are performed in screen coordinates which happens to be identical to the non-pitched label space (with a small translation added for viewport padding). An extra transformation step has to be done though for labels in pitched label plane in order to find their screen coordinates.

    An example comparison. Left: master, right: new
    gh_example_master gh_example_new_default

    Added flexibility (first two images: less circles, 3rd image: extra padding)
    gh_example_new_freq0 gh_example_new_freq1 gh_example_new_pad

  3. Ownership of the debug data
    With a fixed number of collision circles per bucket it was easy to create static sized vertex and index buffers for the data. Static vertex properties were stored in their own vertex buffer while more dynamic properties like "isUsed" and "hasCollision" were uploaded to gpu in their own vb after the placement process was finished.

    These buffers have now been removed and dynamic properties of debug circles (center_x, center_y, radius, flags) are stored in the Placement-class until the placement operation has been finished. Debug circles are pushed together with projection matrices to their corresponding buckets in commit().

  4. Debug rendering
    Debug rendering is a bit more difficult task now that circles are stored directly in screen space coordinates. It wouldn't be a problem if positions were updated every frame before rendering, but the symbol placement is a continuous process that can span over multiple frames invalidating previously computed positions if camera moves. Screen space coordinates are always bound to a specific camera position and orientation. The solution is to re-project circles from the placement screen space to the new one used in rendering.

    To render an arbitrary number of circles I ended up implementing a simple webgl 1.0 compatible shader instancing that requires no extra extensions. Circles are sent to the gpu in batches of 64 instances encoded in a single vec4 uniform array and vertex data is just a collection of incremental index values. Memory footprint of this approach is small as only 16 bytes per circle is needed to be uploaded to the gpu.

    // javascript
    const vertex_data = [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5,...];  // 2 values per vertex
    // glsl
    uniform vec4 u_quads[64];
    attribute vec2 a_idx;
    ...
    int quad_idx = floor(a_idx.x / 4);
    int vertex_idx = a_idx.x % 4;

    Alternative instancing/rendering implementations:

    • WebGL instancing
      • Not a WebGL 1.0 baseline feature
    • Single vertex buffer, circular update
      • Idea would be to append vertex data to the end of the buffer and start from the beginning when the buffer is full. Downside of this approach is that bufferSubData is not guaranteed to be an async operation. Some kind of "no_overwrite" flag and explicit buffer orphaning would be required as well.
    • Encoding instance data into a texture
      • Vertex texture fetch support is not required in WebGL 1.0
  5. Perspective correction of line labels is fixed
    Perspective correction formula is (according to Text Rendering)

    const perspectiveRatio = 0.5 + 0.5 * (camera_to_center / camera_to_anchor);
    const pitchScaledFontSize = pitchWithMap
      ? fontSize / perspectiveRatio
      : fontSize * perspectiveRatio;

    updateLineLabels in projection.js was using inverse of the perspective correction algorithm which produced squeezed labels near bottom and top of the screen:

    const perspectiveRatio = 0.5 + 0.5 * (camera_to_anchor / camera_to_center);
    const pitchScaledFontSize = pitchWithMap
      ? fontSize * perspectiveRatio
      : fontSize / perspectiveRatio;

    This fix effectively resolves the issue reported in ticket Distant line-placed labels are illegible when top padding is large mapbox-gl-native#15167.

What's new for users?

This PR might slightly change the set of visible labels on screen at given time as more precise collision circle placement allows more tightly packed labels. An example from the render tests:

Chicago (new)

gh_chicago_actual

Chicago (master)

gh_chicago_expected

Benchmarks

I could not find any noticeable and reproducible difference in performance between this change and the master. I ran JS benchmarks and did some manual testing as well. I tracked the number of collision circles and boxes added to the collision grid and the number of collision checks done per placement operation. Tests were done using a fast i9 laptop and a slower Amazon Fire HD tablet.

debug.html

Petrolina (Brazil)

resolution: 1272 x 1323
16.31/-9.42056/-40.499172/-159.5/2

new master diff
circles 668 822 -19%
boxes 82 77 +6%
intersection tests 137 214 -35%

16.31/-9.416197/-40.499192/98.9/60

new master diff
circles 600 714 -16%
boxes 129 126 +2%
intersection tests 416 503 -18%

16.32/-9.420562/-40.49918/-49.9/85

new master diff
circles 399 525 -24%
boxes 205 211 -3%
intersection tests 1935 2147 -10%
San Francisco

resolution: 2560 x 1336
15.36/37.736134/-122.442253/-93.3

new master diff
circles 819 937 -5%
boxes 170 166 +2%
intersection tests 267 308 -14%

15.36/37.736676/-122.444918/-38.9/58

new master diff
circles 1919 2361 -19%
boxes 423 417 +1%
intersection tests 3065 3426 -11%

14.13/37.76903/-122.42653/-130.1/79

new master diff
circles 690 748 -8%
boxes 351 347 +1%
intersection tests 3173 3176 -0%
Stockholm

resolution: 1272 x 1323
16.15/59.321101/18.072541/0/73

new master diff
circles 760 918 -18%
boxes 697 673 +3%
intersection tests 4102 4462 -8%

16.31/59.32457/18.071447/45.6/2

new master diff
circles 433 487 -11%
boxes 237 234 +1%
intersection tests 489 509 -4%

debug/circles.html

Stockholm

resolution: 1272 x 1323
16.31/59.324659/18.071288/88.8

new master diff
circles 396 427 -8%
boxes 209 207 +1%
intersection tests 463 500 -8%

16.31/59.314411/18.078096/164.8/54

new master diff
circles 445 579 -24%
boxes 463 447 +3%
intersection tests 940 1080 -13%

Depending on the scenario, the number of circles were reduced by 5-24% and the number of intersection tests by 0-35% with the current configuration. The number of collision boxes could actually grow.

Notes and open questions

  • Most of the pages debug/*.html were tested.
  • Text-anchor property is ignored in collision circle placement Text-anchor is not properly supported in collision circle placement #9313 . This PR uses more conservative approach by placing collision circles to cover both "flipped" and "non-flipped" cases.
  • Text-padding for line labels is now being applied at runtime during collision checks. Previously the padding was applied to circles in the preprocessing step.
  • Render and query test baselines should be updated. All of the failures are caused by a slightly different layout due to more precise placement. This is of course something that should be confirmed.
  • Most of the code comments should be updated to reflect the new logic.
  • draw_collision_debug.js recreates vertex and index buffers for each frame which is not optimal.
  • There's plenty of room for optimizing the interpolation logic.

@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch from 449d661 to fe44204 Compare February 24, 2020 08:41
@mpulkki-mapbox mpulkki-mapbox marked this pull request as ready for review February 24, 2020 09:54
@mpulkki-mapbox
Copy link
Contributor Author

cc @mapbox/gl-core, @mapbox/gl-js, @mapbox/gl-native

@astojilj
Copy link
Contributor

astojilj commented Mar 2, 2020

Logging offline review discussions status:

  • 14 failing render tests would get fixed by rebasing expectations. New behavior looks better since labels are tighter packed and don't overlap.
  • for 4 failing query tests, explaining the state before/after would help the review,
  • good to describe difference in text-anchor behavior, previous vs new (more conservative approach by placing collision circles to cover both "flipped" and "non-flipped" cases).

@mpulkki-mapbox
Copy link
Contributor Author

Thanks for the comments, @astojilj! There are few intended changes that I should open up more.

  • good to describe difference in text-anchor behavior, previous vs new (more conservative approach by placing collision circles to cover both "flipped" and "non-flipped" cases).

The first one is different handling of flipped vs. non-flipped line labels in circle generation. I noticed some weird behavior in circle placement when text-anchor was used with line labels. Some of the labels were properly covered by collision shapes but about half of them were totally off. After further inspection this was caused by different handling of "flipped" and "non-flipped" labels in rendering and collision detection logic. Collision circle placement is treating all labels as "non-flipped", ie. it doesn't care if labels would appear upside down on the screen. This behavior combined with non-centered text anchor might result in huge misalignment between labels and collision shapes. I reported this issue first here #9313.

I ended up implementing "conservative offsets" for glyph placement where both possibilities are taken into account. Enough circles will be generated to cover both placement cases (as seen in the following image) which should fix problems with horizontal anchor for the cost of a larger area reserved for labels. It might not be the most optimal approach and it's not required for this PR. Perhaps I should cut it out and implement in another PR?

image

Another intended change is the usage of "Text-padding". Instead of including pixel padding in precomputed collision shapes it's now being added at runtime directly in screen coordinates. It should still conform to the specification "Size of the additional area around the text bounding box used for detecting symbol collisions."

@mpulkki-mapbox
Copy link
Contributor Author

One additional benefit of this change is the reduced memory usage due to circles not being stored anymore. I positioned a map using streets-v10 to few different locations and printed out the number of collision boxes and circles added to the collisionBoxArray during performSymbolLayout operation.

console.log(bucket.layers[0].id + ": " + (bucket.collisionBoxArray.length - preArrayLen));

San Francisco 22/49.28194692/-123.1107474/123.5/60

New Master
tunnel-oneway-arrows-blue-minor 0 0
tunnel-oneway-arrows-blue-major 0 0
tunnel-oneway-arrows-white 0 0
turning-features-outline 0 0
road-oneway-arrows-blue-minor 514 514
road-oneway-arrows-blue-major 280 280
level-crossings 0 0
road-oneway-arrows-white 0 0
turning-features 0 0
bridge-oneway-arrows-blue-minor 0 0
bridge-oneway-arrows-blue-major 50 50
bridge-oneway-arrows-white 0 0
housenum-label 132 132
poi-scalerank4-l15 70 70
poi-scalerank4-l1 68 68
poi-parks_scalerank4 0 0
poi-scalerank3 18 18
poi-parks-scalerank3 2 2
poi-scalerank2 0 0
poi-parks-scalerank2 0 0
poi-parks-scalerank1 0 0
poi-scalerank1 0 0
road-label-small 0 12731
road-label-medium 0 2786
road-label-large 0 18058
road-shields-black 46 46
road-shields-white 0 0
rail-label 2 2
Total 1182 34757

The number of collision shapes created for all features is down to 5% in this specific overscaled tile. In raw memory usage this is (34757 - 1182) * 24 = 805800 bytes = 806 KB less bytes used. It should also be noted that the previous implementation duplicates collision shapes into a separate array in foreground so the memory reduction could be double of this number. Vertex buffers used to store debug circles are also all gone.

Helsinki #14.59/60.16331/24.93807

New Master
Total 164 1274

The number of collision shapes in Helsinki on zoom level 14 leads to reduction of 83%. This is equal to (1274 - 164) * 24 = 26.6 KB.

@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch from fe44204 to 4305e63 Compare March 3, 2020 13:25
@mpulkki-mapbox
Copy link
Contributor Author

  • good to describe difference in text-anchor behavior, previous vs new (more conservative approach by placing collision circles to cover both "flipped" and "non-flipped" cases).

I ended up reverting this fix for now.

src/render/draw_collision_debug.js Outdated Show resolved Hide resolved
src/symbol/collision_index.js Outdated Show resolved Hide resolved
@mpulkki-mapbox
Copy link
Contributor Author

All failures in both render tests and query tests are caused by changes in the symbol layout. There are either more visible labels than before or some of the previously invisible labels are now hiding lower priority labels underneath them. Three changes introduced in this PR are causing the failures:

  1. Perspective correction is now properly applied to labels near bottom and top of the screen removing the "squeezed" effect
  2. More precise collider placement allows more labels to be visible
  3. Collision circle debug rendering has changed

I double checked the two failing regression tests and updating them should not have a conflict with original issues (#3534 and #5911).

(I also found out that the perspective correction issue has been addressed before in #5913, but projection.js was not updated at that point.)

const first = firstAndLastGlyph.first;
const last = firstAndLastGlyph.last;

let projectedPath = first.path.slice(1).reverse().concat(last.path.slice(1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mourner would Array.push be faster than concat?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah — if this is on a hot path, I would rewrite this with a simple for loop to avoid the 3 array allocations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch! I'll try to get rid of the extra array allocations

}
}
}
}

return {
circles: (collisionDetected || !inGrid) ? [] : placedCollisionCircles,
offscreen: entirelyOffscreen
circles: ((!showCollisionCircles && collisionDetected) || !inGrid) ? [] : placedCollisionCircles,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a need to construct an empty [] array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be replaced with null

src/symbol/symbol_layout.js Show resolved Hide resolved
@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch from 4472bdf to d585ec5 Compare March 9, 2020 09:54
src/render/program.js Outdated Show resolved Hide resolved
src/render/program/collision_program.js Outdated Show resolved Hide resolved
src/symbol/collision_index.js Outdated Show resolved Hide resolved
src/render/uniform_binding.js Outdated Show resolved Hide resolved
src/symbol/path_interpolator.js Show resolved Hide resolved
@karimnaaji karimnaaji added this to the release-d milestone Mar 18, 2020
@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch from d585ec5 to 439b613 Compare March 24, 2020 15:43
src/data/bucket/symbol_bucket.js Outdated Show resolved Hide resolved
src/render/draw_collision_debug.js Outdated Show resolved Hide resolved
src/symbol/placement.js Outdated Show resolved Hide resolved
@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch from 439b613 to 9a2679d Compare March 25, 2020 15:57
return this.points[0];
}

t = clamp(t, 0, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could this be an assertion?

@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch 2 times, most recently from fd9d28b to 0aeac5d Compare March 26, 2020 15:55
Copy link
Contributor

@ansis ansis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the changes! This looks ready once tests are updated. The updates for the query tests should probably change the query point, not the output.

@mourner
Copy link
Member

mourner commented Mar 26, 2020

@mpulkki-mapbox I haven't looked at the code in detail, just a wild guess: while the PR intends to considerably simplify collision logic, it at the same time adds a few kilobytes to the bundle; could this indicate that maybe there's some potentially unused code that was left in place?

@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch from 0aeac5d to 9a79ef8 Compare March 27, 2020 13:06
@mpulkki-mapbox
Copy link
Contributor Author

@mpulkki-mapbox I haven't looked at the code in detail, just a wild guess: while the PR intends to considerably simplify collision logic, it at the same time adds a few kilobytes to the bundle; could this indicate that maybe there's some potentially unused code that was left in place?

@mourner thanks for bringing this up! I did a small refactoring pass and got rid of few extra bytes. I also double checked that this change should not leave any (significant part of the) code unused. One culprit for the increased size is the debug rendering logic that was previously shared by both box and circle rendering.

@ansis: thanks for the review! I've updated all of the failing query tests.

@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch 2 times, most recently from 0384ef5 to 284cb54 Compare March 27, 2020 17:02
Copy link
Contributor

@astojilj astojilj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @mpulkki-mapbox .

@mpulkki-mapbox mpulkki-mapbox force-pushed the mpulkki-viewspace-symbol-placement branch from 284cb54 to 0a51067 Compare March 30, 2020 07:55
@mpulkki-mapbox mpulkki-mapbox merged commit e27049d into master Mar 30, 2020
@mpulkki-mapbox mpulkki-mapbox deleted the mpulkki-viewspace-symbol-placement branch March 30, 2020 08:07
ChengXueqing added a commit to ChengXueqing/mapbox-gl-js that referenced this pull request Apr 30, 2020
* Add `text-variable-anchor/all-anchors-tile-map-mode` render test

* convert image type to resolvedImage type (mapbox#8901)

* Catch errors when createMap is called (mapbox#8905)

* hide internal mercatorScale function from api docs (mapbox#8856)

* Add changelogs from gl-js 1.5.0 and style-spec 13.9.1 (mapbox#8911)

* [docs] Address user feedback for /api: setStyle, getStyle, isStyleLoaded (mapbox#8807)

* bump documented mapbox styles to latest versions (mapbox#8914)

* [style-spec] Add an es-module build (mapbox#8247)

* Add rotation options to markers (mapbox#8836)

* Add Popup methods to manipulate container class names (mapbox#8759)

* Minify SVG images and add rules for High Contrast mode on Windows (mapbox#8874)

* update makers debug to test pitch and rotation alignment (mapbox#8930)

* Update npm dependencies (mapbox#8928)

* Implement "in" expression (mapbox#8876)

Co-authored-by: Ádám Barancsuk <adam.barancsuk@gmail.com>
Co-authored-by: Ryan Hamley <ryan.hamley@mapbox.com>

* Draw debug tiles for source with greatest max zoom and Add overscaledZ to debug tile text (mapbox#7314)

* Remove hardcoded image list in expression test harness (mapbox#8935)

* replace mapid with Tileset ID in TileJSON URL examples for consistency with Mapbox Studio

* options.dragPan can be assigned an object to customize panning inertia ( h/t @aMoniker) (mapbox#8887)

* Add essential option to AnimationOptions to ignore prefers-reduced-motion for essential animations (mapbox#8883)

* Change addImage example to use absolute URL

* Revert start-debug to old behaviour (mapbox#8940)

* Support generateId option in clustered sources (mapbox#8945)

* support generateId option in clustered sources

* add a unit test for generateId clustered

* Fix shrink icon loading in CSS (mapbox#8948)

* open popup on a marker from keyboard (mapbox#6835)

* open popup on a marker from keyboard

* arrow functions don't need to bind this

* set tabindex on marker elements with popups and remove keypress listener

* aria-label on default marker

* tabindex value should be string, thanks flow

* flow

* flow

* KeyboardEvent.charCode and keyCode are deprecated, support standard KeyboardEvent.code

* add unit test for opening popup on Enter

* add unit test for opening popup on Space

* retain existing tabindex

* fix lint

* fix flow

* _onKeyPress method

* fix scrolling issue when focusing markers

* prevent marker focus on click

* Clean up implementation of coalesce for image operator (mapbox#8950)

* Update fill-pattern feature state test (mapbox#8927)

* Add contains method to LngLatBounds (mapbox#8200)

* [wip] addcontains method, but trouble with wrapped coordinates

* tests for contains point

* lint fixes

* remove comment

* Update src/geo/lng_lat_bounds.js

* minor lint / style fixes

* fix docstring

* add gpu timing map events (mapbox#8829)

* Introduce 'gpuTiming' map options.

Originally implemented by Chris. I've rebased it and exposed it
with just the event listeners instead of a map option.

Listen to `gpu-timing-frame` to get the gpu time for the frame and
listen to `gpu-timing-layer` to get the gpu time for all individual
layers. It is not recommended to listen to both.

* fixup

* min and max pitch options (mapbox#8834)

* Change maximum of function_stop from 22 to 24 (mapbox#8908)

* Upgrade @mapbox/gazetteer to v4.0.4 (mapbox#8955)

* Get named export (mapbox#8957)

* fix codegen unknown type issue (mapbox#8959)

fix mapbox#8958

* dedup featureMap by moving it to the config set (mapbox#8965)

move featureMap from ProgramConfiguration to ProgramConfigurationSet.
All configurations within a set have the same vertex layout (because
they go together with the same vertex buffers).

This doesn't matter too much because the only time a set has more than
one programconfiguration is when multiple layers have identical layout
properties. The main goal here is to make the relationship a tiny bit
clearer.

* Fix api-supported error messages (mapbox#8971)

Consistify capitalization, make source url error more accurate

* Add locale option to enable localization of UI strings (mapbox#8095)

* Fix animation performance (mapbox#8913)

* reproduce animate jankiness

* Fix animation performance

* use isWorker

* Fix benchmarks build failures due to unresolvable deps (mapbox#8972)

Import styleBenchmarkLocations directly from gazetteer, reverting some changes made in mapbox#8955 that introduced rollup errors due to unresolved node builtins

* Add eslint config for JSDoc (mapbox#8961)

* Work around CacheStorage memory leak in Safari (mapbox#8956)

We are periodically removing items from the cache using the CacheStorage API. Unfortunately, Safari seems to leak significant amounts of memory when requesting a new Cache object, then calling `cache.keys()`. Instead of requesting a new Cache object for every operation, we are now reusing the same Cache object for all operations on the cache.

Ticketed upstream at https://bugs.webkit.org/show_bug.cgi?id=203991

* Fix IE 11 support (mapbox#8990)

* Fix IE 11 support

IE 11 doesn't support Array.prototype.find

* Fix linting issues

* Disable using transferrables for ArrayBuffers in Safari(mapbox#9003)

* Add render tests for dashed lines with round caps (mapbox#8993)

* Implement 'images in labels' feature (mapbox#8904)

* Set 'isSDF' flag per icon quad

* Simplify formatted expression parsing
  Allow omission of empty section options objects. This enables
  following syntax ["format", "first section\n",
                              "second section\n",
                              ["image", "smiley"],
                              "third section"]

* Add Image to Format expression
  Image could be part of Format expression and evaluated ResolvedImage
  is a optional member of evaluated Formatted type.

* Add formatted text's image section image to deps

* Add images to TaggedString's section

* Pass images to text shaping

* Use {text|icon}-size vertex attribute field to encode 'isSDF' flag
  This change uses higher bit to indicate whether quad's vertices
  belong to a quad whose texture should be rasterized using SDF function.
  Size scaling factor is changed from 256 to 128, which reduces resolution
  a bit, however, as the scaling result is now being rounded, final result
  should be the same.

* Shape images in labels

* Draw color icons and sdf text with one program / draw call

* Align images and scaled glyphs in vertical layout

* Allow image breaking

* Update render test expectations for tests using font-scale
  Fixes misaligned text boxes

* Update format expression tests to account for image sections

* Update quads unit test

* Update shaping unit test

* Update unit test for format expression API

* Fix linter errors

* Don't scale images in labels with text size

* Basic render test

* Multiline test

* Vertical layout with images

* Line placement test

* Expression test for image section

* Format expression unit and API test

* Shaping unit test

* Add benchmarks for symbol layer with icons

* Use explicit 'symbol_text_and_icon' shader name instead of 'symbol'
  Add is_text back, in follow-up pr shader can be renamed to sdf and
  raster, and can be used to draw sdf and raster icons in one pass.

* Don't use mod for unpacking flag

* Use linear interpolation for images in label for zoom dependent text size

* Add back glyphMap to shaping
  Glyph map is used as a fallback whenever glyph is missing in glyph
  positions, e.g., space character that may not be backed by a texture,
  yet, has a glyph metrics.

* Render test for constant text-size

* Render test for image justification

* Take into account image padding and image pixel ratio

* Add render test to verify that linear filtering is used
  Test that linear filtering is used for icons in text when
  text-size is zoom-dependent.

* Fix size of images in text at integer zoom levels

* Update shaping unit test and remove unused parameter from shapeLines

* Check whether context is lost before `gl.shaderSource(...)`. (mapbox#9017)

When context is lost most gl calls are no-ops but this one can throw.
When a program cannot be created `draw(...)` needs to fail silently just
like all gl calls.

fix mapbox#8986

* Number validation should fail on NaN (mapbox#8615)

* Number validation should fail on NaN

* Avoid Number.isNaN

* Add runtime checks

* Add render and unit test

* Remove not useful unit test

* Revert debug page change

* Dont throw an error for aborted requests

* Type annotations (mapbox#9025)

* Type annotations

* fix more errors

* fix really overscaled lines (mapbox#9024)

We resample lines after sharp corners in some situations. Doing this for
really overscaled tiles mean that sometimes the offset to the new vertex
was closer than the precision supported. This disables that after a
certain point.

fix mapbox#9009

* update rendering after addImage and removeImage (mapbox#9016)

fix mapbox#9004

A tile needs to be reparsed in order for it to use the new image.
Reloading all tiles whenever an image is added would be expensive. For
example:
- load a map
- add an image and use it in a geojson overlay

You don't want adding that image to make the basemap tiles be reloaded.

To get around that we track all the image ids used by each tile and only
reload tiles that depend on images that changed.

* re-add queuing for getResource calls (mapbox#9031)

fix mapbox#8998

* Add changelog instructions to PULL_REQUEST_TEMPLATE.md (mapbox#9023)

* Add changelog instructions to PULL_REQUEST_TEMPLATE.md

* Simplify new changelog related template wording

* Place optional changelog entry tags on own line

* allow rendering full world smaller than 512px (mapbox#9028)

* Clarify toBounds docstring (mapbox#9032)

Clarify that toBounds returns LngLatBounds completely containing given radius

* implement stretchable icons for icon-text-fit (mapbox#8997)

* bump version to 1.7.0-dev (mapbox#9038)

* fix collisions for stretchable images with a `content` area (mapbox#9041)

* Use stencil test instead of tile mask approach

Remove tile masks for raster. Rendering happens in Z-descending order.
All the tiles with the same Z use the same stencil value. Parent uses lower stencil value so that the area covered by children gets masked.
Stencil ref values continue range used in _tileClippingMaskIDs.

* raster-masking test combined with vector. Refactor raster overlap.

Return map z -> StencilMode instead of using callbacks.
overlapping-vector uses vector layer between two raster to guard
against side effects when refactoring stencil usage.

* Reset internal attribution control cache when removing from map (mapbox#9052)

Fixes mapbox#9051.

When creating an attribution control, we're caching the HTML string in the AttributionControl object. That cache wasn't reset when the control was removed from the map. Upon re-adding, we incorrectly assumed that the HTML was already up-to-date because our internal cache said so. This patch fixes it by clearing the internal cache so that attribution shows up properly when re-adding the control.

h/t @cs09g

* An option to use a feature property as ID for feature state (mapbox#8987)

* add ability to id by property for feature state

* flow fixes

* rework promoteId according to PR discussions

* properly expose promoted ids in query methods

* fix lint

* use state ids that can be cast as Float64 as is; update tests

* promoteId: geojson support, better flow typing, v8 docs

* fix spec test

* make sure id is provided in getFeatureState

* minor fixes after review

* hash ids > MAX_SAFE_INTEGER

* overhaul promoteId validation, add render test

* Optimize findLoadedParent

Performance optimization when rendering view with a lot of satellite tiles.
Measurements on Chrome (Version 78.0.3904.108 with CPU 4x slowdown in performance tab) on MacMini i7 3.2 Ghz.

`map.repaint = true` in http://localhost:9966/debug/satellite.html#12.5/38.888/-77.01866/0/60

Observed FPS count:
master: 19-20FPS
with this patch: 24.5-26 FPS

* make stretchable images work with icon-text-fit: none (mapbox#9045)

* use browser.devicePixelRatio instead of directly calling window.devicePixelRatio (mapbox#9063)

h/t @pakastin

* add changelogs from v1.6.0 (mapbox#9070)

* add placement benchmark (mapbox#9077)

* check that latest version appears in changelog (mapbox#9071)

This prevents an update to package.json from being merged without
including a corresponding change to the changelog.

This will prevent me from forgetting to remove `-beta` from the
changelog when doing a final release.

* Fix versions benchmark by querying github API instead of local package.json (mapbox#9084)

* Fix map size in benchmarks (mapbox#9049)

display: none on Chrome (Chrome 78.0.3904.108 (Official Build) (64-bit) on macos), results with container clientWidth and clientHeight equal to 0.
This led to and container dimension [400 x 300](https://github.com/mapbox/mapbox-gl-js/blob/3c36a67716d7c8ad8d69b15f7e5fd19b72e7a7ff/src/ui/map.js#L1922) instead of using specified size in e.g. bench/benchmark/layers.js (1024x768)

* Remove `stringContainsRTLText` dependency from within style-spec. (mapbox#9088)

* Progressive enhancement for decoding DEM data on workers with ImageBitmap and OffscreenCanvas (mapbox#8845)

* Fix validation error messages in the browser (mapbox#9073)

We converted the ParsingError and ValidationError classes to inherit from the built-in Error class in mapbox#9025. This works fine in ES6, so our unit tests were happy. However, transpiling it down to ES5 leads to an absence of the message property, essentially removing the text of parsing and validation errors.

* Update PULL_REQUEST_TEMPLATE.md (mapbox#9106)

the @mapbox/map-design-team tag was incorrect

* Remove reference to 'deprecated in expression' (mapbox#9102)

* Fix ImageBitmap instances not being passed to appropriate gl.texImage2D call (mapbox#9103)

* Un-hardcode test fixtures root path, and add operation handler for 'idle' event (mapbox#9105)

* Fix typo in style spec (mapbox#9110)

* inline test suite dependencies (mapbox#9096)

* Edit convert functions to output linear interpolation (mapbox#9107)

* Edit convert functions to output linear interpolation

* Edit unit tests to reflect linear interpolation

* Refactor code to make it succint

* minor whitespace updates

* Deferred loading of RTL text plugin detects labels rendered from GeoJSON sources (mapbox#9091)

* Add sdk-support section for `is-supported-script`  (mapbox#9099)

* Add sdk-support section for `is-supported-script` and unit tests to ensure that expressions, paint and layout properties always have an SDK support section.

* Fix *-sort-key sdk support table

* Remove empty 'data-driven styling' sections and ad dunit tests

* Switch back to using host url instead of a blob-url  to load rtl-text-plugin on the worker (mapbox#9122)

* Change the type of tile id key to string (mapbox#8979)

* Change tile id key type from number to string

* Add derefLayers to the bundle (mapbox#9121)

* Update quads.js (mapbox#9128)

whatever it's intended, it's typo.

* CP v1.6.1 CHANGELOG (mapbox#9127)

* Add instrumentation for performance metrics tracking (mapbox#9035)

* Allow programmatic construction of style even when one is not passed in initially ( h/t @stepankuzmin ) (mapbox#8924)

* Fix bug in DragRotateHandler._onMouseUp() (mapbox#9137)

* Support `ImageBitmap` in Map#addImage and Map#updateImage (mapbox#9139)

* Prevent changing bearing via URL hash when rotation is disabled (mapbox#9156)

* Immediately update map when more than one geolocation watch event is triggered (mapbox#9092)

* fix extrusion querying for: (mapbox#9138)

- polygons with coincident points
- polygons with less than four points

fix mapbox#8999

* Add text-size/zero render test (mapbox#9133)

* Add text-size/zero render test

Tests that zero `text-size` values are properly handled.

* add ignore

Co-authored-by: Ansis Brammanis <ansis.brammanis@gmail.com>

* update symbol-avoid-edges doc copy to acknowledge the existence of global collision detection (mapbox#9157)

* Fix Click on Compass on some mobile (add clickTolerance to DragRotateHandler) (mapbox#9015)

* Add layerId parameter to once event handler (mapbox#8875)

* Add option to close popup on map move (mapbox#9163)

* make placement respect symbol-sort-key (mapbox#9054)

* Fix hash (mapbox#9170)

* Guard against no bearing in hash on initial page load

* Remove log

* Add text-color and image to format expression's sdk-support section

* Add instructions for changelog authoring to the PR template (mapbox#9165)

* Add instructions for changelog authoring to the PR template

* Update PULL_REQUEST_TEMPLATE.md

* Update PULL_REQUEST_TEMPLATE.md

* Update Code of Conduct (v2.0, https links) (mapbox#9176)

* update Code of Conduct (v2.0, https links)

* Add reporting guidelines & contact email to CoC

* Remove outdated link to open source page from CoC

* Add spacing for readibility

Co-authored-by: Anjana Sofia Vakil <anjana.vakil@mapbox.com>

* Update package version to 1.8.0-dev (mapbox#9190)

* Prefer line-pattern over line-dasharray in accordance with documentation (mapbox#9189)

* Remove Object.values usage that was causing IE11 to fail (mapbox#9193)

* LOD support for tile coverage (mapbox#8975)

* LOD support for tile coverage

* fix promoteId spec definitions (mapbox#9212)

* upgrade earcut to v2.2.2 (mapbox#9214)

* Fix promoteId for line layers (mapbox#9210)

* fix promoteId for line layers

* fix promoteId spec definitions (mapbox#9212)

* Add render tests for feature state
feature-state/promote-id-line will fail until mapbox#9210 is merged

Co-authored-by: Karim Naaji <karim.naaji@gmail.com>

* Fix line distances breaking gradient across tile boundaries (mapbox#9220)

* Fix line line distances breaking gradients
Ensure scaled line distance is computed at least once when calculating the entire line distance, otherwise we hit a corner case where the distance isn't updated. Specifically when the beginning of the line doesn't have a sharp corner.
Fixes mapbox#8969

* Add render test for line gradient across tile boundaries

* Address review comments

* Update image expression SDK support table (mapbox#9228)

* Refactor style._load function, move sprite loading to a private method (mapbox#9231)

* [tests][tile mode] Add left-top-right-buttom-offset-tile-map-mode test

* Reduce size of line atlas by removing unused channels (mapbox#9232)

Saves roughly ~100kb of uncompressed gpu memory, potentially saving texture fetches in the shader

* Fix a bug where lines with duplicate endpoint disappear on z18+ (mapbox#9218)

* fix a bug with vanishing line with duplicate end points

* fix flow :(

* Canonicalize Mapbox tile URLs from inline TileJSON as well (mapbox#9217)

* Hide glyphs behind the camera (mapbox#9229)

* Prevent empty buffers from being created for debug data (mapbox#9237)

* refactor LngLat distance calculations (mapbox#9202)

* DragRotateHandler should not react to ctrl-alt-click (mapbox#9203)

* Update gl-js and style-spec changelogs, update style-spec version to 13.12.0-dev (mapbox#9252)

* v1.7.0-beta.1 (mapbox#9195)

* Update versions to final in gl-js and style-spec package.json and CHANGELOG (mapbox#9233)

* Pass errors to cluster function callbacks (mapbox#9251)

* fix severe performance regression after introduction of image expression (mapbox#9261)

* Simplify formatted sections code (mapbox#9258)

* simplify symbol formatting code

* fix linting

* Fix visual artifact for line-dasharray (mapbox#9246)

* Fix artifact for zero-lenghted dash array
Fixes issue mapbox#9213 and add render test for coverage around 0-length dash arrays

Update distance field generation for regular dashes as follows:
1. Compute the dash array ranges and stretch location along the distance field
2. Collapse any 0-length distance field range
3. Collapse neighbouring same-type parts into single part

* combine consecutive dashes and parts

Co-authored-by: Ansis Brammanis <ansis.brammanis@gmail.com>

* Update "Version Control Conventions" in CONTRIBUTING.md (mapbox#9255)

* add circle to GeolocateControl showing accuracy of position (mapbox#9253)

* add circle to GeolocateControl showing accuracy of position

* don't call onZoom when not zooming

* show accuracyCircle even if tracking is off

* docs

* deduplicate binders code

* remove unused names binder property

* clean up program config construction

* clean up program config construction further

* minor program config cleanup

* clean up program config more

* refactor program config maxValue

* cut out uniform logic out of binders that don't need it

* split Binder interface into two disjoint interfaces

* clean up paint buffers update

* minor stylistic changes

* Add expression and render tests for `within` expression (mapbox#9270)

* Add expression and render tests for within expression

* Add error case for within expression test. Narrow render tests camera size

* Change polygon fill color

* Fix expression function capital letter (mapbox#9272)

* add space before units in scale bar (mapbox#9276)

* [docs] remove `Marker#rotationAlignment` link (mapbox#9281)

Fixes DOCS-SUBDOMAIN-404-23T

* Use non-breaking space (mapbox#9284)

* Only normalize canonicalized mapbox tile URLs (mapbox#9268)

fix mapbox#9259

* Set geolocate onZoom callback only after UI is setup (mapbox#9288)

* Don't call onSuccess and onError callbacks after control was removed (mapbox#9291)

* Bump -dev package version numbers

* Try out browser testing (mapbox#9245)

* Add README for browser testing (mapbox#9296)

* Map API functions such as easeTo and flyTo now support padding: PaddingOptions which lets developers shift the center of perspective for a map when building floating sidebars.

Asymmetric viewport (mapbox#8638)


Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>

* Allow needle argument to 'in' expression to be false (mapbox#9295)

* Speed up release deploys (mapbox#9298)

* Letting `LngLatBounds.extend` accepts LngLatLike and LngLatBoundsLike as well. (mapbox#9293)

* Changing the input type of the extend function to LngLatLike and LngLatBoundsLike and fixing a bug identified in the function

* Updating the function's comment to show the correct parameter type.

* -Adding more test cases:
	- Extend with an array of 3 elements
	- Extend with an empty array
-Removing unnecessary comments.

* Adding a better documentation to be more clear on what  can be inputted in extend function.

* -Resolving the flow failures which was causing CI pipeline failure.
-Correcting the comments for the extend function.

* Add render tests for line within polygon. Update expression tests for within expression (mapbox#9310)

* Merge changelog for v1.8.0 (mapbox#9320)

* Clearing the underlying source's tiles while removing a layer. (mapbox#9305)

* clearing the underlying source's tiles while removing a layer.

* Removing the clear command since this is computationally expensive and also causing a glitch on the map once the tiles are cleared.

* Changing the name of the function to hasLayer to be more specific regarding the function

* fix links to addImage

* link to hover effect example from addFeatureState

* clarify GeolocateControl interaction states

* replace incorrect LatLngBounds with LngLatBounds

* Add benchmark coverage for text-variable-anchor and symbol-sort-key (mapbox#9322)

* Add benchmarks for properties not used by default base map styles
Add benchmark for properties such as  and
not currently being used by default mapbox base styles.

mapbox#8589

* Fix lint

* Fix for issue mapbox#9327 (mapbox#9333)

Revert "Hide glyphs behind the camera (mapbox#9229)"

This reverts commit 1eed2ae.

* Update filter link targets (mapbox#9338)

* fix map not displaying inside RTL elements (mapbox#9332)

* Add names before types for lambda types and object indexer types (mapbox#9331)

* Update style.js (mapbox#9347)

* Use glUniform1i for boolean uniforms (mapbox#9349)

We used glUniform1f for some of them, which caused rendering errors in at least Chrome 48. Changing these calls to the correct call glUniform1i fixes this issue.

* terser options for better compression (mapbox#9357)

* disable depth mode for heatmaps (mapbox#9364)

* Return evaluated properties in query results (mapbox#9198)

* Cache serialized layer rather than serializing on every feature

* Fix some lint & flow errors

* Evaluate properties

* Fix unit test and Flow

* Revert comment changes

* Revert comment changes

* Cache serialized layers

* Delete serializedLayers on removeLayer

* Cache available images

* Update availableImages

* Remove comment

* Simplify evaluation code

* Remove unused variable

* Clean up change to resolved images

* Update serializedLayers when adding/removing layers

* Only serialized non-custom layers

* Simplify code

* Add query test

* Eslint JSDoc fixes  (mapbox#8960)

* add eslint jsdoc rules only

* begin updating JSDoc to satisfy eslint requirements

* address new linting warnings

* Update src/source/image_source.js

* Update src/ui/map.js

* lowercase boolean

* address jsdoc feedback

* revert changes to yarn.lock

* simplify expression outputs validation (mapbox#9355)

* remove period from `pitch` description (mapbox#9371)

* Correctly detect expressions and legacy filters for the new in expression (mapbox#9374)

* Remove unused struct code (mapbox#9358)

* remove unused struct setters

* remove unused struct classes with direct getters

* clarify struct generation code

* Add changelog policy to contribution guidelines (mapbox#9378)

* Add changelog policy to contribution guidelines

* Address feedback

* Prevent creation of unused depth renderbuffer attachments (mapbox#9377)

* Remove unused depth renderbuffer

Should save width * height * 2 bytes of uncompressed buffer memory

* Prevent creation of unused depth renderbuffers

Add option to allow not creating extra renderbuffers
Refer https://www.khronos.org/registry/webgl/specs/latest/1.0/\#6.8 for supported attachment variants
Should save the hillshade offscreen buffer width * height * 2 bytes of uncompressed gpu memory

* Fix lint

* Update src/gl/framebuffer.js

Co-Authored-By: Vladimir Agafonkin <agafonkin@gmail.com>

Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>

* [render tests] Add streets-v11 test for the tile map mode (mapbox#9382)

* [render tests] Add streets-v11 test for the tile map mode

* Fix ignore file

* Update test/ignores.json

Co-authored-by: Asheem Mamoowala <asheem.mamoowala@mapbox.com>

* Do not warn about icon-image expressions evaluating to '' (mapbox#9380)

* do not warn on empty icon image, treat it as unset

* clean up hasIcon condition in symbol bucket

* [render tests] Adjust tile mode render tests

- increased tolerance for `text-variable-anchor/left-top-right-buttom-offset-tile-map-mode`
- hide collision data for `tile-mode/streets-v11`

* [render tests] Further tile mode tests adjustment

- `left-top-right-buttom-offset-tile-map-mode` -> `left-top-right-bottom-offset-tile-map-mode`
- increase tolerance at `tile-mode/streets-v11`

* Fix corner case with dash-array 0-length collapsing (mapbox#9385)

A dash array with values [0,0] results in a full collapse of values since it does not represent
any dashes, fix the behavior with early return and add some more unit test coverage for other
corner cases

* Remove the simplex font and switch to using canvas for debug text (mapbox#9267)

* Specify node version 10 (mapbox#9389)


Co-Authored-By: Arindam Bose <arindam.bose@mapbox.com>

* [render tests][tile mode] Add symbol-placement/line-center render tests

Added the following render tests for the tile map mode:
- `symbol-placement/line-center-tile-map-mode`
- `symbol-placement/line-center-buffer-tile-map-mode`

* Add render test for filter with expression in. (mapbox#9393)

* [docs] clarify `symbol-sort-key` behaviour with and without overlap (mapbox#9379)

* Fix line-pattern artifacts under overscaling and underscaling (mapbox#9266)

* Fix line pattern when the pattern size is lower than the line width
Visual differences:
1. When the line pattern fits on a line smaller than its own resolution,
we downscale while keeping the aspect ratio at integer zoom level
2. When the line pattern fits on a line larger than its own resolution,
we upscale while keeping the aspect ratio at integer zoom level
3. When the line pattern has different resolution (1x, 2x, 3x...),
the pattern screenspace resolution should remain stable (e.g. the
physical resolution shouldn't impact the size at which the pattern is
rendered but instead increase the quality of the visual while keeping
its logical resolution)

The current behavior does not account for 1. and 3.

Shader differences:
Try to move for more 'mad' instruction instead of 'div':

per-instruction shader count differences:
 before
  6 mad, 12 div, 12 add, 9 mul
 after
  13 mad, 8 div, 6 add, 9 mul

This increases the number of mad instructions (multiply-add) for
fewer cycles and decreases the number of divisions and additions

Issue #15472

* Update test images to account for new behavior

* Fix marching-ants issue

* Adjust patterns added with `addImage` by the asset pixel ratio  (mapbox#9372)

* Adjust *-pattern images based on their asset pixel ratio
Instead of using the device pixel ratio, use the image asset pixel ratio

Fix for issue mapbox#8020

* EOF

* Add render tests

* Rebase from master
Update baseline for line-pattern to take into account mapbox#9266

* Introduce `within` expression (mapbox#9352)

* Update version number for GL JS and style spec on master (mapbox#9408)

* Fix for IE11 not supporting startsWith (mapbox#9409)

* Fix webgl error for IE11 with uploading painter::emptyTexture (mapbox#9410)

* Remove Hershey Simplex font attribution from the license (mapbox#9423)

* update changelog for v1.8.1

* Upgrade minimist to ^1.2.5 (mapbox#9425)

* update pr template team tags (mapbox#9426)

* Avoid throwing errors when popup container is undefined (mapbox#9433)

* Use TileCoordinates instead of LngLats for `within` calculation (mapbox#9428)

* Using TileCoordinates instead of LngLat for within calculation

* Update tests

* Adapt test data

* Add render tests

* v1.9.0 (mapbox#9444) (mapbox#9453)

* Don't reload the entire font range when a glyph is missing in a font (mapbox#9375)

* Ignore missing glyph when font range is already loaded

* Add test

* lint

* Fix tests

* Remove line

* Remove line

* Lint

* Add ranges flow definition

* Use helpers function

* populate paint arrays once per line feature (mapbox#9452)

instead of once per linestring in a multiline

* fix fill extrusion querying for colinear points (mapbox#9454)

When checking for intersections with a fill-extrusion it has to
calculate the distance to the plane the polygon exist on. If the first
points of the geometry were colinear this calculation would fail.

It now:
- finds two distinct starting points a, b
- loops over all the remaining vertices looking for a value that is not
colinear with a, b

Usually this will be the first vertex it encounters.

* Fix `within` expression issue with geometry crossing the 180th Meridian (mapbox#9440)

* Fix geometry accross meridian

* Update tests

* Add pre-condintion

* Avoid overflow

* Add more tests

* Adapt test

* Remove unnecessary condition

* Address review findings

* Upgrade direct dependencies & do yarn upgrade (mapbox#9466)

* upgrade direct dependencies & do yarn upgrade

* fix lint warning

* 😬

* upgrade more stuff

Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>

* add an extra check for paint member of style layer (mapbox#9437)

* add an extra check for paint member of style layer

* review comments

Co-Authored-By: Vladimir Agafonkin <agafonkin@gmail.com>

Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>

* remove leftover page shell (unused since the docs split) (mapbox#9470)

* more resilient paint check in setFeatureState (mapbox#9472)

* Collision circle generation at runtime (mapbox#9219)

* Ensure padding is not propagated from fitBounds to transform padding (mapbox#9481)

(cherry picked from commit 7431c95)

* Fix pattern attributes vertex layout (mapbox#9482)

* Fix vertex layout attribute offset when used with DDS
The vertex layout offset for patternAttributes is overriden to be 0, this is incorrect as each component of this layout
require a specific offset to be set to appropriately bind the buffers when calling vertexAttribPointer

* Fix flow

* Cleanup unused param

* Add render tests for data driven styling coverage

* EOL

* optimize tail calls in feature state sorting (mapbox#9463)

* Update per mdn webgl recommendations (mapbox#9474)

* Update per mdn webgl recommendations
- Delete shader handles after succesfull compilation
- Query render to half float texture instead of calling checkFramebufferStatus, potentially involving flush + round-trip on first frame

* Add heatmap layer to release testing

* fix documented type of the locale option to Map (mapbox#9486)

* Ensure each tile symbol tile uses its own unique Program based on its state (mapbox#9493)

(cherry picked from commit 9f1aba5)

* Add `slice` and `index-of` expressions (mapbox#9450)

* Allow client to retry RTLTextPlugin load after NetworkError (mapbox#9489)

* Fix several listener leaks in popups (mapbox#9498)

* Add methods to mapboxgl namespace to allow preloading of workers. (mapbox#9391)

* Basic preload workers

* Switch to hardcoded preloaded workerpool id so its easier to identify when workers have been preloaded

* Add removePreloadedWorkerPool to mapboxgl namespace

* Fix flow and lint errors

* Add documentation and address CR comments.

* Reword docs language to be clearer.

Co-Authored-By: Konstantin Käfer <mail@kkaefer.com>

* More cleaning of language in documentation.

Co-Authored-By: Konstantin Käfer <mail@kkaefer.com>

Co-authored-by: Konstantin Käfer <mail@kkaefer.com>

* Remove docs pages from .gitignore file (mapbox#9504)

* refactor and expand gesture handling (mapbox#9365)

Co-authored-by: Anjana Vakil <anjana.vakil@mapbox.com>

- refactor gesture handling to allow multiple handlers to run simultaneously
- add a pitch gesture
- add a tap-drag-zoom gesture
- fix various bugs (see PR)

* Prepare for next release cycle (mapbox#9506)

* Fix minor typo (mapbox#9507)

* [render tests][tile mode] Add `icon-text-fit/text-variable-anchor-tile-map-mode` test

* fix DragRotateHandler#isActive (mapbox#9511)

* fix DragRotateHandler#isActive (mapbox#9514)

Co-authored-by: Ansis Brammanis <ansis@mapbox.com>

* remove handler event listeners when map is removed (mapbox#9508)

* Update style specification compatibility tables (release-vanillashake) (mapbox#9509)

Updated the style specification compatibility tables for Android map SDK v9.1.0, iOS map SDK v5.8.0, and macOS map SDK v0.15.0.

* Fix for issue 9518 (mapbox#9520)

* Add regression test for mapbox#9518

* More thorough input checks for isPatternMissing function
Fixes regression introduced by mapbox#9380

ResolvedImage.fromString may now return null, which potentially leaves CrossFaded<ResolvedImage>
with missing image patterns

I have traced other code paths using ResolvedImage.fromString and have not seen
any other potential offenders

* fix mapbox#9519 click map event on touch devices (mapbox#9526)

* Add render-tests for line-dasharray case (mapbox#9525)

Trick to mimic an outline with a different color.

* Follow-up of adding test cases for line-dasharray case

This test should be ignored because the rendering result is wrong.

* [master] Fix style-spec isolation for within expression (mapbox#9522)

* - Add a build-time check for style-spec referencing external files
- Refactor within to NOT import external files

* Address review comments

* export isExpressionFilter from spec (mapbox#9530)

* fix mapTouchEvent.point for touchend events (mapbox#9536)

* update changlogs to add 1.9.1 and style-spec@v13.13.1 (mapbox#9540)

* Refactor format_section_override out of style-spec (mapbox#9543)

* fix DragRotate when mouseup occurs outside window or iframe (mapbox#9512)

fix mapbox#4622

* Add diff-tarball script and more explicit files property in package.json (mapbox#9550)

* More explicit files property in package.json
To prevent potential upload error when publishing to npm
Refer https://docs.npmjs.com/files/package.json\#files

* Add a way to diff the new tarball content with previously published version
This is intended to be used as part of our release process before publishing to NPM
--dry-run is a useful step, but can be fairly noisy, yarn run v1.21.1
to go along the fake deploy and more clearly shows what would be added and deleted

* Run the diff as part of prepublishOnly

* Prompt to ensure user check before going further with publishing when running 'npm publish'

* fix example typo (mapbox#9568)

* Clean check in `prepublishOnly` (mapbox#9590)

* Clean check in prepublishOnly

Runs clean check as a first step in prepublishOnly.
This ensures a clean directory before building the build content and
before the manual diffing with previously published tarball.

* Address comments

* Add scale to Marker options (mapbox#9414)

* Change return type to boolean for StyleImageInterface type alias (mapbox#9604)

* Fix using `within` expression with complex `filter` (mapbox#9611)

* Fix within usage with othere expressions in the same filter

* Add render tests

* Fix filter operator checking for nested condition

* Trigger memory metrics build on CircleCI (mapbox#9622)

* Documentation improvements sprint (mapbox#9607)

Various documentation enhancements from the docs sprints:

* [docsprint] Clarify meaning of Map#isSourceLoaded (mapbox#9589)
* [docsprint] Add geolocate trigger example (mapbox#9552)
* [docsprint] Add inline snippet to marker#addTo (mapbox#9592)
* [docsprint] Add inline snippet and related examples to popup.setHTML (mapbox#9538)
* add inline snippet and related examples to popup.setHTML
* update see URLs to docs subdomain
* Add inline and related example for panTo (mapbox#9547)
* Add inline snippet to LngLatBounds.contains (mapbox#9548)
* [docsprint] Add inline snippet and examples to map.jumpTo (mapbox#9549)
* add inline snippet and examples to map.jumpTo
* minor reorder to match options and text
* added inline and tutorial examples for map.getCenter (mapbox#9551)
* add example for Marker class setLngLat (mapbox#9553)
* added examples to get- and setLayoutProperty (mapbox#9554)
* add inline snippet and examples to map.triggerRepaint (mapbox#9555)
* CameraOptions - update pitch and bearing definitions, add inline code example, add example links (mapbox#9556)
* add inline code snippet to map.showTileBoundaries (mapbox#9557)
* Mark Debug namespace as private to hide it from the docs (mapbox#9558)
* [docsprint] Add detail to docs on setFeatureState, removeFeatureState, getFeatureState (mapbox#9559)
* add detail to docs on setFeatureState, removeFeatureState, getFeatureState
* remove trailing spaces
* [docsprint] map.on: remove extra on section, link to event types, add code snippet, add related (mapbox#9560)
* add examples to open and close popup events (mapbox#9565)
* [docsprint] Clarify how map.moveLayer works (mapbox#9566)
* clarify how map.moveLayer works
* fix id capitalization
* [doscprint] add links to EPSG and minor example changes for LngLat (mapbox#9570)
* add links to EPSG and minor example changes for LngLat
* document the layer object's properties in addLayer (mapbox#9571)
* [docsprint] Add inline snippet and examples to popup.addTo (mapbox#9572)
* added inline example to popup-addto
* added relevant examples to popup.addto
* Add inline example for trackPointer (mapbox#9575)
* Add inline example for Popup#getElement (mapbox#9576)
* [docsprint] Add inline examples for Point & PointLike types (mapbox#9577)
* Add inline examples for Point & PointLike types
* Correct syntax
* [docsprint] Cleanup doc for MapBoxZoomEvent (mapbox#9564)
* Describe map style object returned by Map#getStyle (mapbox#9579)
* [docsprint] Add inline example for getClusterLeaves (mapbox#9580)
* [docsprint] PaddingOptions - update definition, example, and related (mapbox#9581)
* PaddingOptions - update definition, example, and related
* Fixes formatting issues
* [docsprint] Add inline snippet to marker#setPopup, marker#getPopup, and marker#togglePopup (mapbox#9582)
* update setPopup
* update togglePopup
* update formatting
* update setFilter jsdoc (mapbox#9586)
* add more details to getSource (mapbox#9587)
* add clearStorage example (mapbox#9588)
* [docsprint] Add documentation for RequestParameters (mapbox#9573)
* [docsprint] Add inline example for setZoomRate and setWheelZoomRate of scrollZoomHandler (mapbox#9593)
* Add inline example for setZoomRate of scrollZoomHandler
* add setWheelZoomRate inline example
* Add inline examples for map zoom-related methods (mapbox#9594)
* [docsprint] Add example to MapMouseEvent (mapbox#9595)
* add example to MapMouseEvent
* Add examples for GeolocateControl events (mapbox#9596)
* [docsprint] Add example to MapDataEvent (mapbox#9597)
* add example to MapDataEvent
* add example for getLngLat (mapbox#9591)
* suggested edits for clarifying mouse events
* Small grammar fix: "optional the `layerId`" -> "the optional `layerId"
* Update pitch param definition; add Display buildings in 3D example
* remove example object, light formatting and copyediting


Co-Authored-By: Dan Swick <dan.swick@gmail.com>
Co-authored-by: Adriana Babakanian <adriana.babakanian@mapbox.com>
Co-authored-by: Sam Fader <samfader@users.noreply.github.com>
Co-authored-by: Heather Stenson <heather.stenson@mapbox.com>
Co-authored-by: Katy DeCorah <decorah@mapbox.com>
Co-authored-by: jbranigan <john.branigan@mapbox.com>
Co-authored-by: Jeremy Stratman <jstratman@users.noreply.github.com>
Co-authored-by: Mal Wood-Santoro <mal.wood@mapbox.com>
Co-authored-by: Asheem Mamoowala <asheem.mamoowala@mapbox.com>
Co-authored-by: Colleen McGinnis <colleen.mcginnis@mapbox.com>
Co-authored-by: geografa <geografa@users.noreply.github.com>
Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
Co-authored-by: David Wicks <david.wicks@mapbox.com>
Co-authored-by: Deven Diliberto <deven.diliberto@mapbox.com>
Co-authored-by: Colleen <colleen.j.mcginnis@gmail.com>
Co-authored-by: Karim Naaji <karim.naaji@gmail.com>

* Reverse tap-drag-zoom direction (mapbox#9618)

fixes mapbox#9612

* [render tests] Add `all-anchors-labels-priority-tile-map-mode` test

* Pull changelog from v1.10.0 in master (mapbox#9635)

* Pull changelog from v1.10.0 in master

* Add stylespec CHANGELOG.md

Co-authored-by: Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>
Co-authored-by: Ryan Hamley <ryan.hamley@mapbox.com>
Co-authored-by: Tristen Brown <tristen@users.noreply.github.com>
Co-authored-by: Andrew Harvey <andrew@alantgeo.com.au>
Co-authored-by: Arindam Bose <arindam.bose@mapbox.com>
Co-authored-by: Colleen McGinnis <colleen.mcginnis@mapbox.com>
Co-authored-by: Andreas Hocevar <andreas.hocevar@gmail.com>
Co-authored-by: dburnsii <dburnsii@live.com>
Co-authored-by: Poluektov Dmitriy <dmitry.a@kr.digital>
Co-authored-by: Konstantin Käfer <mail@kkaefer.com>
Co-authored-by: Ádám Barancsuk <adam.barancsuk@gmail.com>
Co-authored-by: Adriana Babakanian <adriana.babakanian@mapbox.com>
Co-authored-by: Vladimir Agafonkin <agafonkin@gmail.com>
Co-authored-by: Juha Alanen <juha.alanen@mapbox.com>
Co-authored-by: Madison Draper <madison.draper@mapbox.com>
Co-authored-by: Ansis Brammanis <ansis@mapbox.com>
Co-authored-by: Nicholas Latham <nicholas-l@users.noreply.github.com>
Co-authored-by: Saman Bemel-Benrud <samanpwbb@gmail.com>
Co-authored-by: Dmytro Gokun <dmytro-gokun@users.noreply.github.com>
Co-authored-by: Michael Barry <msbarry@users.noreply.github.com>
Co-authored-by: Anjana Sofia Vakil <anjana.vakil@mapbox.com>
Co-authored-by: Dan Swick <dan.swick@gmail.com>
Co-authored-by: Juha Lindstedt <juha@pakastin.fi>
Co-authored-by: Alexander Shalamov <alexander.shalamov@mapbox.com>
Co-authored-by: Asheem Mamoowala <asheem.mamoowala@mapbox.com>
Co-authored-by: Andrew Hay Kurtz <andrew.hay.kurtz@gmail.com>
Co-authored-by: Adriana Babakanian <ababakanian@berkeley.edu>
Co-authored-by: Aleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com>
Co-authored-by: Chloe Krawczyk <chloe.krawczyk@mapbox.com>
Co-authored-by: Jo <joie.software@gmail.com>
Co-authored-by: Mikko Pulkki <55925868+mpulkki-mapbox@users.noreply.github.com>
Co-authored-by: SeulGi Choi(Chase) <cs09gi@gmail.com>
Co-authored-by: Ansis Brammanis <ansis.brammanis@gmail.com>
Co-authored-by: Yanonix <github@yanonix.fr>
Co-authored-by: Mal Wood-Santoro <mal.wood@mapbox.com>
Co-authored-by: Karim Naaji <karim.naaji@gmail.com>
Co-authored-by: Karim Naaji <karim.naaji@mapbox.com>
Co-authored-by: Boris <bk@webdeb.de>
Co-authored-by: Michael Holroyd <meekohi@gmail.com>
Co-authored-by: zmiao <miao.zhao@mapbox.com>
Co-authored-by: Geoffrey Ely <geoff@elygeo.net>
Co-authored-by: Katy DeCorah <decorah@mapbox.com>
Co-authored-by: Sanaz Golbabaei <32684731+sgolbabaei@users.noreply.github.com>
Co-authored-by: pathmapper <pathmapper@posteo.de>
Co-authored-by: Kevin Li <kevin.li@mapbox.com>
Co-authored-by: Thomas Watson <w@tson.dk>
Co-authored-by: oterral <oterral@users.noreply.github.com>
Co-authored-by: Nick Mann <nick_j_mann@uk.ibm.com>
Co-authored-by: Luke Butler <lukepbutler@gmail.com>
Co-authored-by: Mark Bell <mbell697@gmail.com>
Co-authored-by: Minh Nguyễn <mxn@1ec5.org>
Co-authored-by: Thiago Marcos P. Santos <tmpsantos@gmail.com>
Co-authored-by: Brave Cow <rsr715@gmail.com>
Co-authored-by: Sam Fader <samfader@users.noreply.github.com>
Co-authored-by: Heather Stenson <heather.stenson@mapbox.com>
Co-authored-by: jbranigan <john.branigan@mapbox.com>
Co-authored-by: Jeremy Stratman <jstratman@users.noreply.github.com>
Co-authored-by: geografa <geografa@users.noreply.github.com>
Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
Co-authored-by: David Wicks <david.wicks@mapbox.com>
Co-authored-by: Deven Diliberto <deven.diliberto@mapbox.com>
Co-authored-by: Colleen <colleen.j.mcginnis@gmail.com>
Co-authored-by: Joakim Berglund <neorth@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants