From 5aff6b5f347ab2e93883d56bc4d272849c22324b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Junod?= Date: Fri, 10 May 2019 19:05:29 +0200 Subject: [PATCH 01/11] Fixes spelling in github issue template (#8236) --- .github/ISSUE_TEMPLATE/Feature_request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md index ab8328a9534..8dd6641dcfd 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -49,6 +49,6 @@ Where do the concepts set new precedents? From a561d0a8b47bace1e6381f99093954e23b1f817a Mon Sep 17 00:00:00 2001 From: Maxence Bouret Date: Tue, 14 May 2019 02:44:36 +0100 Subject: [PATCH 02/11] Update mapbox-gl.css (#8227) When the map is inside a tag with `text-align: center` (or `right`), the map is not displayed properly. An easy fix is to add `text-align: left`. Screenshot with `text-align: center`: https://i.imgur.com/t1XU5uw.png --- src/css/mapbox-gl.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/css/mapbox-gl.css b/src/css/mapbox-gl.css index 3e992aa038e..3b0524e25cd 100644 --- a/src/css/mapbox-gl.css +++ b/src/css/mapbox-gl.css @@ -3,6 +3,7 @@ overflow: hidden; position: relative; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + text-align: left; } .mapboxgl-map:-webkit-full-screen { From 429633d6971b7ce7faa88bbb1f237e4087ce7a19 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 14 May 2019 10:44:42 +0300 Subject: [PATCH 03/11] Update erroneous/unused test metadata --- test/integration/lib/harness.js | 10 +--------- .../render-tests/basic-v9/z0-narrow-y/style.json | 2 -- .../render-tests/basic-v9/z0-wide-x/style.json | 2 -- test/integration/render-tests/basic-v9/z0/style.json | 2 -- test/integration/render-tests/bright-v9/z0/style.json | 4 +--- .../style.json | 2 +- .../debug/collision-pitched-wrapped/style.json | 2 +- .../render-tests/debug/collision-pitched/style.json | 2 +- .../render-tests/extent/1024-fill/style.json | 2 +- .../render-tests/extent/1024-line/style.json | 2 +- .../render-tests/extent/1024-symbol/style.json | 2 +- .../fill-extrusion-multiple/multiple/style.json | 2 +- .../fill-extrusion-pattern/function-2/style.json | 2 +- .../render-tests/fill-outline-color/fill/style.json | 2 +- .../fill-outline-color/function/style.json | 2 +- .../render-tests/fill-outline-color/literal/style.json | 2 +- .../render-tests/fill-outline-color/opacity/style.json | 2 +- .../zoom-and-property-function/style.json | 2 +- .../render-tests/line-gap-width/default/style.json | 2 +- .../render-tests/line-gap-width/function/style.json | 2 +- .../render-tests/line-gap-width/literal/style.json | 2 +- .../render-tests/line-gradient/translucent/style.json | 2 +- .../line-join/bevel-transparent/style.json | 2 +- .../render-tests/line-join/bevel/style.json | 2 +- .../render-tests/line-join/default/style.json | 2 +- .../line-join/miter-transparent/style.json | 2 +- .../render-tests/line-join/miter/style.json | 2 +- .../line-join/round-transparent/style.json | 2 +- .../render-tests/line-join/round/style.json | 2 +- .../line-offset/literal-negative/style.json | 2 +- .../render-tests/line-opacity/default/style.json | 2 +- .../render-tests/line-opacity/function/style.json | 2 +- .../render-tests/line-opacity/literal/style.json | 2 +- .../line-width/zero-width-function/style.json | 2 +- .../render-tests/line-width/zero-width/style.json | 2 +- .../projection/axonometric-multiple/style.json | 2 +- .../render-tests/projection/perspective/style.json | 2 +- .../regressions/mapbox-gl-js#2523/style.json | 2 +- .../regressions/mapbox-gl-js#2534/style.json | 2 +- .../regressions/mapbox-gl-js#4647/style.json | 2 +- .../regressions/mapbox-gl-js#5466/style.json | 4 +--- .../regressions/mapbox-gl-js#5642/style.json | 2 +- .../regressions/mapbox-gl-js#5953/style.json | 2 +- .../regressions/mapbox-gl-js#6238/style.json | 2 +- .../regressions/mapbox-gl-native#5648/style.json | 2 +- .../render-tests/satellite-v9/z0/style.json | 2 -- .../text-pitch-alignment/map-text-depthtest/style.json | 2 +- .../viewport-text-depthtest/style.json | 2 +- .../render-tests/zoom-history/in/style.json | 2 +- .../render-tests/zoom-history/out/style.json | 2 +- 50 files changed, 46 insertions(+), 66 deletions(-) diff --git a/test/integration/lib/harness.js b/test/integration/lib/harness.js index 9b248413ada..5afda7c4fe8 100644 --- a/test/integration/lib/harness.js +++ b/test/integration/lib/harness.js @@ -24,7 +24,7 @@ export default function (directory, implementation, options, run) { server.localizeURLs(style); style.metadata = style.metadata || {}; - const test = style.metadata.test = Object.assign({ + style.metadata.test = Object.assign({ id, ignored: ignores[`${path.basename(directory)}/${id}`], width: 512, @@ -34,14 +34,6 @@ export default function (directory, implementation, options, run) { allowed: 0.00015 }, style.metadata.test); - if ('diff' in test) { - if (typeof test.diff === 'number') { - test.allowed = test.diff; - } else if (implementation in test.diff) { - test.allowed = test.diff[implementation]; - } - } - return style; }) .filter(style => { diff --git a/test/integration/render-tests/basic-v9/z0-narrow-y/style.json b/test/integration/render-tests/basic-v9/z0-narrow-y/style.json index acf13a57737..0c8310ab970 100644 --- a/test/integration/render-tests/basic-v9/z0-narrow-y/style.json +++ b/test/integration/render-tests/basic-v9/z0-narrow-y/style.json @@ -4,8 +4,6 @@ "test": { "width": 600, "height": 480, - "center": [0, 0], - "zoom": 0, "operations": [ ["setStyle", "local://mapbox-gl-styles/styles/basic-v9.json"], ["wait"] diff --git a/test/integration/render-tests/basic-v9/z0-wide-x/style.json b/test/integration/render-tests/basic-v9/z0-wide-x/style.json index 11b1e7848e8..abe2537f0f2 100644 --- a/test/integration/render-tests/basic-v9/z0-wide-x/style.json +++ b/test/integration/render-tests/basic-v9/z0-wide-x/style.json @@ -4,8 +4,6 @@ "test": { "width": 600, "height": 512, - "center": [0, 0], - "zoom": 0, "operations": [ ["setStyle", "local://mapbox-gl-styles/styles/basic-v9.json"], ["wait"] diff --git a/test/integration/render-tests/basic-v9/z0/style.json b/test/integration/render-tests/basic-v9/z0/style.json index 827619d7655..34e181e6cf7 100644 --- a/test/integration/render-tests/basic-v9/z0/style.json +++ b/test/integration/render-tests/basic-v9/z0/style.json @@ -4,8 +4,6 @@ "test": { "width": 512, "height": 512, - "center": [0, 0], - "zoom": 0, "operations": [ ["setStyle", "local://mapbox-gl-styles/styles/basic-v9.json"], ["wait"] diff --git a/test/integration/render-tests/bright-v9/z0/style.json b/test/integration/render-tests/bright-v9/z0/style.json index e2c7b437524..0e3f97ff387 100644 --- a/test/integration/render-tests/bright-v9/z0/style.json +++ b/test/integration/render-tests/bright-v9/z0/style.json @@ -4,9 +4,7 @@ "test": { "width": 512, "height": 512, - "center": [0, 0], - "zoom": 0, - "diff": 0.00075, + "allowed": 0.00075, "operations": [ ["setStyle", "local://mapbox-gl-styles/styles/bright-v9.json"], ["wait"] diff --git a/test/integration/render-tests/combinations/hillshade-translucent--hillshade-translucent/style.json b/test/integration/render-tests/combinations/hillshade-translucent--hillshade-translucent/style.json index 7d1fc0c16f9..a957ac96ceb 100644 --- a/test/integration/render-tests/combinations/hillshade-translucent--hillshade-translucent/style.json +++ b/test/integration/render-tests/combinations/hillshade-translucent--hillshade-translucent/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.002 + "allowed": 0.002 } }, "center": [ diff --git a/test/integration/render-tests/debug/collision-pitched-wrapped/style.json b/test/integration/render-tests/debug/collision-pitched-wrapped/style.json index 586f810716d..eb29afbe093 100644 --- a/test/integration/render-tests/debug/collision-pitched-wrapped/style.json +++ b/test/integration/render-tests/debug/collision-pitched-wrapped/style.json @@ -5,7 +5,7 @@ "collisionDebug": true, "width": 500, "height": 500, - "diff": 0.005 + "allowed": 0.005 } }, "center": [ diff --git a/test/integration/render-tests/debug/collision-pitched/style.json b/test/integration/render-tests/debug/collision-pitched/style.json index dc96393ec55..36b3e532f5e 100644 --- a/test/integration/render-tests/debug/collision-pitched/style.json +++ b/test/integration/render-tests/debug/collision-pitched/style.json @@ -5,7 +5,7 @@ "collisionDebug": true, "width": 500, "height": 500, - "diff": 0.005 + "allowed": 0.005 } }, "center": [ diff --git a/test/integration/render-tests/extent/1024-fill/style.json b/test/integration/render-tests/extent/1024-fill/style.json index d3acb7b7dd2..95878250728 100644 --- a/test/integration/render-tests/extent/1024-fill/style.json +++ b/test/integration/render-tests/extent/1024-fill/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "diff": 0.0008 + "allowed": 0.0008 } }, "center": [ diff --git a/test/integration/render-tests/extent/1024-line/style.json b/test/integration/render-tests/extent/1024-line/style.json index a52a760f17c..e0d617140fd 100644 --- a/test/integration/render-tests/extent/1024-line/style.json +++ b/test/integration/render-tests/extent/1024-line/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "diff": 0.0005 + "allowed": 0.0005 } }, "center": [ diff --git a/test/integration/render-tests/extent/1024-symbol/style.json b/test/integration/render-tests/extent/1024-symbol/style.json index fd449795bbe..956ec14d7fa 100644 --- a/test/integration/render-tests/extent/1024-symbol/style.json +++ b/test/integration/render-tests/extent/1024-symbol/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "diff": 0.003 + "allowed": 0.003 } }, "center": [ diff --git a/test/integration/render-tests/fill-extrusion-multiple/multiple/style.json b/test/integration/render-tests/fill-extrusion-multiple/multiple/style.json index b185bb0ed29..57878885513 100644 --- a/test/integration/render-tests/fill-extrusion-multiple/multiple/style.json +++ b/test/integration/render-tests/fill-extrusion-multiple/multiple/style.json @@ -3,7 +3,7 @@ "metadata": { "test": { "height": 256, - "diff": 0.0005 + "allowed": 0.0005 } }, "sources": { diff --git a/test/integration/render-tests/fill-extrusion-pattern/function-2/style.json b/test/integration/render-tests/fill-extrusion-pattern/function-2/style.json index fcde2e7bab0..114a7b05b26 100644 --- a/test/integration/render-tests/fill-extrusion-pattern/function-2/style.json +++ b/test/integration/render-tests/fill-extrusion-pattern/function-2/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "diff": 0.0005, + "allowed": 0.0005, "height": 256 } }, diff --git a/test/integration/render-tests/fill-outline-color/fill/style.json b/test/integration/render-tests/fill-outline-color/fill/style.json index 937e08945c4..7d23e7648fb 100644 --- a/test/integration/render-tests/fill-outline-color/fill/style.json +++ b/test/integration/render-tests/fill-outline-color/fill/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/fill-outline-color/function/style.json b/test/integration/render-tests/fill-outline-color/function/style.json index ca8772ac552..457900c525a 100644 --- a/test/integration/render-tests/fill-outline-color/function/style.json +++ b/test/integration/render-tests/fill-outline-color/function/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/fill-outline-color/literal/style.json b/test/integration/render-tests/fill-outline-color/literal/style.json index 541cc9e91ec..1e8be720930 100644 --- a/test/integration/render-tests/fill-outline-color/literal/style.json +++ b/test/integration/render-tests/fill-outline-color/literal/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/fill-outline-color/opacity/style.json b/test/integration/render-tests/fill-outline-color/opacity/style.json index 1a3fc35ffad..cc57346269e 100644 --- a/test/integration/render-tests/fill-outline-color/opacity/style.json +++ b/test/integration/render-tests/fill-outline-color/opacity/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/fill-outline-color/zoom-and-property-function/style.json b/test/integration/render-tests/fill-outline-color/zoom-and-property-function/style.json index 881f1bc1fb2..1322032145f 100644 --- a/test/integration/render-tests/fill-outline-color/zoom-and-property-function/style.json +++ b/test/integration/render-tests/fill-outline-color/zoom-and-property-function/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "zoom": 0.1, diff --git a/test/integration/render-tests/line-gap-width/default/style.json b/test/integration/render-tests/line-gap-width/default/style.json index b34d1cfe8a5..3c1cce5bddb 100644 --- a/test/integration/render-tests/line-gap-width/default/style.json +++ b/test/integration/render-tests/line-gap-width/default/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-gap-width/function/style.json b/test/integration/render-tests/line-gap-width/function/style.json index 8e7e0709a42..d66a2f77318 100644 --- a/test/integration/render-tests/line-gap-width/function/style.json +++ b/test/integration/render-tests/line-gap-width/function/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-gap-width/literal/style.json b/test/integration/render-tests/line-gap-width/literal/style.json index d8e70e225ea..b9e0e8a2452 100644 --- a/test/integration/render-tests/line-gap-width/literal/style.json +++ b/test/integration/render-tests/line-gap-width/literal/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-gradient/translucent/style.json b/test/integration/render-tests/line-gradient/translucent/style.json index d412c1d11c8..c78380b12cd 100644 --- a/test/integration/render-tests/line-gradient/translucent/style.json +++ b/test/integration/render-tests/line-gradient/translucent/style.json @@ -4,7 +4,7 @@ "test": { "width": 100, "height": 100, - "diff": 0.00075 + "allowed": 0.00075 } }, "zoom": 2, diff --git a/test/integration/render-tests/line-join/bevel-transparent/style.json b/test/integration/render-tests/line-join/bevel-transparent/style.json index 75d1ad46cf5..c4ac5e243b2 100644 --- a/test/integration/render-tests/line-join/bevel-transparent/style.json +++ b/test/integration/render-tests/line-join/bevel-transparent/style.json @@ -4,7 +4,7 @@ "test": { "width": 112, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-join/bevel/style.json b/test/integration/render-tests/line-join/bevel/style.json index bc2ee24d860..58fd6b584ea 100644 --- a/test/integration/render-tests/line-join/bevel/style.json +++ b/test/integration/render-tests/line-join/bevel/style.json @@ -4,7 +4,7 @@ "test": { "width": 112, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-join/default/style.json b/test/integration/render-tests/line-join/default/style.json index 3fa38f41c4e..94694f0abcc 100644 --- a/test/integration/render-tests/line-join/default/style.json +++ b/test/integration/render-tests/line-join/default/style.json @@ -4,7 +4,7 @@ "test": { "width": 112, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-join/miter-transparent/style.json b/test/integration/render-tests/line-join/miter-transparent/style.json index 866c256ef0a..6c2d904c22c 100644 --- a/test/integration/render-tests/line-join/miter-transparent/style.json +++ b/test/integration/render-tests/line-join/miter-transparent/style.json @@ -4,7 +4,7 @@ "test": { "width": 112, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-join/miter/style.json b/test/integration/render-tests/line-join/miter/style.json index 62f11fb684e..8aabc8890ad 100644 --- a/test/integration/render-tests/line-join/miter/style.json +++ b/test/integration/render-tests/line-join/miter/style.json @@ -4,7 +4,7 @@ "test": { "width": 112, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-join/round-transparent/style.json b/test/integration/render-tests/line-join/round-transparent/style.json index eca6e83f836..b455bb032c8 100644 --- a/test/integration/render-tests/line-join/round-transparent/style.json +++ b/test/integration/render-tests/line-join/round-transparent/style.json @@ -4,7 +4,7 @@ "test": { "width": 112, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-join/round/style.json b/test/integration/render-tests/line-join/round/style.json index f205028d3b6..3472973fc75 100644 --- a/test/integration/render-tests/line-join/round/style.json +++ b/test/integration/render-tests/line-join/round/style.json @@ -4,7 +4,7 @@ "test": { "width": 112, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-offset/literal-negative/style.json b/test/integration/render-tests/line-offset/literal-negative/style.json index 379e808a522..b9c5e68caaa 100644 --- a/test/integration/render-tests/line-offset/literal-negative/style.json +++ b/test/integration/render-tests/line-offset/literal-negative/style.json @@ -3,7 +3,7 @@ "metadata": { "test": { "height": 256, - "diff": 0.0002 + "allowed": 0.0002 } }, "center": [ diff --git a/test/integration/render-tests/line-opacity/default/style.json b/test/integration/render-tests/line-opacity/default/style.json index 75374737e64..01b8ab97896 100644 --- a/test/integration/render-tests/line-opacity/default/style.json +++ b/test/integration/render-tests/line-opacity/default/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-opacity/function/style.json b/test/integration/render-tests/line-opacity/function/style.json index a6de3e0f6ba..b130e9094db 100644 --- a/test/integration/render-tests/line-opacity/function/style.json +++ b/test/integration/render-tests/line-opacity/function/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-opacity/literal/style.json b/test/integration/render-tests/line-opacity/literal/style.json index 742f9de1442..50213cf69e3 100644 --- a/test/integration/render-tests/line-opacity/literal/style.json +++ b/test/integration/render-tests/line-opacity/literal/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/line-width/zero-width-function/style.json b/test/integration/render-tests/line-width/zero-width-function/style.json index a76540531ed..071d12d57ce 100644 --- a/test/integration/render-tests/line-width/zero-width-function/style.json +++ b/test/integration/render-tests/line-width/zero-width-function/style.json @@ -4,7 +4,7 @@ "test": { "width": 100, "height": 100, - "diff": 0.00075 + "allowed": 0.00075 } }, "zoom": 2, diff --git a/test/integration/render-tests/line-width/zero-width/style.json b/test/integration/render-tests/line-width/zero-width/style.json index bca9c45b6f9..d86c4591aff 100644 --- a/test/integration/render-tests/line-width/zero-width/style.json +++ b/test/integration/render-tests/line-width/zero-width/style.json @@ -4,7 +4,7 @@ "test": { "width": 100, "height": 100, - "diff": 0.00075 + "allowed": 0.00075 } }, "zoom": 2, diff --git a/test/integration/render-tests/projection/axonometric-multiple/style.json b/test/integration/render-tests/projection/axonometric-multiple/style.json index 561ed07dce2..ec1bb76ad8c 100644 --- a/test/integration/render-tests/projection/axonometric-multiple/style.json +++ b/test/integration/render-tests/projection/axonometric-multiple/style.json @@ -4,7 +4,7 @@ "test": { "axonometric": true, "height": 256, - "diff": 0.0005 + "allowed": 0.0005 } }, "sources": { diff --git a/test/integration/render-tests/projection/perspective/style.json b/test/integration/render-tests/projection/perspective/style.json index f1629a9df86..831d3575802 100644 --- a/test/integration/render-tests/projection/perspective/style.json +++ b/test/integration/render-tests/projection/perspective/style.json @@ -3,7 +3,7 @@ "metadata": { "test": { "axonometric": false, - "diff": 0.00075 + "allowed": 0.00075 } }, "sources": { diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#2523/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#2523/style.json index 10397868a9b..f0af0d8c46e 100644 --- a/test/integration/render-tests/regressions/mapbox-gl-js#2523/style.json +++ b/test/integration/render-tests/regressions/mapbox-gl-js#2523/style.json @@ -3,7 +3,7 @@ "metadata": { "test": { "height": 256, - "diff": 0.003 + "allowed": 0.003 } }, "center": [ diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#2534/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#2534/style.json index 7528f016e33..b4acada4e13 100644 --- a/test/integration/render-tests/regressions/mapbox-gl-js#2534/style.json +++ b/test/integration/render-tests/regressions/mapbox-gl-js#2534/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "diff": 0.0003, + "allowed": 0.0003, "operations": [ ["setPaintProperty", "land", "fill-pattern", null], ["wait"] diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#4647/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#4647/style.json index d10c6b3c378..3859f2ac58c 100644 --- a/test/integration/render-tests/regressions/mapbox-gl-js#4647/style.json +++ b/test/integration/render-tests/regressions/mapbox-gl-js#4647/style.json @@ -4,7 +4,7 @@ "test": { "height": 64, "width": 64, - "diff": 0.001, + "allowed": 0.001, "collisionDebug":true } }, diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5466/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#5466/style.json index db27841daab..a874716aaef 100644 --- a/test/integration/render-tests/regressions/mapbox-gl-js#5466/style.json +++ b/test/integration/render-tests/regressions/mapbox-gl-js#5466/style.json @@ -3,9 +3,7 @@ "metadata": { "test": { "width": 512, - "height": 512, - "center": [0, 0], - "zoom": 1 + "height": 512 } }, "sources": { diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5642/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#5642/style.json index 076613480e4..28048e6d4ea 100644 --- a/test/integration/render-tests/regressions/mapbox-gl-js#5642/style.json +++ b/test/integration/render-tests/regressions/mapbox-gl-js#5642/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.001 + "allowed": 0.001 } }, "sources": { diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#5953/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#5953/style.json index c7e693d2db8..41509f8789c 100644 --- a/test/integration/render-tests/regressions/mapbox-gl-js#5953/style.json +++ b/test/integration/render-tests/regressions/mapbox-gl-js#5953/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.001, + "allowed": 0.001, "operations": [ [ "wait" diff --git a/test/integration/render-tests/regressions/mapbox-gl-js#6238/style.json b/test/integration/render-tests/regressions/mapbox-gl-js#6238/style.json index 8e6531a7734..07db401ff6a 100644 --- a/test/integration/render-tests/regressions/mapbox-gl-js#6238/style.json +++ b/test/integration/render-tests/regressions/mapbox-gl-js#6238/style.json @@ -4,7 +4,7 @@ "test": { "width": 64, "height": 64, - "diff": 0.001, + "allowed": 0.001, "operations": [ [ "wait" diff --git a/test/integration/render-tests/regressions/mapbox-gl-native#5648/style.json b/test/integration/render-tests/regressions/mapbox-gl-native#5648/style.json index 6eea41aed62..0074d337e7f 100644 --- a/test/integration/render-tests/regressions/mapbox-gl-native#5648/style.json +++ b/test/integration/render-tests/regressions/mapbox-gl-native#5648/style.json @@ -2,7 +2,7 @@ "version": 8, "metadata": { "test": { - "diff": 0.0003 + "allowed": 0.0003 } }, "center": [ diff --git a/test/integration/render-tests/satellite-v9/z0/style.json b/test/integration/render-tests/satellite-v9/z0/style.json index 5df821952cd..a3a0ca083fa 100644 --- a/test/integration/render-tests/satellite-v9/z0/style.json +++ b/test/integration/render-tests/satellite-v9/z0/style.json @@ -4,8 +4,6 @@ "test": { "width": 512, "height": 512, - "center": [0, 0], - "zoom": 0, "operations": [ ["setStyle", "local://mapbox-gl-styles/styles/satellite-v9.json"], ["wait"], diff --git a/test/integration/render-tests/text-pitch-alignment/map-text-depthtest/style.json b/test/integration/render-tests/text-pitch-alignment/map-text-depthtest/style.json index 97e1b39d462..17c38af2b62 100644 --- a/test/integration/render-tests/text-pitch-alignment/map-text-depthtest/style.json +++ b/test/integration/render-tests/text-pitch-alignment/map-text-depthtest/style.json @@ -3,7 +3,7 @@ "metadata": { "test": { "height": 256, - "diff": 0.00025 + "allowed": 0.00025 } }, "center": [ diff --git a/test/integration/render-tests/text-pitch-alignment/viewport-text-depthtest/style.json b/test/integration/render-tests/text-pitch-alignment/viewport-text-depthtest/style.json index 5532c4b142e..5cec21940cb 100644 --- a/test/integration/render-tests/text-pitch-alignment/viewport-text-depthtest/style.json +++ b/test/integration/render-tests/text-pitch-alignment/viewport-text-depthtest/style.json @@ -3,7 +3,7 @@ "metadata": { "test": { "height": 256, - "diff": 0.00025 + "allowed": 0.00025 } }, "center": [ diff --git a/test/integration/render-tests/zoom-history/in/style.json b/test/integration/render-tests/zoom-history/in/style.json index 334502bd51e..8dd0f487bfe 100644 --- a/test/integration/render-tests/zoom-history/in/style.json +++ b/test/integration/render-tests/zoom-history/in/style.json @@ -4,7 +4,7 @@ "test": { "width": 256, "height": 256, - "diff": 0.00025, + "allowed": 0.00025, "operations": [ [ "wait" diff --git a/test/integration/render-tests/zoom-history/out/style.json b/test/integration/render-tests/zoom-history/out/style.json index aee7d4b7dd7..4e402da75ff 100644 --- a/test/integration/render-tests/zoom-history/out/style.json +++ b/test/integration/render-tests/zoom-history/out/style.json @@ -4,7 +4,7 @@ "test": { "width": 256, "height": 256, - "diff": 0.00025, + "allowed": 0.00025, "operations": [ [ "wait" From fd9cc5d145da7c458d1642f6387a9bba92e7ac24 Mon Sep 17 00:00:00 2001 From: Brian Ambielli Date: Mon, 20 May 2019 14:01:14 -0500 Subject: [PATCH 04/11] fixes zoomstart and movestart firing multiple times (#8259) --- src/ui/handler/scroll_zoom.js | 9 ++- test/README.md | 3 +- test/unit/ui/handler/scroll_zoom.test.js | 89 ++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 4 deletions(-) diff --git a/src/ui/handler/scroll_zoom.js b/src/ui/handler/scroll_zoom.js index 3f018c748eb..eab8bbf8556 100644 --- a/src/ui/handler/scroll_zoom.js +++ b/src/ui/handler/scroll_zoom.js @@ -215,9 +215,12 @@ class ScrollZoomHandler { } this._active = true; - this._zooming = true; - this._map.fire(new Event('movestart', {originalEvent: e})); - this._map.fire(new Event('zoomstart', {originalEvent: e})); + if (!this.isZooming()) { + this._zooming = true; + this._map.fire(new Event('movestart', {originalEvent: e})); + this._map.fire(new Event('zoomstart', {originalEvent: e})); + } + if (this._finishTimeout) { clearTimeout(this._finishTimeout); } diff --git a/test/README.md b/test/README.md index ed53f9218df..79dcfe71133 100644 --- a/test/README.md +++ b/test/README.md @@ -12,7 +12,8 @@ There are two test suites associated with Mapbox GL JS To run individual tests: - - Unit tests: `yarn test-unit path/to/file.test.js` where the path begins within the `/test/unit/` directory + - Unit tests: `yarn test-unit path/to/file.test.js` where path *does not include* `test/unit/` + - e.g. `yarn test-unit ui/handler/scroll_zoom.test.js` - Render tests: `yarn test-render render-test-name` (e.g. `yarn test-render background-color/default`) ## Writing Unit Tests diff --git a/test/unit/ui/handler/scroll_zoom.test.js b/test/unit/ui/handler/scroll_zoom.test.js index 6cecaf7551f..21177f00505 100644 --- a/test/unit/ui/handler/scroll_zoom.test.js +++ b/test/unit/ui/handler/scroll_zoom.test.js @@ -4,6 +4,7 @@ import window from '../../../../src/util/window'; import Map from '../../../../src/ui/map'; import DOM from '../../../../src/util/dom'; import simulate from 'mapbox-gl-js-test/simulate_interaction'; +import sinon from 'sinon'; function createMap(t) { t.stub(Map.prototype, '_detectMissingCSS'); @@ -148,5 +149,93 @@ test('ScrollZoomHandler', (t) => { t.end(); }); + t.test('emits one movestart event and one moveend event while zooming', (t) => { + const clock = sinon.useFakeTimers(now); + const map = createMap(t); + + let startCount = 0; + map.on('movestart', () => { + startCount += 1; + }); + + let endCount = 0; + map.on('moveend', () => { + endCount += 1; + }); + + const events = [ + [2, {type: 'trackpad', deltaY: -1}], + [7, {type: 'trackpad', deltaY: -2}], + [30, {type: 'wheel', deltaY: -5}] + ]; + + const end = now + 50; + let lastWheelEvent = now; + + while (now++ < end) { + if (events.length && lastWheelEvent + events[0][0] === now) { + const [, event] = events.shift(); + simulate.wheel(map.getCanvas(), event); + lastWheelEvent = now; + } + if (now % 20 === 0) { + map._renderTaskQueue.run(); + } + } + + clock.tick(200); + + t.equal(startCount, 1); + t.equal(endCount, 1); + + clock.restore(); + + t.end(); + }); + + t.test('emits one zoomstart event and one zoomend event while zooming', (t) => { + const clock = sinon.useFakeTimers(now); + const map = createMap(t); + + let startCount = 0; + map.on('zoomstart', () => { + startCount += 1; + }); + + let endCount = 0; + map.on('zoomend', () => { + endCount += 1; + }); + + const events = [ + [2, {type: 'trackpad', deltaY: -1}], + [7, {type: 'trackpad', deltaY: -2}], + [30, {type: 'wheel', deltaY: -5}], + ]; + + const end = now + 50; + let lastWheelEvent = now; + + while (now++ < end) { + if (events.length && lastWheelEvent + events[0][0] === now) { + const [, event] = events.shift(); + simulate.wheel(map.getCanvas(), event); + lastWheelEvent = now; + } + if (now % 20 === 0) { + map._renderTaskQueue.run(); + } + } + + clock.tick(200); + + t.equal(startCount, 1); + t.equal(endCount, 1); + + clock.restore(); + + t.end(); + }); + t.end(); }); From 5dae56219bcf6942b81b4c455748f3754f7cdeba Mon Sep 17 00:00:00 2001 From: Ryan Hamley Date: Wed, 22 May 2019 14:19:33 -0700 Subject: [PATCH 05/11] cherry-pick release-mojito commits to master (#8280) --- CHANGELOG.md | 21 +- bench/lib/fetch_style.js | 6 +- bench/lib/tile_parser.js | 21 +- package.json | 4 +- src/render/glyph_manager.js | 10 +- src/source/geojson_source.js | 2 +- src/source/image_source.js | 2 +- src/source/load_tilejson.js | 9 +- src/source/raster_dem_tile_source.js | 5 +- src/source/raster_tile_source.js | 10 +- src/source/vector_tile_source.js | 10 +- src/source/video_source.js | 2 +- src/style/load_glyph_range.js | 10 +- src/style/load_sprite.js | 9 +- src/style/style.js | 10 +- src/style/style_layer/symbol_style_layer.js | 2 +- src/ui/map.js | 22 +- src/util/mapbox.js | 133 +++- src/util/{token.js => resolve_tokens.js} | 0 src/util/sku_token.js | 42 ++ test/unit/source/geojson_source.test.js | 14 +- test/unit/source/image_source.test.js | 13 +- .../source/raster_dem_tile_source.test.js | 5 +- test/unit/source/raster_tile_source.test.js | 5 +- test/unit/source/vector_tile_source.test.js | 5 +- test/unit/style/load_glyph_range.test.js | 4 +- test/unit/style/style.test.js | 10 +- test/unit/ui/control/logo.test.js | 1 + test/unit/util/mapbox.test.js | 616 ++++++++++-------- .../{token.test.js => resolve_tokens.test.js} | 2 +- test/unit/util/sku_token.test.js | 32 + 31 files changed, 638 insertions(+), 399 deletions(-) rename src/util/{token.js => resolve_tokens.js} (100%) create mode 100644 src/util/sku_token.js rename test/unit/util/{token.test.js => resolve_tokens.test.js} (96%) create mode 100644 test/unit/util/sku_token.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index fd35fadb38c..1c81f426d75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,23 @@ -## 0.54.0-beta.1 +## 1.0.0 + +### ⚠️ Breaking changes + +This release replaces the existing “map views” pricing model in favor of a “map load” model. Learn more in [a recent blog post about these changes](https://blog.mapbox.com/new-pricing-46b7c26166e7). + +**By upgrading to this release, you are opting in to the new map loads pricing.** + +**Why is this change being made?** + +This change allows us to implement a more standardized and predictable method of billing GL JS map usage. You’ll be charged whenever your website or web application loads, not by when users pan and zoom around the map, incentivizing developers to create highly interactive map experiences. The new pricing structure also creates a significantly larger free tier to help developers get started building their applications with Mapbox tools while pay-as-you-go pricing and automatic volume discounts help your application scale with Mapbox. Session billing also aligns invoices with metrics web developers already track and makes it easier to compare usage with other mapping providers. + +**What is changing?** +- Add SKU token to Mapbox API requests [#8276](https://github.com/mapbox/mapbox-gl-js/pull/8276) + +When (and only when) loading tiles from a Mapbox API with a Mapbox access token set (`mapboxgl.accessToken`), a query parameter named `sku` will be added to all requests for vector, raster and raster-dem tiles. Every map instance uses a unique `sku` value, which is refreshed every 12 hours. The token itself is comprised of a token version (always “1”), a sku ID (always “01”) and a random 10-digit base-62 number. The purpose of the token is to allow for metering of map sessions on the server-side. A session lasts from a new map instantiation until the map is destroyed or 12 hours passes, whichever comes first. + +For further information on the pricing changes, you can read our [blog post](https://blog.mapbox.com/new-pricing-46b7c26166e7) and check out our new [pricing page](https://www.mapbox.com/pricing), which has a price calculator. As always, you can also contact our team at [https://support.mapbox.com](https://support.mapbox.com). + +## 0.54.0 ### Breaking changes diff --git a/bench/lib/fetch_style.js b/bench/lib/fetch_style.js index a766e8a6f75..316cfd84588 100644 --- a/bench/lib/fetch_style.js +++ b/bench/lib/fetch_style.js @@ -1,10 +1,12 @@ // @flow import type {StyleSpecification} from '../../src/style-spec/types'; -import {normalizeStyleURL} from '../../src/util/mapbox'; +import { RequestManager } from '../../src/util/mapbox'; + +const requestManager = new RequestManager(); export default function fetchStyle(value: string | StyleSpecification): Promise { return typeof value === 'string' ? - fetch(normalizeStyleURL(value)).then(response => response.json()) : + fetch(requestManager.normalizeStyleURL(value)).then(response => response.json()) : Promise.resolve(value); } diff --git a/bench/lib/tile_parser.js b/bench/lib/tile_parser.js index 1b0d72dabf3..3be9eb95b16 100644 --- a/bench/lib/tile_parser.js +++ b/bench/lib/tile_parser.js @@ -7,7 +7,7 @@ import assert from 'assert'; import deref from '../../src/style-spec/deref'; import Style from '../../src/style/style'; import { Evented } from '../../src/util/evented'; -import { normalizeSourceURL, normalizeTileURL } from '../../src/util/mapbox'; +import { RequestManager } from '../../src/util/mapbox'; import WorkerTile from '../../src/source/worker_tile'; import StyleLayerIndex from '../../src/style/style_layer_index'; @@ -17,14 +17,19 @@ import type { OverscaledTileID } from '../../src/source/tile_id'; import type { TileJSON } from '../../src/types/tilejson'; class StubMap extends Evented { - _transformRequest(url) { - return {url}; + _requestManager: RequestManager; + + constructor() { + super(); + this._requestManager = new RequestManager(); } } +const mapStub = new StubMap(); + function createStyle(styleJSON: StyleSpecification): Promise +
+ + diff --git a/docs/pages/example/mapbox-gl-geocoder-custom-render.js b/docs/pages/example/mapbox-gl-geocoder-custom-render.js new file mode 100644 index 00000000000..f24fdffbab5 --- /dev/null +++ b/docs/pages/example/mapbox-gl-geocoder-custom-render.js @@ -0,0 +1,12 @@ +/*--- +title: Use a custom render function with a geocoder +description: >- + Use a custom html rendering function with the [mapbox-gl-geocoder](https://github.com/mapbox/mapbox-gl-geocoder) + to customize how the dropdown menu is displayed. +tags: + - geocoder +pathname: /mapbox-gl-js/example/mapbox-gl-geocoder-custom-render/ +---*/ +import Example from '../../components/example'; +import html from './mapbox-gl-geocoder-custom-render.html'; +export default Example(html); diff --git a/docs/pages/example/mapbox-gl-geocoder-limit-region.html b/docs/pages/example/mapbox-gl-geocoder-limit-region.html index 19bd879e75e..86809d42ecf 100644 --- a/docs/pages/example/mapbox-gl-geocoder-limit-region.html +++ b/docs/pages/example/mapbox-gl-geocoder-limit-region.html @@ -1,5 +1,5 @@ - - + +
diff --git a/docs/pages/example/mapbox-gl-geocoder-outside-the-map.html b/docs/pages/example/mapbox-gl-geocoder-outside-the-map.html index 419eb35f429..893f2416199 100644 --- a/docs/pages/example/mapbox-gl-geocoder-outside-the-map.html +++ b/docs/pages/example/mapbox-gl-geocoder-outside-the-map.html @@ -1,5 +1,5 @@ - - + +