-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into docs-touch-pitch
* main: Add touch pan blocker to gesture handling for touch devices (#11116) Address accessibility issues (#11064) add support for non-mercator projections (#11124) Image fallback expressions within paint properties (#11049) Replaces EPSG:4326 with OGC:CRS84 in GL JS `LngLat` doc (#11072) Add globe view support to heatmap shaders (#11120) Exclude flaky test (#11118) consistify YOUR_MAPBOX_ACCESS_TOKEN as placeholder string (#11113) Allow adding multiple layers to `map.on()` event handler (h/t @omerbn) (#11114) render-test-flakiness:clear worker storage (#11111) upgrade to supercluster v7.1.4, earcut v2.2.3, vt-pbf v3.1.3, geojson-rewind v0.5.1 (#11110) Added v1.13.2 changelog entry (#11108) One weird JSON.parse() trick (#11098) Fixed doc usage of map.getCenter (#11093) s̶y̶m̶b̶o̶l̶-̶c̶l̶i̶p̶ dynamic-filtering with `pitch` and `distance-from-camera` expressions (#10795) Update link to transpiling guide (#11096) Cherry pick 2.5.1 changelog (#11099) Fix an iOS15 issue where Safari tab bar interrupts panning (#11084) Fix conditional check for isFullscreen to accommodate Safari (#11086) Render tests for #11041 (#11070)
- Loading branch information
Showing
239 changed files
with
12,986 additions
and
702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: 2.1 | ||
orbs: | ||
aws-cli: circleci/[email protected] | ||
browser-tools: circleci/browser-tools@1.1.1 | ||
browser-tools: circleci/browser-tools@1.2.3 | ||
|
||
workflows: | ||
version: 2 | ||
|
@@ -245,8 +245,7 @@ jobs: | |
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- browser-tools/install-chrome: | ||
chrome-version: 91.0.4472.164 | ||
- browser-tools/install-chrome | ||
- run: yarn run test-render | ||
- store_test_results: | ||
path: test/integration/render-tests | ||
|
@@ -258,8 +257,7 @@ jobs: | |
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- browser-tools/install-chrome: | ||
chrome-version: 91.0.4472.164 | ||
- browser-tools/install-chrome | ||
- run: yarn run test-render-prod | ||
- store_test_results: | ||
path: test/integration/render-tests | ||
|
@@ -271,8 +269,7 @@ jobs: | |
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- browser-tools/install-chrome: | ||
chrome-version: 91.0.4472.164 | ||
- browser-tools/install-chrome | ||
- run: yarn run test-query | ||
- store_test_results: | ||
path: test/integration/query-tests | ||
|
@@ -299,8 +296,7 @@ jobs: | |
steps: | ||
- attach_workspace: | ||
at: ~/ | ||
- browser-tools/install-chrome: | ||
chrome-version: 91.0.4472.164 | ||
- browser-tools/install-chrome | ||
- run: | ||
name: Collect performance stats | ||
command: node bench/gl-stats.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Mapbox GL JS debug page</title> | ||
<meta charset='utf-8'> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | ||
<script src="https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/gl-matrix-min.js"></script> | ||
<link rel='stylesheet' href='../dist/mapbox-gl.css' /> | ||
<style> | ||
body { margin: 0; padding: 0; } | ||
html, body, #map { height: 100%; } | ||
#tooltip { | ||
position: absolute; | ||
left: 0px; | ||
top: 0px; | ||
background-color: white; | ||
z-index: 5; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div id='map'> | ||
<div id='tooltip'></div> | ||
</div> | ||
|
||
<script src='../dist/mapbox-gl-dev.js'></script> | ||
<script src='../debug/access_token_generated.js'></script> | ||
<script> | ||
|
||
/*global glMatrix, turf*/ | ||
|
||
var map = window.map = new mapboxgl.Map({ | ||
container: 'map', | ||
zoom: 10.852, | ||
center: [-120.30344797631889, 38.11726797649675], | ||
style: 'mapbox://styles/mapbox/streets-v11', | ||
// hash: true | ||
}); | ||
|
||
function calcMercatorDistanceMatrix() { | ||
const center = map.transform.point; | ||
|
||
const m = new Float64Array(16); | ||
const worldSize = map.transform.worldSize; | ||
const windowScaleFactor = 1 / map.transform.height; | ||
glMatrix.mat4.fromScaling(m, [windowScaleFactor, -windowScaleFactor, windowScaleFactor]); | ||
glMatrix.mat4.rotateZ(m, m, map.transform.angle); | ||
glMatrix.mat4.translate(m, m, [-center.x, -center.y, 0]); | ||
|
||
return glMatrix.mat4.scale([], m, [worldSize, worldSize, 1]); | ||
} | ||
|
||
function generateDistanceScales() { | ||
const center = map.getCenter(); | ||
const bearing = map.getBearing(); | ||
const numSteps = 10; | ||
const step = 0.25; | ||
|
||
const matrix = glMatrix.mat4.invert([], calcMercatorDistanceMatrix()); | ||
const lines = []; | ||
for (let i = -numSteps; i <= numSteps; i++) { | ||
const distance = step * i; | ||
const v0 = [-2, distance, 0]; | ||
const v1 = [0, distance, 0]; | ||
const v2 = [2, distance, 0]; | ||
const p0 = new mapboxgl.MercatorCoordinate(...glMatrix.vec3.transformMat4([], v0, matrix)).toLngLat(); | ||
const p1 = new mapboxgl.MercatorCoordinate(...glMatrix.vec3.transformMat4([], v1, matrix)).toLngLat(); | ||
const p2 = new mapboxgl.MercatorCoordinate(...glMatrix.vec3.transformMat4([], v2, matrix)).toLngLat(); | ||
const line = turf.lineString([[p0.lng, p0.lat], [p1.lng, p1.lat], [p2.lng, p2.lat]], {distance: `${distance.toFixed(2)}`}); | ||
lines.push(line); | ||
} | ||
|
||
return turf.featureCollection(lines); | ||
} | ||
|
||
const tooltip = document.getElementById('tooltip'); | ||
map.on('mousemove', (e) => { | ||
const loc = map.unproject(e.point); | ||
const m = calcMercatorDistanceMatrix(); | ||
const {x, y, z} = mapboxgl.MercatorCoordinate.fromLngLat(loc); | ||
const v = glMatrix.vec3.transformMat4([], [x, y, z], m); | ||
|
||
const dist = v[1]; | ||
tooltip.innerText = dist.toFixed(2); | ||
tooltip.style.transform = `translate(${e.point.x + 10}px,${e.point.y + 10}px)`; | ||
}); | ||
|
||
map.once('load', () => { | ||
map.setFilter('building-number-label', | ||
["case", | ||
["<", ["pitch"], 60], true, | ||
["all", [">=", ["pitch"], 60], ["<", ["distance-from-center"], 0]], true, | ||
false | ||
] | ||
); | ||
|
||
map.addSource('rings', { | ||
type: 'geojson', | ||
data: { | ||
"type": "FeatureCollection", | ||
"features": [] | ||
} | ||
}); | ||
|
||
map.addLayer({ | ||
type: 'line', | ||
id: 'rings-layer', | ||
source: 'rings', | ||
paint: { | ||
"line-width": 10 | ||
} | ||
}); | ||
|
||
map.addLayer({ | ||
type: 'symbol', | ||
id: 'rings-labels', | ||
source: 'rings', | ||
layout: { | ||
"symbol-placement": 'line', | ||
"text-field": ["get", "distance"], | ||
"text-pitch-alignment": "viewport", | ||
"text-allow-overlap": true | ||
}, | ||
paint: { | ||
"text-color": 'red', | ||
"text-halo-color": 'white', | ||
"text-halo-width": 2 | ||
} | ||
}); | ||
|
||
map.on('idle', () => { | ||
const scale = generateDistanceScales(); | ||
map.getSource('rings').setData(scale); | ||
}); | ||
|
||
}); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.