From dedbc8ef7c8573b13cec50dc23d06280f3d7a055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 4 Oct 2018 20:27:29 +0200 Subject: [PATCH 01/15] v0.50.0-beta.1 --- CHANGELOG.md | 54 +++++++++++++++++++++++++++++++++++++++++++--------- package.json | 2 +- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53997a5e079..59404126c6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,46 @@ +## 0.50.0 +(Release date TBD) + +### ✨ Features and improvements +* 🎉 Add Custom Layers that can be rendered into with user-provided WebGL code ([#7039](https://github.com/mapbox/mapbox-gl-js/pull/7039)) +* Add WebGL face culling for increased performance ([#7178](https://github.com/mapbox/mapbox-gl-js/pull/7178)) +* Improve speed of expression evaluation ([#7334](https://github.com/mapbox/mapbox-gl-js/pull/7334)) +* Automatically coerce to string for `concat` expression and `text-field` property ([#6190](https://github.com/mapbox/mapbox-gl-js/issues/6190), fixed by [#7280](https://github.com/mapbox/mapbox-gl-js/pull/7280)) +* Add `fill-extrusion-vertical-gradient` property for controlling shading of fill extrusions ([#5768](https://github.com/mapbox/mapbox-gl-js/issues/5768), fixed by [#6841](https://github.com/mapbox/mapbox-gl-js/pull/6841)) +* Add update functionality for images provided via `ImageSource` ([#4050](https://github.com/mapbox/mapbox-gl-js/issues/4050), fixed by [#7342](https://github.com/mapbox/mapbox-gl-js/pull/7342)) (h/t [dcervelli](https://github.com/dcervelli)) + + + +### 🐛 Bug fixes +* **Expressions** + * Fix expressions that use `log2` and `log10` in IE11 ([#7318](https://github.com/mapbox/mapbox-gl-js/issues/7318), fixed by [#7320](https://github.com/mapbox/mapbox-gl-js/pull/7320)) + * Fix `let` expression stripping expected type during parsing ([#7300](https://github.com/mapbox/mapbox-gl-js/issues/7300), fixed by [#7301](https://github.com/mapbox/mapbox-gl-js/pull/7301)) + * Fix superfluous wrapping of literals in `literal` expression ([#7336](https://github.com/mapbox/mapbox-gl-js/issues/7336), fixed by [#7337](https://github.com/mapbox/mapbox-gl-js/pull/7337)) + * Allow calling `to-color` on values that are already of type `Color` ([#7260](https://github.com/mapbox/mapbox-gl-js/pull/7260)) + * Fix `to-array` for empty arrays (([#7261](https://github.com/mapbox/mapbox-gl-js/pull/7261))) + * Fix identity functions for `text-field` when using formatted text ([#7351](https://github.com/mapbox/mapbox-gl-js/pull/7351)) + * Fix coercion of `null` to `0` in `to-number` expression ([#7083](https://github.com/mapbox/mapbox-gl-js/issues/7083), fixed by [#7274](https://github.com/mapbox/mapbox-gl-js/pull/7274)) +* **Canvas source** + * Fix missing repeats of `CanvasSource` when it crosses the antimeridian ([#7273](https://github.com/mapbox/mapbox-gl-js/pull/7273)) + * Fix `CanvasSource` not respecting alpha values set on `canvas` element ([#7302](https://github.com/mapbox/mapbox-gl-js/issues/7302), fixed by [#7309](https://github.com/mapbox/mapbox-gl-js/pull/7309)) +* **Rendering** + * Fix rendering of fill extrusions with really high heights ([#7292](https://github.com/mapbox/mapbox-gl-js/pull/7292)) + * Fix reloading of empty tiles ([#7355](https://github.com/mapbox/mapbox-gl-js/pull/7355)) + * Fix errors when rendering symbol layers without symbols ([#7241](https://github.com/mapbox/mapbox-gl-js/issues/7241), fixed by [#7253](https://github.com/mapbox/mapbox-gl-js/pull/7253)) + * Don't fade in symbols with `*-allow-overlap: true` when panning into the viewport ([#7172](https://github.com/mapbox/mapbox-gl-js/issues/7172), fixed by[#7244](https://github.com/mapbox/mapbox-gl-js/pull/7244)) +* **Library** + * Fix disambiguation for `mouseover` event ([#7295](https://github.com/mapbox/mapbox-gl-js/issues/7295), fixed by [#7299](https://github.com/mapbox/mapbox-gl-js/pull/7299)) + * Fix silent failure of `getImage` if an SVG is requested ([#7312](https://github.com/mapbox/mapbox-gl-js/issues/7312), fixed by [#7313](https://github.com/mapbox/mapbox-gl-js/pull/7313)) + * Fix empty control group box shadow ([#7303](https://github.com/mapbox/mapbox-gl-js/issues/7303), fixed by [#7304](https://github.com/mapbox/mapbox-gl-js/pull/7304)) (h/t [Duder-onomy](https://github.com/Duder-onomy)) + + ## 0.49.0 September 6, 2018 -## ⚠️ Breaking changes +### ⚠️ Breaking changes * Use `client{Height/Width}` instead of `offset{Height/Width}` for map canvas sizing ([#6848](https://github.com/mapbox/mapbox-gl-js/issues/6848), fixed by [#7128](https://github.com/mapbox/mapbox-gl-js/pull/7128)) -## 🐛 Bug fixes +### 🐛 Bug fixes * Fix [Top Issues list](https://mapbox.github.io/top-issues/#!mapbox/mapbox-gl-js) for mapbox-gl-js ([#7108](https://github.com/mapbox/mapbox-gl-js/issues/7108), fixed by [#7112](https://github.com/mapbox/mapbox-gl-js/pull/7112)) * Fix bug in which symbols with `icon-allow-overlap: true, text-allow-overlap: true, text-optional: false` would show icons when they shouldn't ([#7041](https://github.com/mapbox/mapbox-gl-js/pull/7041)) * Fix bug where the map would not stop at the exact zoom level requested by Map#FlyTo (#7222) ([#7223](https://github.com/mapbox/mapbox-gl-js/pull/7223)) (h/t [benoitbzl](https://github.com/benoitbzl)) @@ -14,8 +50,8 @@ September 6, 2018 * Fix bug in the way AJAX requests load local files on iOS web view ([#6610](https://github.com/mapbox/mapbox-gl-js/pull/6610)) (h/t [oscarfonts](https://github.com/oscarfonts)) * Fix bug in which canvas sources would not render in world wrapped tiles at the edge of the viewport ([#7271]https://github.com/mapbox/mapbox-gl-js/issues/7271), fixed by [#7273](https://github.com/mapbox/mapbox-gl-js/pull/7273)) -## ✨ Features and improvements -Performance updates: +### ✨ Features and improvements +* Performance updates: * Improve time to first render by updating how feature ID maps are transferred to the main thread ([#7110](https://github.com/mapbox/mapbox-gl-js/issues/7110), fixed by [#7132](https://github.com/mapbox/mapbox-gl-js/pull/7132)) * Reduce size of JSON transmitted from worker thread to main thread ([#7124](https://github.com/mapbox/mapbox-gl-js/pull/7124)) * Improve image/glyph atlas packing algorithm ([#7171](https://github.com/mapbox/mapbox-gl-js/pull/7171)) @@ -31,10 +67,10 @@ Performance updates: ## 0.48.0 August 16, 2018 -## ⚠️ Breaking changes +### ⚠️ Breaking changes * Treat tiles that error with status 404 as empty renderable tiles to prevent rendering duplicate features in some sparse tilesets ([#6803](https://github.com/mapbox/mapbox-gl-js/pull/6803)) -## 🐛 Bug fixes +### 🐛 Bug fixes * Fix issue where `text-max-angle` property was being calculated incorrectly internally, causing potential rendering errors when `"text-placement": line` * Require `feature.id` when using `Map#setFeatureState` ([#6974](https://github.com/mapbox/mapbox-gl-js/pull/6974)) * Fix issue with removing the `GeolocateControl` when user location is being used ([#6977](https://github.com/mapbox/mapbox-gl-js/pull/6977)) (h/t [sergei-zelinsky](https://github.com/sergei-zelinsky)) @@ -45,7 +81,7 @@ August 16, 2018 * Relax typing for equality and order expressions ([#6459](https://github.com/mapbox/mapbox-gl-js/issues/6459), fixed by [#6961](https://api.github.com/repos/mapbox/mapbox-gl-js/pulls/6961)) * Fix bug where `queryPadding` for all layers in a source was set by the first layer, causing incorrect querying on other layers and, in some cases, incorrect firing of events associated with individual layers ([#6909](https://github.com/mapbox/mapbox-gl-js/pull/6909)) -## ✨ Features and improvements +### ✨ Features and improvements * Performance Improvements: * Stop unnecessary serialization of symbol source features. ([#7013](https://github.com/mapbox/mapbox-gl-js/pull/7013)) @@ -62,7 +98,7 @@ August 16, 2018 ## 0.47.0 -## ✨ Features and improvements +### ✨ Features and improvements * Add configurable drag pan threshold ([#6809](https://github.com/mapbox/mapbox-gl-js/pull/6809)) (h/t [msbarry](https://github.com/msbarry)) * Add `raster-resampling` raster paint property ([#6411](https://github.com/mapbox/mapbox-gl-js/pull/6411)) (h/t [andrewharvey](https://github.com/andrewharvey)) * Add `symbol-placement: line-center` ([#6821](https://github.com/mapbox/mapbox-gl-js/pull/6821)) @@ -71,7 +107,7 @@ August 16, 2018 * Upgrade geojson-vt to 3.1.4 ([#6942](https://github.com/mapbox/mapbox-gl-js/pull/6942)) * Include link to license in compiled bundle ([#6975](https://github.com/mapbox/mapbox-gl-js/pull/6975)) -## 🐛 Bug fixes +### 🐛 Bug fixes * Use updateData instead of re-creating buffers for repopulated paint arrays ([#6853](https://github.com/mapbox/mapbox-gl-js/pull/6853)) * Fix ScrollZoom handler setting tr.zoom = NaN ([#6924](https://github.com/mapbox/mapbox-gl-js/pull/6924)) - Failed to invert matrix error ([#6486](https://github.com/mapbox/mapbox-gl-js/issues/6486), fixed by [#6924](https://github.com/mapbox/mapbox-gl-js/pull/6924)) diff --git a/package.json b/package.json index ad343c6b360..f2002e2e9e7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mapbox-gl", "description": "A WebGL interactive maps library", - "version": "0.49.0", + "version": "0.50.0-beta.1", "main": "dist/mapbox-gl.js", "style": "dist/mapbox-gl.css", "license": "SEE LICENSE IN LICENSE.txt", From f3989eb35075a8d1d244cf97d5766d2ef3ded721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 5 Oct 2018 08:24:54 +0200 Subject: [PATCH 02/15] changelog fixes for 0.50-beta.1 --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59404126c6a..73dd0ad062c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.50.0 +## 0.50.0-beta.1 (Release date TBD) ### ✨ Features and improvements @@ -25,7 +25,7 @@ * Fix `CanvasSource` not respecting alpha values set on `canvas` element ([#7302](https://github.com/mapbox/mapbox-gl-js/issues/7302), fixed by [#7309](https://github.com/mapbox/mapbox-gl-js/pull/7309)) * **Rendering** * Fix rendering of fill extrusions with really high heights ([#7292](https://github.com/mapbox/mapbox-gl-js/pull/7292)) - * Fix reloading of empty tiles ([#7355](https://github.com/mapbox/mapbox-gl-js/pull/7355)) + * Fix an error where the map state wouldn't return to `loaded` after certain runtime styling changes when there were errored tiles in the viewport ([#7355](https://github.com/mapbox/mapbox-gl-js/pull/7355)) * Fix errors when rendering symbol layers without symbols ([#7241](https://github.com/mapbox/mapbox-gl-js/issues/7241), fixed by [#7253](https://github.com/mapbox/mapbox-gl-js/pull/7253)) * Don't fade in symbols with `*-allow-overlap: true` when panning into the viewport ([#7172](https://github.com/mapbox/mapbox-gl-js/issues/7172), fixed by[#7244](https://github.com/mapbox/mapbox-gl-js/pull/7244)) * **Library** From 067e30eeadb3a6e31e4d7027347fa642552bccfd Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 4 Oct 2018 15:39:31 -0400 Subject: [PATCH 03/15] fix custom layers example in safari It was relying on the ability of some browsers to render without any buffers or attributes. I guess that isn't allowed by the spec. The expands the example to use attributes and buffers, which is probably better anyways. --- docs/pages/example/.eslintrc | 3 ++- docs/pages/example/custom-style-layer.html | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/pages/example/.eslintrc b/docs/pages/example/.eslintrc index ebf0cf4b759..06f7379d50e 100644 --- a/docs/pages/example/.eslintrc +++ b/docs/pages/example/.eslintrc @@ -13,7 +13,8 @@ "MapboxDirections": true, "turf": true, "d3": true, - "Uint8Array": true + "Uint8Array": true, + "Float32Array": true }, "rules": { "flowtype/require-valid-file-annotation": [0], diff --git a/docs/pages/example/custom-style-layer.html b/docs/pages/example/custom-style-layer.html index 7c3aa53b87b..a9887a8407f 100644 --- a/docs/pages/example/custom-style-layer.html +++ b/docs/pages/example/custom-style-layer.html @@ -16,8 +16,9 @@ onAdd: function (map, gl) { var vertexSource = "" + "uniform mat4 u_matrix;" + + "attribute vec2 a_pos;" + "void main() {" + - " gl_Position = u_matrix * vec4(0.5, 0.5, 0.0, 1.0);" + + " gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);" + " gl_PointSize = 100.0;" + "}"; @@ -37,11 +38,20 @@ gl.attachShader(this.program, vertexShader); gl.attachShader(this.program, fragmentShader); gl.linkProgram(this.program); + + this.aPos = gl.getAttribLocation(this.program, "a_pos"); + + this.buffer = gl.createBuffer(); + gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.5, 0.5]), gl.STATIC_DRAW); }, render: function(gl, matrix) { gl.useProgram(this.program); gl.uniformMatrix4fv(gl.getUniformLocation(this.program, "u_matrix"), false, matrix); + gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); + gl.enableVertexAttribArray(this.aPos); + gl.vertexAttribPointer(this.aPos, 2, gl.FLOAT, false, 0, 0); gl.drawArrays(gl.POINTS, 0, 1); } }; From bedc9e96cc409728f87e883b2a58ef189c1f6e71 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Sun, 7 Oct 2018 00:16:22 +1000 Subject: [PATCH 04/15] add 3rd party plugin mapbox-gl-controls to index (#7349) --- docs/pages/plugins.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/pages/plugins.js b/docs/pages/plugins.js index b299d26d73e..b3655a5ab5b 100644 --- a/docs/pages/plugins.js +++ b/docs/pages/plugins.js @@ -46,6 +46,10 @@ const plugins = { "mapboxgl-minimap": { "website": "https://github.com/aesqe/mapboxgl-minimap", "description": "adds a control showing a miniature overview of the current map" + }, + "mapbox-gl-controls": { + "website": "https://github.com/bravecow/mapbox-gl-controls", + "description": "alternative basic map controls" } }, "Map Rendering Plugins": { From 56487f0e49b6222437753307609325f0ba1842ab Mon Sep 17 00:00:00 2001 From: Molly Lloyd Date: Tue, 9 Oct 2018 16:52:48 -0700 Subject: [PATCH 05/15] send correct timestamp with turnstile event (#7381) * send correct timestamp with turnstile event * update TurnstileEvent tests --- src/util/mapbox.js | 2 +- test/unit/util/mapbox.test.js | 38 +++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/util/mapbox.js b/src/util/mapbox.js index bad2e266269..21438d82c8f 100644 --- a/src/util/mapbox.js +++ b/src/util/mapbox.js @@ -147,7 +147,7 @@ export class TurnstileEvent { if (config.ACCESS_TOKEN && Array.isArray(tileUrls) && tileUrls.some((url) => { return /(mapbox\.c)(n|om)/i.test(url); })) { - this.queueRequest(browser.now()); + this.queueRequest(Date.now()); } } diff --git a/test/unit/util/mapbox.test.js b/test/unit/util/mapbox.test.js index 52876d81b97..46f78002662 100644 --- a/test/unit/util/mapbox.test.js +++ b/test/unit/util/mapbox.test.js @@ -359,9 +359,9 @@ test("mapbox", (t) => { lastSuccess: now })); - t.stub(browser, 'now').callsFake(() => now + 5); // A bit later - + const dateNow = t.stub(Date, 'now').callsFake(() => now + 5); // A bit later event.postTurnstileEvent(['a.tiles.mapbox.com']); + dateNow.restore(); t.false(window.server.requests.length); t.end(); @@ -375,9 +375,9 @@ test("mapbox", (t) => { lastSuccess: now })); - t.stub(browser, 'now').callsFake(() => now + ms25Hours); // next day - + const dateNow = t.stub(Date, 'now').callsFake(() => now + ms25Hours); event.postTurnstileEvent(['a.tiles.mapbox.com']); + dateNow.restore(); const req = window.server.requests[0]; req.respond(200); @@ -395,8 +395,6 @@ test("mapbox", (t) => { lastSuccess: now + ms25Hours // 24-hours later })); - t.stub(browser, 'now').callsFake(() => now); // Past relative ot lastSuccess - event.postTurnstileEvent(['a.tiles.mapbox.com']); const req = window.server.requests[0]; @@ -409,13 +407,14 @@ test("mapbox", (t) => { t.test('does not POST appuserTurnstile event second time within same calendar day', (t) => { let now = +Date.now(); - t.stub(browser, 'now').callsFake(() => now); event.postTurnstileEvent(['a.tiles.mapbox.com']); //Post second event const firstEvent = now; now += (60 * 1000); // A bit later + const dateNow = t.stub(Date, 'now').callsFake(() => now); event.postTurnstileEvent(['a.tiles.mapbox.com']); + dateNow.restore(); const req = window.server.requests[0]; req.respond(200); @@ -430,13 +429,14 @@ test("mapbox", (t) => { t.test('does not POST appuserTurnstile event second time when clock goes backwards less than a day', (t) => { let now = +Date.now(); - t.stub(browser, 'now').callsFake(() => now); event.postTurnstileEvent(['a.tiles.mapbox.com']); //Post second event const firstEvent = now; now -= (60 * 1000); // A bit earlier + const dateNow = t.stub(Date, 'now').callsFake(() => now); event.postTurnstileEvent(['a.tiles.mapbox.com']); + dateNow.restore(); const req = window.server.requests[0]; req.respond(200); @@ -485,12 +485,13 @@ test("mapbox", (t) => { t.test('does not POST appuserTurnstile event second time within same calendar day', (t) => { let now = +Date.now(); const firstEvent = now; - t.stub(browser, 'now').callsFake(() => now); event.postTurnstileEvent(['a.tiles.mapbox.com']); //Post second event now += (60 * 1000); // A bit later + const dateNow = t.stub(Date, 'now').callsFake(() => now); event.postTurnstileEvent(['a.tiles.mapbox.com']); + dateNow.restore(); const req = window.server.requests[0]; req.respond(200); @@ -506,12 +507,13 @@ test("mapbox", (t) => { t.test('does not POST appuserTurnstile event second time when clock goes backwards less than a day', (t) => { let now = +Date.now(); const firstEvent = now; - t.stub(browser, 'now').callsFake(() => now); event.postTurnstileEvent(['a.tiles.mapbox.com']); //Post second event now -= (60 * 1000); // A bit earlier + const dateNow = t.stub(Date, 'now').callsFake(() => now); event.postTurnstileEvent(['a.tiles.mapbox.com']); + dateNow.restore(); const req = window.server.requests[0]; req.respond(200); @@ -543,14 +545,13 @@ test("mapbox", (t) => { }); t.test('POSTs appUserTurnstile event on next calendar day', (t) => { - let now = +Date.now(); - t.stub(browser, 'now').callsFake(() => now); - + const now = +Date.now(); event.postTurnstileEvent(['a.tiles.mapbox.com']); - - now += ms25Hours; // Add a day - const tomorrow = now; + // Add a day + const tomorrow = now + ms25Hours; + const dateNow = t.stub(Date, 'now').callsFake(() => tomorrow); event.postTurnstileEvent(['a.tiles.mapbox.com']); + dateNow.restore(); let req = window.server.requests[0]; req.respond(200); @@ -570,18 +571,21 @@ test("mapbox", (t) => { t.test('Queues and POSTs appuserTurnstile events when triggerred in quick succession', (t) => { let now = Date.now(); - t.stub(browser, 'now').callsFake(() => now); const today = now; event.postTurnstileEvent(['a.tiles.mapbox.com']); const laterToday = now + 1; + let dateNow = t.stub(Date, 'now').callsFake(() => laterToday); now = laterToday; event.postTurnstileEvent(['b.tiles.mapbox.com']); + dateNow.restore(); const tomorrow = laterToday + ms25Hours; // Add a day now = tomorrow; + dateNow = t.stub(Date, 'now').callsFake(() => tomorrow); event.postTurnstileEvent(['c.tiles.mapbox.com']); + dateNow.restore(); const reqToday = window.server.requests[0]; reqToday.respond(200); From 6a6f2dd92ae5e84e5c8cf73860464226e07704e7 Mon Sep 17 00:00:00 2001 From: ryanhamley Date: Tue, 9 Oct 2018 14:33:57 -0700 Subject: [PATCH 06/15] Show compact attribution on IE11 --- src/css/mapbox-gl.css | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/css/mapbox-gl.css b/src/css/mapbox-gl.css index 98dbd96017f..03d57dd22cd 100644 --- a/src/css/mapbox-gl.css +++ b/src/css/mapbox-gl.css @@ -217,20 +217,25 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact { @media screen { .mapboxgl-ctrl-attrib.mapboxgl-compact { - padding-top: 2px; - padding-bottom: 2px; margin: 0 10px 10px; position: relative; - padding-right: 24px; background-color: #fff; border-radius: 3px 12px 12px 3px; - visibility: hidden; } .mapboxgl-ctrl-attrib.mapboxgl-compact:hover { + padding: 2px 24px 2px 4px; visibility: visible; } + .mapboxgl-ctrl-attrib.mapboxgl-compact > a { + display: none; + } + + .mapboxgl-ctrl-attrib.mapboxgl-compact:hover > a { + display: inline; + } + .mapboxgl-ctrl-attrib.mapboxgl-compact::after { content: ''; cursor: pointer; @@ -242,7 +247,6 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact { width: 24px; height: 24px; box-sizing: border-box; - visibility: visible; border-radius: 12px; } } From 02eec20e3ca6010263baf64c5832e40cc4498222 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 11 Oct 2018 19:25:16 -0400 Subject: [PATCH 07/15] avoid SecurityError in IE for custom layers example --- docs/pages/example/custom-style-layer.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/pages/example/custom-style-layer.html b/docs/pages/example/custom-style-layer.html index a9887a8407f..605575b25de 100644 --- a/docs/pages/example/custom-style-layer.html +++ b/docs/pages/example/custom-style-layer.html @@ -4,8 +4,7 @@ container: 'map', zoom: 4, center: [0, 0], - style: 'mapbox://styles/mapbox/light-v9', - hash: true + style: 'mapbox://styles/mapbox/light-v9' }); From ab8d51bce869938bdc7cf35cb25933974c29e6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 12 Oct 2018 13:32:42 +0300 Subject: [PATCH 08/15] don't use gl_PointSize, since it sometimes crashes in Edge --- docs/pages/example/custom-style-layer.html | 22 ++++++++++++++-------- docs/pages/example/custom-style-layer.js | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/pages/example/custom-style-layer.html b/docs/pages/example/custom-style-layer.html index 605575b25de..3cbc1ddc796 100644 --- a/docs/pages/example/custom-style-layer.html +++ b/docs/pages/example/custom-style-layer.html @@ -8,8 +8,8 @@ }); -var nullIslandLayer = { - id: 'null-island', +var highlightLayer = { + id: 'highlight', type: 'custom', onAdd: function (map, gl) { @@ -17,13 +17,12 @@ "uniform mat4 u_matrix;" + "attribute vec2 a_pos;" + "void main() {" + - " gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);" + - " gl_PointSize = 100.0;" + + " gl_Position = vec4(a_pos, 0.0, 1.0);" + "}"; var fragmentSource = "" + "void main() {" + - " gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);" + + " gl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);" + "}"; var vertexShader = gl.createShader(gl.VERTEX_SHADER); @@ -42,7 +41,12 @@ this.buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.5, 0.5]), gl.STATIC_DRAW); + gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ + -0.5, -0.5, + -0.5, 0.5, + 0.5, -0.5, + 0.5, 0.5 + ]), gl.STATIC_DRAW); }, render: function(gl, matrix) { @@ -51,11 +55,13 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); gl.enableVertexAttribArray(this.aPos); gl.vertexAttribPointer(this.aPos, 2, gl.FLOAT, false, 0, 0); - gl.drawArrays(gl.POINTS, 0, 1); + gl.enable(gl.BLEND); + gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); + gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); } }; map.on('load', function() { - map.addLayer(nullIslandLayer); + map.addLayer(highlightLayer, 'waterway-river-canal'); }); diff --git a/docs/pages/example/custom-style-layer.js b/docs/pages/example/custom-style-layer.js index a179f65b45c..6ba756f6419 100644 --- a/docs/pages/example/custom-style-layer.js +++ b/docs/pages/example/custom-style-layer.js @@ -1,6 +1,6 @@ /*--- title: Add a custom style layer -description: Use a custom style layer to add custom gl rendering. +description: Use a custom style layer to render custom WebGL content. tags: - layers pathname: /mapbox-gl-js/example/custom-style-layer/ From 025a50c711cd74d1e0dd9cec3436a9d93745de65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Wed, 10 Oct 2018 16:39:51 +0300 Subject: [PATCH 09/15] release v0.50.0 --- CHANGELOG.md | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73dd0ad062c..6f45e9ca346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -## 0.50.0-beta.1 -(Release date TBD) +## 0.50.0 +October 10, 2018 ### ✨ Features and improvements * 🎉 Add Custom Layers that can be rendered into with user-provided WebGL code ([#7039](https://github.com/mapbox/mapbox-gl-js/pull/7039)) @@ -32,6 +32,8 @@ * Fix disambiguation for `mouseover` event ([#7295](https://github.com/mapbox/mapbox-gl-js/issues/7295), fixed by [#7299](https://github.com/mapbox/mapbox-gl-js/pull/7299)) * Fix silent failure of `getImage` if an SVG is requested ([#7312](https://github.com/mapbox/mapbox-gl-js/issues/7312), fixed by [#7313](https://github.com/mapbox/mapbox-gl-js/pull/7313)) * Fix empty control group box shadow ([#7303](https://github.com/mapbox/mapbox-gl-js/issues/7303), fixed by [#7304](https://github.com/mapbox/mapbox-gl-js/pull/7304)) (h/t [Duder-onomy](https://github.com/Duder-onomy)) + * Fixed an issue where a wrong timestamp was sent for Mapbox turnstile events ([#7381](https://github.com/mapbox/mapbox-gl-js/pull/7381)) + * Fixed a bug that lead to attribution not showing up correctly in Internet Explorer ([#3945](https://github.com/mapbox/mapbox-gl-js/issues/3945), fixed by [#7391](https://github.com/mapbox/mapbox-gl-js/pull/7391)) ## 0.49.0 diff --git a/package.json b/package.json index f2002e2e9e7..a336154b54a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mapbox-gl", "description": "A WebGL interactive maps library", - "version": "0.50.0-beta.1", + "version": "0.50.0", "main": "dist/mapbox-gl.js", "style": "dist/mapbox-gl.css", "license": "SEE LICENSE IN LICENSE.txt", From 441362b7f2335d600770077d4c6019f0aff331f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 12 Oct 2018 14:19:04 +0300 Subject: [PATCH 10/15] release style-spec v13.3.0 --- src/style-spec/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/style-spec/package.json b/src/style-spec/package.json index 4616ff6bb91..6fb6a545b63 100644 --- a/src/style-spec/package.json +++ b/src/style-spec/package.json @@ -1,7 +1,7 @@ { "name": "@mapbox/mapbox-gl-style-spec", "description": "a specification for mapbox gl styles", - "version": "13.2.0", + "version": "13.3.0", "author": "Mapbox", "keywords": [ "mapbox", From 35b43c7bfec1ef2f651f626825e9920eafa00c7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Tue, 16 Oct 2018 08:48:06 +0200 Subject: [PATCH 11/15] add RTL plugin to rich text label example --- docs/pages/example/display-and-style-rich-text-labels.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pages/example/display-and-style-rich-text-labels.html b/docs/pages/example/display-and-style-rich-text-labels.html index f172c106abb..c2b8a32953b 100644 --- a/docs/pages/example/display-and-style-rich-text-labels.html +++ b/docs/pages/example/display-and-style-rich-text-labels.html @@ -1,5 +1,7 @@