maplibre-gl 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/build/generate-shaders.ts +39 -6
- package/build/readme.md +0 -5
- package/dist/maplibre-gl-csp-worker.js +1 -1
- package/dist/maplibre-gl-csp-worker.js.map +1 -1
- package/dist/maplibre-gl-csp.js +1 -1
- package/dist/maplibre-gl-csp.js.map +1 -1
- package/dist/maplibre-gl-dev.js +176 -127
- package/dist/maplibre-gl-dev.js.map +1 -1
- package/dist/maplibre-gl.d.ts +48 -42
- package/dist/maplibre-gl.js +4 -4
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +34 -33
- package/src/geo/lng_lat.ts +2 -2
- package/src/gl/context.ts +27 -9
- package/src/gl/types.ts +14 -14
- package/src/gl/value.ts +11 -3
- package/src/gl/vertex_buffer.ts +2 -2
- package/src/gl/webgl2.ts +12 -0
- package/src/index.ts +0 -17
- package/src/render/draw_heatmap.ts +1 -0
- package/src/render/painter.ts +1 -1
- package/src/render/program.ts +3 -2
- package/src/render/texture.ts +4 -4
- package/src/render/uniform_binding.ts +1 -1
- package/src/shaders/README.md +4 -4
- package/src/shaders/_prelude.fragment.glsl +2 -0
- package/src/shaders/_prelude.fragment.glsl.g.ts +1 -1
- package/src/shaders/_prelude.vertex.glsl +3 -3
- package/src/shaders/background.fragment.glsl +2 -2
- package/src/shaders/background.vertex.glsl +1 -1
- package/src/shaders/background_pattern.fragment.glsl +6 -6
- package/src/shaders/background_pattern.vertex.glsl +3 -4
- package/src/shaders/circle.fragment.glsl +5 -9
- package/src/shaders/circle.vertex.glsl +3 -3
- package/src/shaders/clipping_mask.fragment.glsl +1 -1
- package/src/shaders/clipping_mask.vertex.glsl +1 -1
- package/src/shaders/collision_box.fragment.glsl +5 -6
- package/src/shaders/collision_box.vertex.glsl +7 -7
- package/src/shaders/collision_circle.fragment.glsl +5 -5
- package/src/shaders/collision_circle.vertex.glsl +7 -7
- package/src/shaders/debug.fragment.glsl +3 -3
- package/src/shaders/debug.vertex.glsl +2 -2
- package/src/shaders/fill.fragment.glsl +2 -2
- package/src/shaders/fill.vertex.glsl +1 -1
- package/src/shaders/fill_extrusion.fragment.glsl +3 -3
- package/src/shaders/fill_extrusion.vertex.glsl +4 -4
- package/src/shaders/fill_extrusion_pattern.fragment.glsl +9 -7
- package/src/shaders/fill_extrusion_pattern.vertex.glsl +6 -6
- package/src/shaders/fill_outline.fragment.glsl +3 -3
- package/src/shaders/fill_outline.vertex.glsl +2 -2
- package/src/shaders/fill_outline_pattern.fragment.glsl +7 -7
- package/src/shaders/fill_outline_pattern.vertex.glsl +4 -4
- package/src/shaders/fill_pattern.fragment.glsl +6 -6
- package/src/shaders/fill_pattern.vertex.glsl +3 -3
- package/src/shaders/heatmap.fragment.glsl +3 -3
- package/src/shaders/heatmap.vertex.glsl +4 -4
- package/src/shaders/heatmap_texture.fragment.glsl +6 -5
- package/src/shaders/heatmap_texture.vertex.glsl +2 -2
- package/src/shaders/hillshade.fragment.glsl +4 -4
- package/src/shaders/hillshade.vertex.glsl +3 -3
- package/src/shaders/hillshade_prepare.fragment.glsl +6 -4
- package/src/shaders/hillshade_prepare.vertex.glsl +3 -3
- package/src/shaders/line.fragment.glsl +5 -5
- package/src/shaders/line.vertex.glsl +6 -6
- package/src/shaders/line_gradient.fragment.glsl +7 -7
- package/src/shaders/line_gradient.vertex.glsl +8 -8
- package/src/shaders/line_pattern.fragment.glsl +8 -8
- package/src/shaders/line_pattern.vertex.glsl +7 -7
- package/src/shaders/line_sdf.fragment.glsl +9 -9
- package/src/shaders/line_sdf.vertex.glsl +7 -7
- package/src/shaders/raster.fragment.glsl +7 -6
- package/src/shaders/raster.vertex.glsl +4 -4
- package/src/shaders/symbol_icon.fragment.glsl +4 -4
- package/src/shaders/symbol_icon.vertex.glsl +7 -7
- package/src/shaders/symbol_sdf.fragment.glsl +5 -5
- package/src/shaders/symbol_sdf.vertex.glsl +7 -7
- package/src/shaders/symbol_text_and_icon.fragment.glsl +7 -7
- package/src/shaders/symbol_text_and_icon.vertex.glsl +6 -6
- package/src/shaders/terrain.fragment.glsl +2 -2
- package/src/shaders/terrain.vertex.glsl +3 -3
- package/src/shaders/terrain_coords.fragment.glsl +3 -3
- package/src/shaders/terrain_depth.fragment.glsl +2 -2
- package/src/source/raster_dem_tile_source.ts +4 -3
- package/src/source/source_cache.ts +8 -3
- package/src/source/vector_tile_source.test.ts +11 -11
- package/src/source/vector_tile_worker_source.ts +1 -1
- package/src/style/style_layer/custom_style_layer.ts +7 -7
- package/src/ui/control/attribution_control.ts +1 -1
- package/src/ui/control/fullscreen_control.ts +1 -1
- package/src/ui/control/geolocate_control.ts +6 -6
- package/src/ui/control/navigation_control.ts +4 -4
- package/src/ui/control/scale_control.ts +1 -1
- package/src/ui/control/terrain_control.ts +4 -5
- package/src/ui/events.ts +2 -0
- package/src/ui/map.test.ts +11 -0
- package/src/ui/map.ts +19 -12
- package/src/ui/marker.ts +2 -2
- package/src/ui/popup.ts +2 -2
- package/src/util/browser.ts +2 -2
- package/src/util/config.ts +2 -0
- package/src/util/request_manager.ts +1 -1
- package/src/util/test/mock_webgl.ts +4 -1
- package/src/util/webp_supported.ts +3 -3
package/dist/maplibre-gl-dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v3.
|
|
1
|
+
/* MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v3.1.0/LICENSE.txt */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -1056,6 +1056,7 @@ const exported = {
|
|
|
1056
1056
|
const config = {
|
|
1057
1057
|
MAX_PARALLEL_IMAGE_REQUESTS: 16,
|
|
1058
1058
|
MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: 8,
|
|
1059
|
+
MAX_TILE_CACHE_ZOOM_LEVELS: 5,
|
|
1059
1060
|
REGISTERED_PROTOCOLS: {},
|
|
1060
1061
|
WORKER_URL: ''
|
|
1061
1062
|
};
|
|
@@ -5149,57 +5150,61 @@ function parseCssColor(input) {
|
|
|
5149
5150
|
return [r / 255, g / 255, b / 255, 1];
|
|
5150
5151
|
}
|
|
5151
5152
|
// #f0c, #f0cf, #ff00cc, #ff00ccff
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5153
|
+
if (input.startsWith('#')) {
|
|
5154
|
+
const hexRegexp = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/;
|
|
5155
|
+
if (hexRegexp.test(input)) {
|
|
5156
|
+
const step = input.length < 6 ? 1 : 2;
|
|
5157
|
+
let i = 1;
|
|
5158
|
+
return [
|
|
5159
|
+
parseHex(input.slice(i, i += step)),
|
|
5160
|
+
parseHex(input.slice(i, i += step)),
|
|
5161
|
+
parseHex(input.slice(i, i += step)),
|
|
5162
|
+
parseHex(input.slice(i, i + step) || 'ff'),
|
|
5163
|
+
];
|
|
5164
|
+
}
|
|
5162
5165
|
}
|
|
5163
5166
|
// rgb(128 0 0), rgb(50% 0% 0%), rgba(255,0,255,0.6), rgb(255 0 255 / 60%), rgb(100% 0% 100% /.6)
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
argFormat === '
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
(valFormat === '') ?
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5167
|
+
if (input.startsWith('rgb')) {
|
|
5168
|
+
const rgbRegExp = /^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/;
|
|
5169
|
+
const rgbMatch = input.match(rgbRegExp);
|
|
5170
|
+
if (rgbMatch) {
|
|
5171
|
+
const [_, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5172
|
+
r, // <numeric>
|
|
5173
|
+
rp, // % (optional)
|
|
5174
|
+
f1, // , (optional)
|
|
5175
|
+
g, // <numeric>
|
|
5176
|
+
gp, // % (optional)
|
|
5177
|
+
f2, // , (optional)
|
|
5178
|
+
b, // <numeric>
|
|
5179
|
+
bp, // % (optional)
|
|
5180
|
+
f3, // ,|/ (optional)
|
|
5181
|
+
a, // <numeric> (optional)
|
|
5182
|
+
ap, // % (optional)
|
|
5183
|
+
] = rgbMatch;
|
|
5184
|
+
const argFormat = [f1 || ' ', f2 || ' ', f3].join('');
|
|
5185
|
+
if (argFormat === ' ' ||
|
|
5186
|
+
argFormat === ' /' ||
|
|
5187
|
+
argFormat === ',,' ||
|
|
5188
|
+
argFormat === ',,,') {
|
|
5189
|
+
const valFormat = [rp, gp, bp].join('');
|
|
5190
|
+
const maxValue = (valFormat === '%%%') ? 100 :
|
|
5191
|
+
(valFormat === '') ? 255 : 0;
|
|
5192
|
+
if (maxValue) {
|
|
5193
|
+
const rgba = [
|
|
5194
|
+
clamp(+r / maxValue, 0, 1),
|
|
5195
|
+
clamp(+g / maxValue, 0, 1),
|
|
5196
|
+
clamp(+b / maxValue, 0, 1),
|
|
5197
|
+
a ? parseAlpha(+a, ap) : 1,
|
|
5198
|
+
];
|
|
5199
|
+
if (validateNumbers(rgba)) {
|
|
5200
|
+
return rgba;
|
|
5201
|
+
}
|
|
5202
|
+
// invalid numbers
|
|
5197
5203
|
}
|
|
5198
|
-
//
|
|
5204
|
+
// values must be all numbers or all percentages
|
|
5199
5205
|
}
|
|
5200
|
-
//
|
|
5206
|
+
return; // comma optional syntax requires no commas at all
|
|
5201
5207
|
}
|
|
5202
|
-
return; // comma optional syntax requires no commas at all
|
|
5203
5208
|
}
|
|
5204
5209
|
// hsl(120 50% 80%), hsla(120deg,50%,80%,.9), hsl(12e1 50% 80% / 90%)
|
|
5205
5210
|
const hslRegExp = /^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/;
|
|
@@ -28540,10 +28545,10 @@ const earthRadius = 6371008.8;
|
|
|
28540
28545
|
* A `LngLat` object represents a given longitude and latitude coordinate, measured in degrees.
|
|
28541
28546
|
* These coordinates are based on the [WGS84 (EPSG:4326) standard](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).
|
|
28542
28547
|
*
|
|
28543
|
-
* MapLibre GL uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match the
|
|
28548
|
+
* MapLibre GL JS uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match the
|
|
28544
28549
|
* [GeoJSON specification](https://tools.ietf.org/html/rfc7946).
|
|
28545
28550
|
*
|
|
28546
|
-
* Note that any MapLibre GL method that accepts a `LngLat` object as an argument or option
|
|
28551
|
+
* Note that any MapLibre GL JS method that accepts a `LngLat` object as an argument or option
|
|
28547
28552
|
* can also accept an `Array` of two numbers and will perform an implicit conversion.
|
|
28548
28553
|
* This flexible type is documented as {@link LngLatLike}.
|
|
28549
28554
|
*
|
|
@@ -33820,7 +33825,7 @@ define(['./shared'], (function (performance) { 'use strict';
|
|
|
33820
33825
|
|
|
33821
33826
|
var name = "maplibre-gl";
|
|
33822
33827
|
var description = "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library";
|
|
33823
|
-
var version$2 = "3.
|
|
33828
|
+
var version$2 = "3.1.0";
|
|
33824
33829
|
var main = "dist/maplibre-gl.js";
|
|
33825
33830
|
var style = "dist/maplibre-gl.css";
|
|
33826
33831
|
var license = "BSD-3-Clause";
|
|
@@ -33839,7 +33844,7 @@ var dependencies = {
|
|
|
33839
33844
|
"@mapbox/unitbezier": "^0.0.1",
|
|
33840
33845
|
"@mapbox/vector-tile": "^1.3.1",
|
|
33841
33846
|
"@mapbox/whoots-js": "^3.1.0",
|
|
33842
|
-
"@maplibre/maplibre-gl-style-spec": "^19.2.
|
|
33847
|
+
"@maplibre/maplibre-gl-style-spec": "^19.2.1",
|
|
33843
33848
|
"@types/geojson": "^7946.0.10",
|
|
33844
33849
|
"@types/mapbox__point-geometry": "^0.1.2",
|
|
33845
33850
|
"@types/mapbox__vector-tile": "^1.3.0",
|
|
@@ -33860,22 +33865,22 @@ var dependencies = {
|
|
|
33860
33865
|
var devDependencies = {
|
|
33861
33866
|
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
|
|
33862
33867
|
"@mapbox/mvt-fixtures": "^3.10.0",
|
|
33863
|
-
"@rollup/plugin-commonjs": "^25.0.
|
|
33868
|
+
"@rollup/plugin-commonjs": "^25.0.1",
|
|
33864
33869
|
"@rollup/plugin-json": "^6.0.0",
|
|
33865
|
-
"@rollup/plugin-node-resolve": "^15.0
|
|
33870
|
+
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
33866
33871
|
"@rollup/plugin-replace": "^5.0.2",
|
|
33867
33872
|
"@rollup/plugin-strip": "^3.0.2",
|
|
33868
|
-
"@rollup/plugin-terser": "^0.4.
|
|
33873
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
33869
33874
|
"@rollup/plugin-typescript": "^11.1.1",
|
|
33870
33875
|
"@types/benchmark": "^2.1.2",
|
|
33871
33876
|
"@types/cssnano": "^5.0.0",
|
|
33872
33877
|
"@types/d3": "^7.4.0",
|
|
33873
33878
|
"@types/diff": "^5.0.3",
|
|
33874
33879
|
"@types/earcut": "^2.1.1",
|
|
33875
|
-
"@types/eslint": "^8.
|
|
33880
|
+
"@types/eslint": "^8.40.0",
|
|
33876
33881
|
"@types/gl": "^6.0.2",
|
|
33877
33882
|
"@types/glob": "^8.1.0",
|
|
33878
|
-
"@types/jest": "^29.5.
|
|
33883
|
+
"@types/jest": "^29.5.2",
|
|
33879
33884
|
"@types/jsdom": "^21.1.1",
|
|
33880
33885
|
"@types/minimist": "^1.2.2",
|
|
33881
33886
|
"@types/murmurhash-js": "^1.0.4",
|
|
@@ -33884,39 +33889,39 @@ var devDependencies = {
|
|
|
33884
33889
|
"@types/offscreencanvas": "^2019.7.0",
|
|
33885
33890
|
"@types/pixelmatch": "^5.2.4",
|
|
33886
33891
|
"@types/pngjs": "^6.0.1",
|
|
33887
|
-
"@types/react": "^18.2.
|
|
33892
|
+
"@types/react": "^18.2.11",
|
|
33888
33893
|
"@types/react-dom": "^18.2.4",
|
|
33889
33894
|
"@types/request": "^2.48.8",
|
|
33890
33895
|
"@types/shuffle-seed": "^1.1.0",
|
|
33891
33896
|
"@types/supercluster": "^7.1.0",
|
|
33892
33897
|
"@types/window-or-global": "^1.0.4",
|
|
33893
|
-
"@typescript-eslint/eslint-plugin": "^5.59.
|
|
33894
|
-
"@typescript-eslint/parser": "^5.59.
|
|
33898
|
+
"@typescript-eslint/eslint-plugin": "^5.59.9",
|
|
33899
|
+
"@typescript-eslint/parser": "^5.59.11",
|
|
33895
33900
|
address: "^1.2.2",
|
|
33896
33901
|
benchmark: "^2.1.4",
|
|
33897
33902
|
canvas: "^2.11.2",
|
|
33898
33903
|
cssnano: "^6.0.1",
|
|
33899
|
-
d3: "^7.8.
|
|
33904
|
+
d3: "^7.8.5",
|
|
33900
33905
|
"d3-queue": "^3.0.7",
|
|
33901
|
-
"devtools-protocol": "^0.0.
|
|
33906
|
+
"devtools-protocol": "^0.0.1155872",
|
|
33902
33907
|
diff: "^5.1.0",
|
|
33903
|
-
documentation: "14.0.
|
|
33908
|
+
documentation: "14.0.2",
|
|
33904
33909
|
"dts-bundle-generator": "^8.0.1",
|
|
33905
|
-
eslint: "^8.
|
|
33910
|
+
eslint: "^8.42.0",
|
|
33906
33911
|
"eslint-config-mourner": "^3.0.0",
|
|
33907
33912
|
"eslint-plugin-html": "^7.1.0",
|
|
33908
33913
|
"eslint-plugin-import": "^2.27.5",
|
|
33909
33914
|
"eslint-plugin-jest": "^27.2.1",
|
|
33910
|
-
"eslint-plugin-jsdoc": "^
|
|
33915
|
+
"eslint-plugin-jsdoc": "^46.2.6",
|
|
33911
33916
|
"eslint-plugin-react": "^7.32.2",
|
|
33912
33917
|
expect: "^29.5.0",
|
|
33913
33918
|
gl: "^6.0.2",
|
|
33914
|
-
glob: "^10.2.
|
|
33919
|
+
glob: "^10.2.7",
|
|
33915
33920
|
"is-builtin-module": "^3.2.1",
|
|
33916
33921
|
jest: "^29.5.0",
|
|
33917
|
-
"jest-canvas-mock": "^2.5.
|
|
33922
|
+
"jest-canvas-mock": "^2.5.1",
|
|
33918
33923
|
"jest-environment-jsdom": "^29.5.0",
|
|
33919
|
-
jsdom: "^22.
|
|
33924
|
+
jsdom: "^22.1.0",
|
|
33920
33925
|
"json-stringify-pretty-compact": "^4.0.0",
|
|
33921
33926
|
minimist: "^1.2.8",
|
|
33922
33927
|
"mock-geolocation": "^1.0.11",
|
|
@@ -33927,26 +33932,26 @@ var devDependencies = {
|
|
|
33927
33932
|
"pdf-merger-js": "^4.3.0",
|
|
33928
33933
|
pixelmatch: "^5.3.0",
|
|
33929
33934
|
pngjs: "^7.0.0",
|
|
33930
|
-
postcss: "^8.4.
|
|
33935
|
+
postcss: "^8.4.24",
|
|
33931
33936
|
"postcss-cli": "^10.1.0",
|
|
33932
33937
|
"postcss-inline-svg": "^6.0.0",
|
|
33933
33938
|
"pretty-bytes": "^6.1.0",
|
|
33934
|
-
puppeteer: "^20.
|
|
33939
|
+
puppeteer: "^20.7.1",
|
|
33935
33940
|
react: "^18.2.0",
|
|
33936
33941
|
"react-dom": "^18.2.0",
|
|
33937
|
-
rollup: "^3.
|
|
33942
|
+
rollup: "^3.25.1",
|
|
33938
33943
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
33939
33944
|
rw: "^1.3.3",
|
|
33940
33945
|
semver: "^7.5.1",
|
|
33941
33946
|
"shuffle-seed": "^1.1.6",
|
|
33942
33947
|
"source-map-explorer": "^2.5.3",
|
|
33943
33948
|
st: "^3.0.0",
|
|
33944
|
-
stylelint: "^15.
|
|
33949
|
+
stylelint: "^15.7.0",
|
|
33945
33950
|
"stylelint-config-standard": "^33.0.0",
|
|
33946
33951
|
"ts-jest": "^29.1.0",
|
|
33947
33952
|
"ts-node": "^10.9.1",
|
|
33948
|
-
tslib: "^2.5.
|
|
33949
|
-
typescript: "^5.
|
|
33953
|
+
tslib: "^2.5.2",
|
|
33954
|
+
typescript: "^5.1.3"
|
|
33950
33955
|
};
|
|
33951
33956
|
var overrides = {
|
|
33952
33957
|
"postcss-inline-svg": {
|
|
@@ -33957,11 +33962,11 @@ var overrides = {
|
|
|
33957
33962
|
}
|
|
33958
33963
|
};
|
|
33959
33964
|
var scripts = {
|
|
33960
|
-
"generate-dist-package": "
|
|
33961
|
-
"generate-shaders": "
|
|
33962
|
-
"generate-struct-arrays": "
|
|
33963
|
-
"generate-style-code": "
|
|
33964
|
-
"generate-typings": "
|
|
33965
|
+
"generate-dist-package": "npm run tsnode build/generate-dist-package.js",
|
|
33966
|
+
"generate-shaders": "npm run tsnode build/generate-shaders.ts",
|
|
33967
|
+
"generate-struct-arrays": "npm run tsnode build/generate-struct-arrays.ts",
|
|
33968
|
+
"generate-style-code": "npm run tsnode build/generate-style-code.ts",
|
|
33969
|
+
"generate-typings": "npm run tsnode build/generate-typings.ts",
|
|
33965
33970
|
"build-dist": "run-p --print-label generate-typings build-dev build-prod build-csp build-csp-dev build-css",
|
|
33966
33971
|
"build-dev": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev",
|
|
33967
33972
|
"watch-dev": "rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev --watch",
|
|
@@ -33984,14 +33989,15 @@ var scripts = {
|
|
|
33984
33989
|
"jest-ci": "jest --reporters=github-actions --reporters=summary",
|
|
33985
33990
|
"test-build": "jest --selectProjects=build",
|
|
33986
33991
|
"test-integration": "jest --selectProjects=integration",
|
|
33987
|
-
"test-render": "
|
|
33992
|
+
"test-render": "npm run tsnode test/integration/render/run_render_tests.ts",
|
|
33988
33993
|
"test-unit": "jest --selectProjects=unit",
|
|
33989
33994
|
"test-watch-roots": "jest --watch",
|
|
33990
33995
|
codegen: "run-p generate-dist-package generate-style-code generate-struct-arrays generate-shaders",
|
|
33991
|
-
benchmark: "
|
|
33992
|
-
"gl-stats": "
|
|
33996
|
+
benchmark: "npm run tsnode test/bench/run-benchmarks.ts",
|
|
33997
|
+
"gl-stats": "npm run tsnode test/bench/gl-stats.ts",
|
|
33993
33998
|
prepare: "npm run codegen",
|
|
33994
|
-
typecheck: "tsc --noEmit"
|
|
33999
|
+
typecheck: "tsc --noEmit && tsc --project tsconfig.dist.json",
|
|
34000
|
+
tsnode: "node --experimental-loader=ts-node/esm --no-warnings"
|
|
33995
34001
|
};
|
|
33996
34002
|
var files = [
|
|
33997
34003
|
"build/",
|
|
@@ -38062,6 +38068,7 @@ class SourceCache extends performance.Evented {
|
|
|
38062
38068
|
this._timers = {};
|
|
38063
38069
|
this._cacheTimers = {};
|
|
38064
38070
|
this._maxTileCacheSize = null;
|
|
38071
|
+
this._maxTileCacheZoomLevels = null;
|
|
38065
38072
|
this._loadedParentTiles = {};
|
|
38066
38073
|
this._coveredTiles = {};
|
|
38067
38074
|
this._state = new SourceFeatureState();
|
|
@@ -38071,6 +38078,7 @@ class SourceCache extends performance.Evented {
|
|
|
38071
38078
|
onAdd(map) {
|
|
38072
38079
|
this.map = map;
|
|
38073
38080
|
this._maxTileCacheSize = map ? map._maxTileCacheSize : null;
|
|
38081
|
+
this._maxTileCacheZoomLevels = map ? map._maxTileCacheZoomLevels : null;
|
|
38074
38082
|
if (this._source && this._source.onAdd) {
|
|
38075
38083
|
this._source.onAdd(map);
|
|
38076
38084
|
}
|
|
@@ -38371,9 +38379,11 @@ class SourceCache extends performance.Evented {
|
|
|
38371
38379
|
const widthInTiles = Math.ceil(transform.width / this._source.tileSize) + 1;
|
|
38372
38380
|
const heightInTiles = Math.ceil(transform.height / this._source.tileSize) + 1;
|
|
38373
38381
|
const approxTilesInView = widthInTiles * heightInTiles;
|
|
38374
|
-
const commonZoomRange =
|
|
38382
|
+
const commonZoomRange = this._maxTileCacheZoomLevels === null ?
|
|
38383
|
+
performance.config.MAX_TILE_CACHE_ZOOM_LEVELS : this._maxTileCacheZoomLevels;
|
|
38375
38384
|
const viewDependentMaxSize = Math.floor(approxTilesInView * commonZoomRange);
|
|
38376
|
-
const maxSize = typeof this._maxTileCacheSize === 'number' ?
|
|
38385
|
+
const maxSize = typeof this._maxTileCacheSize === 'number' ?
|
|
38386
|
+
Math.min(this._maxTileCacheSize, viewDependentMaxSize) : viewDependentMaxSize;
|
|
38377
38387
|
this._cache.setMaxSize(maxSize);
|
|
38378
38388
|
}
|
|
38379
38389
|
handleWrapJump(lng) {
|
|
@@ -42545,7 +42555,7 @@ var posAttributes = performance.createLayout([
|
|
|
42545
42555
|
]);
|
|
42546
42556
|
|
|
42547
42557
|
// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.
|
|
42548
|
-
var preludeFrag = '#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif';
|
|
42558
|
+
var preludeFrag = '#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n';
|
|
42549
42559
|
|
|
42550
42560
|
// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.
|
|
42551
42561
|
var preludeVert = '#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}';
|
|
@@ -43854,6 +43864,18 @@ class VertexBuffer {
|
|
|
43854
43864
|
}
|
|
43855
43865
|
}
|
|
43856
43866
|
|
|
43867
|
+
const cache = new WeakMap();
|
|
43868
|
+
function isWebGL2(gl) {
|
|
43869
|
+
if (cache.has(gl)) {
|
|
43870
|
+
return cache.get(gl);
|
|
43871
|
+
}
|
|
43872
|
+
else {
|
|
43873
|
+
const value = gl.getParameter(gl.VERSION).startsWith('WebGL 2.0');
|
|
43874
|
+
cache.set(gl, value);
|
|
43875
|
+
return value;
|
|
43876
|
+
}
|
|
43877
|
+
}
|
|
43878
|
+
|
|
43857
43879
|
class BaseValue {
|
|
43858
43880
|
constructor(context) {
|
|
43859
43881
|
this.gl = context.gl;
|
|
@@ -44246,10 +44268,16 @@ class BindVertexArray extends BaseValue {
|
|
|
44246
44268
|
return null;
|
|
44247
44269
|
}
|
|
44248
44270
|
set(v) {
|
|
44271
|
+
var _a;
|
|
44249
44272
|
if (v === this.current && !this.dirty)
|
|
44250
44273
|
return;
|
|
44251
44274
|
const gl = this.gl;
|
|
44252
|
-
gl
|
|
44275
|
+
if (isWebGL2(gl)) {
|
|
44276
|
+
gl.bindVertexArray(v);
|
|
44277
|
+
}
|
|
44278
|
+
else {
|
|
44279
|
+
(_a = gl.getExtension('OES_vertex_array_object')) === null || _a === void 0 ? void 0 : _a.bindVertexArrayOES(v);
|
|
44280
|
+
}
|
|
44253
44281
|
this.current = v;
|
|
44254
44282
|
this.dirty = false;
|
|
44255
44283
|
}
|
|
@@ -44395,6 +44423,7 @@ ColorMode.alphaBlended = new ColorMode([ONE, ONE_MINUS_SRC_ALPHA], performance.C
|
|
|
44395
44423
|
|
|
44396
44424
|
class Context {
|
|
44397
44425
|
constructor(gl) {
|
|
44426
|
+
var _a, _b;
|
|
44398
44427
|
this.gl = gl;
|
|
44399
44428
|
this.clearColor = new ClearColor(this);
|
|
44400
44429
|
this.clearDepth = new ClearDepth(this);
|
|
@@ -44427,15 +44456,26 @@ class Context {
|
|
|
44427
44456
|
this.pixelStoreUnpack = new PixelStoreUnpack(this);
|
|
44428
44457
|
this.pixelStoreUnpackPremultiplyAlpha = new PixelStoreUnpackPremultiplyAlpha(this);
|
|
44429
44458
|
this.pixelStoreUnpackFlipY = new PixelStoreUnpackFlipY(this);
|
|
44430
|
-
this.extTextureFilterAnisotropic = gl.getExtension('EXT_texture_filter_anisotropic')
|
|
44459
|
+
this.extTextureFilterAnisotropic = (gl.getExtension('EXT_texture_filter_anisotropic') ||
|
|
44460
|
+
gl.getExtension('MOZ_EXT_texture_filter_anisotropic') ||
|
|
44461
|
+
gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic'));
|
|
44431
44462
|
if (this.extTextureFilterAnisotropic) {
|
|
44432
44463
|
this.extTextureFilterAnisotropicMax = gl.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
|
|
44433
44464
|
}
|
|
44434
44465
|
this.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
|
|
44435
|
-
|
|
44436
|
-
|
|
44437
|
-
|
|
44438
|
-
|
|
44466
|
+
if (isWebGL2(gl)) {
|
|
44467
|
+
this.HALF_FLOAT = gl.HALF_FLOAT;
|
|
44468
|
+
const extColorBufferHalfFloat = gl.getExtension('EXT_color_buffer_half_float');
|
|
44469
|
+
this.RGBA16F = (_a = gl.RGBA16F) !== null && _a !== void 0 ? _a : extColorBufferHalfFloat === null || extColorBufferHalfFloat === void 0 ? void 0 : extColorBufferHalfFloat.RGBA16F_EXT;
|
|
44470
|
+
this.RGB16F = (_b = gl.RGB16F) !== null && _b !== void 0 ? _b : extColorBufferHalfFloat === null || extColorBufferHalfFloat === void 0 ? void 0 : extColorBufferHalfFloat.RGB16F_EXT;
|
|
44471
|
+
gl.getExtension('EXT_color_buffer_float');
|
|
44472
|
+
}
|
|
44473
|
+
else {
|
|
44474
|
+
gl.getExtension('EXT_color_buffer_half_float');
|
|
44475
|
+
gl.getExtension('OES_texture_half_float_linear');
|
|
44476
|
+
const extTextureHalfFloat = gl.getExtension('OES_texture_half_float');
|
|
44477
|
+
this.HALF_FLOAT = extTextureHalfFloat === null || extTextureHalfFloat === void 0 ? void 0 : extTextureHalfFloat.HALF_FLOAT_OES;
|
|
44478
|
+
}
|
|
44439
44479
|
}
|
|
44440
44480
|
setDefault() {
|
|
44441
44481
|
this.unbindVAO();
|
|
@@ -44586,10 +44626,16 @@ class Context {
|
|
|
44586
44626
|
this.colorMask.set(colorMode.mask);
|
|
44587
44627
|
}
|
|
44588
44628
|
createVertexArray() {
|
|
44589
|
-
|
|
44629
|
+
var _a;
|
|
44630
|
+
if (isWebGL2(this.gl))
|
|
44631
|
+
return this.gl.createVertexArray();
|
|
44632
|
+
return (_a = this.gl.getExtension('OES_vertex_array_object')) === null || _a === void 0 ? void 0 : _a.createVertexArrayOES();
|
|
44590
44633
|
}
|
|
44591
44634
|
deleteVertexArray(x) {
|
|
44592
|
-
|
|
44635
|
+
var _a;
|
|
44636
|
+
if (isWebGL2(this.gl))
|
|
44637
|
+
return this.gl.deleteVertexArray(x);
|
|
44638
|
+
return (_a = this.gl.getExtension('OES_vertex_array_object')) === null || _a === void 0 ? void 0 : _a.deleteVertexArrayOES(x);
|
|
44593
44639
|
}
|
|
44594
44640
|
unbindVAO() {
|
|
44595
44641
|
// Unbinding the VAO prevents other things (custom layers, new buffer creation) from
|
|
@@ -50978,7 +51024,7 @@ let canary; // eslint-disable-line
|
|
|
50978
51024
|
* An `AttributionControl` control presents the map's attribution information. By default, the attribution control is expanded (regardless of map width).
|
|
50979
51025
|
*
|
|
50980
51026
|
* @implements {IControl}
|
|
50981
|
-
* @param {
|
|
51027
|
+
* @param {AttributionOptions} [options]
|
|
50982
51028
|
* @param {boolean} [options.compact] If `true`, the attribution control will always collapse when moving the map. If `false`, force the expanded attribution control. The default is a responsive attribution that collapses when the user moves the map on maps less than 640 pixels wide. **Attribution should not be collapsed if it can comfortably fit on the map. `compact` should only be used to modify default attribution when map size makes it impossible to fit default attribution and when the automatic compact resizing for default settings are not sufficient.**
|
|
50983
51029
|
* @param {string | Array<string>} [options.customAttribution] String or strings to show in addition to any other attributions.
|
|
50984
51030
|
* @example
|
|
@@ -51962,6 +52008,7 @@ const defaultOptions$4 = {
|
|
|
51962
52008
|
renderWorldCopies: true,
|
|
51963
52009
|
refreshExpiredTiles: true,
|
|
51964
52010
|
maxTileCacheSize: null,
|
|
52011
|
+
maxTileCacheZoomLevels: performance.config.MAX_TILE_CACHE_ZOOM_LEVELS,
|
|
51965
52012
|
localIdeographFontFamily: 'sans-serif',
|
|
51966
52013
|
transformRequest: null,
|
|
51967
52014
|
transformCameraUpdate: null,
|
|
@@ -52021,7 +52068,7 @@ const defaultOptions$4 = {
|
|
|
52021
52068
|
* @param {boolean|Object} [options.touchPitch=true] If `true`, the "drag to pitch" interaction is enabled. An `Object` value is passed as options to {@link TwoFingersTouchPitchHandler#enable}.
|
|
52022
52069
|
* @param {boolean|GestureOptions} [options.cooperativeGestures=undefined] If `true` or set to an options object, map is only accessible on desktop while holding Command/Ctrl and only accessible on mobile with two fingers. Interacting with the map using normal gestures will trigger an informational screen. With this option enabled, "drag to pitch" requires a three-finger gesture. Cooperative gestures are disabled when a map enters fullscreen using {@link #FullscreenControl}.
|
|
52023
52070
|
* @param {boolean} [options.trackResize=true] If `true`, the map will automatically resize when the browser window resizes.
|
|
52024
|
-
* @param {LngLatLike} [options.center=[0, 0]] The initial geographical centerpoint of the map. If `center` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `[0, 0]` Note: MapLibre GL uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match GeoJSON.
|
|
52071
|
+
* @param {LngLatLike} [options.center=[0, 0]] The initial geographical centerpoint of the map. If `center` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `[0, 0]` Note: MapLibre GL JS uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match GeoJSON.
|
|
52025
52072
|
* @param {number} [options.zoom=0] The initial zoom level of the map. If `zoom` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.
|
|
52026
52073
|
* @param {number} [options.bearing=0] The initial bearing (rotation) of the map, measured in degrees counter-clockwise from north. If `bearing` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.
|
|
52027
52074
|
* @param {number} [options.pitch=0] The initial pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-85). If `pitch` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`. Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.
|
|
@@ -52032,8 +52079,9 @@ const defaultOptions$4 = {
|
|
|
52032
52079
|
* container, there will be blank space beyond 180 and -180 degrees longitude.
|
|
52033
52080
|
* - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
|
|
52034
52081
|
* map and the other on the left edge of the map) at every zoom level.
|
|
52035
|
-
* @param {number} [options.maxTileCacheSize=null] The maximum number of tiles stored in the tile cache for a given source. If omitted, the cache will be dynamically sized based on the current viewport.
|
|
52036
|
-
* @param {
|
|
52082
|
+
* @param {number} [options.maxTileCacheSize=null] The maximum number of tiles stored in the tile cache for a given source. If omitted, the cache will be dynamically sized based on the current viewport which can be set using `maxTileCacheZoomLevels` constructor options.
|
|
52083
|
+
* @param {number} [options.maxTileCacheZoomLevels=5] The maximum number of zoom levels for which to store tiles for a given source. Tile cache dynamic size is calculated by multiplying `maxTileCacheZoomLevels` with approx number of tiles in the viewport for a given source.
|
|
52084
|
+
* @param {boolean} [options.validateStyle=true] If false, style validation will be skipped. Useful in production environment.
|
|
52037
52085
|
* @param {string} [options.localIdeographFontFamily='sans-serif'] Defines a CSS
|
|
52038
52086
|
* font-family for locally overriding generation of glyphs in the 'CJK Unified Ideographs', 'Hiragana', 'Katakana' and 'Hangul Syllables' ranges.
|
|
52039
52087
|
* In these ranges, font settings from the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold).
|
|
@@ -52090,6 +52138,7 @@ let Map$1 = class Map extends Camera {
|
|
|
52090
52138
|
this._cooperativeGestures = options.cooperativeGestures;
|
|
52091
52139
|
this._metaKey = navigator.platform.indexOf('Mac') === 0 ? 'metaKey' : 'ctrlKey';
|
|
52092
52140
|
this._maxTileCacheSize = options.maxTileCacheSize;
|
|
52141
|
+
this._maxTileCacheZoomLevels = options.maxTileCacheZoomLevels;
|
|
52093
52142
|
this._failIfMajorPerformanceCaveat = options.failIfMajorPerformanceCaveat;
|
|
52094
52143
|
this._preserveDrawingBuffer = options.preserveDrawingBuffer;
|
|
52095
52144
|
this._antialias = options.antialias;
|
|
@@ -52741,7 +52790,7 @@ let Map$1 = class Map extends Camera {
|
|
|
52741
52790
|
* @param {FilterSpecification} [options.filter] (optional) A [filter](https://maplibre.org/maplibre-style-spec/layers/#filter)
|
|
52742
52791
|
* to limit query results.
|
|
52743
52792
|
* @param {Array<string>} [options.availableImages] (optional) An array of string representing the available images
|
|
52744
|
-
* @param {boolean} [options.validate=true] (optional) Whether to check if the [options.filter] conforms to the MapLibre
|
|
52793
|
+
* @param {boolean} [options.validate=true] (optional) Whether to check if the [options.filter] conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
|
|
52745
52794
|
*
|
|
52746
52795
|
* @returns {Array<MapGeoJSONFeature>} An array of MapGeoJSONFeature objects.
|
|
52747
52796
|
*
|
|
@@ -52830,7 +52879,7 @@ let Map$1 = class Map extends Camera {
|
|
|
52830
52879
|
* to query. *For vector tile sources, this parameter is required.* For GeoJSON sources, it is ignored.
|
|
52831
52880
|
* @param {Array} [parameters.filter] A [filter](https://maplibre.org/maplibre-style-spec/layers/#filter)
|
|
52832
52881
|
* to limit query results.
|
|
52833
|
-
* @param {boolean} [parameters.validate=true] Whether to check if the [parameters.filter] conforms to the MapLibre
|
|
52882
|
+
* @param {boolean} [parameters.validate=true] Whether to check if the [parameters.filter] conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
|
|
52834
52883
|
*
|
|
52835
52884
|
* @returns {Array<MapGeoJSONFeature>} An array of MapGeoJSONFeature objects.
|
|
52836
52885
|
*
|
|
@@ -53622,7 +53671,7 @@ let Map$1 = class Map extends Camera {
|
|
|
53622
53671
|
* @param {Array | null | undefined} filter The filter, conforming to the MapLibre Style Specification's
|
|
53623
53672
|
* [filter definition](https://maplibre.org/maplibre-style-spec/layers/#filter). If `null` or `undefined` is provided, the function removes any existing filter from the layer.
|
|
53624
53673
|
* @param {Object} [options] Options object.
|
|
53625
|
-
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre
|
|
53674
|
+
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
|
|
53626
53675
|
* @returns {Map} `this`
|
|
53627
53676
|
*
|
|
53628
53677
|
* @example
|
|
@@ -53658,7 +53707,7 @@ let Map$1 = class Map extends Camera {
|
|
|
53658
53707
|
* @param {*} value The value of the paint property to set.
|
|
53659
53708
|
* Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
|
|
53660
53709
|
* @param {Object} [options] Options object.
|
|
53661
|
-
* @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre
|
|
53710
|
+
* @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
|
|
53662
53711
|
* @returns {Map} `this`
|
|
53663
53712
|
* @example
|
|
53664
53713
|
* map.setPaintProperty('my-layer', 'fill-color', '#faafee');
|
|
@@ -53686,7 +53735,7 @@ let Map$1 = class Map extends Camera {
|
|
|
53686
53735
|
* @param {string} name The name of the layout property to set.
|
|
53687
53736
|
* @param {*} value The value of the layout property. Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
|
|
53688
53737
|
* @param {Object} [options] Options object.
|
|
53689
|
-
* @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre
|
|
53738
|
+
* @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
|
|
53690
53739
|
* @returns {Map} `this`
|
|
53691
53740
|
* @example
|
|
53692
53741
|
* map.setLayoutProperty('my-layer', 'visibility', 'none');
|
|
@@ -53710,7 +53759,7 @@ let Map$1 = class Map extends Camera {
|
|
|
53710
53759
|
*
|
|
53711
53760
|
* @param glyphsUrl Glyph URL to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/glyphs/).
|
|
53712
53761
|
* @param {StyleSetterOptions} [options] Options object.
|
|
53713
|
-
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre
|
|
53762
|
+
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
|
|
53714
53763
|
* @returns {Map} `this`
|
|
53715
53764
|
* @example
|
|
53716
53765
|
* map.setGlyphs('https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf');
|
|
@@ -53777,7 +53826,7 @@ let Map$1 = class Map extends Camera {
|
|
|
53777
53826
|
*
|
|
53778
53827
|
* @param spriteUrl Sprite URL to set.
|
|
53779
53828
|
* @param {StyleSetterOptions} [options] Options object.
|
|
53780
|
-
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre
|
|
53829
|
+
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
|
|
53781
53830
|
* @returns {Map} `this`
|
|
53782
53831
|
* @example
|
|
53783
53832
|
* map.setSprite('YOUR_SPRITE_URL');
|
|
@@ -53796,7 +53845,7 @@ let Map$1 = class Map extends Camera {
|
|
|
53796
53845
|
*
|
|
53797
53846
|
* @param light Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/#light).
|
|
53798
53847
|
* @param {Object} [options] Options object.
|
|
53799
|
-
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre
|
|
53848
|
+
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
|
|
53800
53849
|
* @returns {Map} `this`
|
|
53801
53850
|
* @example
|
|
53802
53851
|
* var layerVisibility = map.getLayoutProperty('my-layer', 'visibility');
|
|
@@ -54054,7 +54103,8 @@ let Map$1 = class Map extends Camera {
|
|
|
54054
54103
|
webglcontextcreationerrorDetailObject.type = args.type;
|
|
54055
54104
|
}
|
|
54056
54105
|
}, { once: true });
|
|
54057
|
-
const gl = this._canvas.getContext('webgl2', attributes)
|
|
54106
|
+
const gl = this._canvas.getContext('webgl2', attributes) ||
|
|
54107
|
+
this._canvas.getContext('webgl', attributes);
|
|
54058
54108
|
if (!gl) {
|
|
54059
54109
|
const msg = 'Failed to initialize WebGL';
|
|
54060
54110
|
if (webglcontextcreationerrorDetailObject) {
|
|
@@ -54477,10 +54527,10 @@ const defaultOptions$3 = {
|
|
|
54477
54527
|
* A `NavigationControl` control contains zoom buttons and a compass.
|
|
54478
54528
|
*
|
|
54479
54529
|
* @implements {IControl}
|
|
54480
|
-
* @param {
|
|
54481
|
-
* @param {
|
|
54482
|
-
* @param {
|
|
54483
|
-
* @param {
|
|
54530
|
+
* @param {NavigationOptions} [options]
|
|
54531
|
+
* @param {boolean} [options.showCompass=true] If `true` the compass button is included.
|
|
54532
|
+
* @param {boolean} [options.showZoom=true] If `true` the zoom-in and zoom-out buttons are included.
|
|
54533
|
+
* @param {boolean} [options.visualizePitch=false] If `true` the pitch is visualized by rotating X-axis of compass.
|
|
54484
54534
|
* @example
|
|
54485
54535
|
* var nav = new maplibregl.NavigationControl();
|
|
54486
54536
|
* map.addControl(nav, 'top-left');
|
|
@@ -54799,9 +54849,9 @@ function applyAnchorClass(element, anchor, prefix) {
|
|
|
54799
54849
|
|
|
54800
54850
|
/**
|
|
54801
54851
|
* Creates a marker component
|
|
54802
|
-
* @param {
|
|
54852
|
+
* @param {MarkerOptions} [options]
|
|
54803
54853
|
* @param {HTMLElement} [options.element] DOM element to use as a marker. The default is a light blue, droplet-shaped SVG marker.
|
|
54804
|
-
* @param {
|
|
54854
|
+
* @param {PositionAnchor} [options.anchor='center'] A string indicating the part of the Marker that should be positioned closest to the coordinate set via {@link Marker#setLngLat}.
|
|
54805
54855
|
* Options are `'center'`, `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`.
|
|
54806
54856
|
* @param {PointLike} [options.offset] The offset in pixels as a {@link PointLike} object to apply relative to the element's center. Negatives indicate left and up.
|
|
54807
54857
|
* @param {string} [options.color='#3FB1CE'] The color to use for the default marker if options.element is not provided. The default is light blue.
|
|
@@ -55401,12 +55451,12 @@ let noTimeout = false;
|
|
|
55401
55451
|
* These interaction states can't be controlled programmatically, rather they are set based on user interactions.
|
|
55402
55452
|
*
|
|
55403
55453
|
* @implements {IControl}
|
|
55404
|
-
* @param {
|
|
55405
|
-
* @param {
|
|
55406
|
-
* @param {
|
|
55407
|
-
* @param {
|
|
55408
|
-
* @param {
|
|
55409
|
-
* @param {
|
|
55454
|
+
* @param {GeolocateOptions} [options]
|
|
55455
|
+
* @param {PositionOptions} [options.positionOptions={enableHighAccuracy: false, timeout: 6000}] A Geolocation API [PositionOptions](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions) object.
|
|
55456
|
+
* @param {FitBoundsOptions} [options.fitBoundsOptions={maxZoom: 15}] A {@link Map#fitBounds} options object to use when the map is panned and zoomed to the user's location. The default is to use a `maxZoom` of 15 to limit how far the map will zoom in for very accurate locations.
|
|
55457
|
+
* @param {boolean} [options.trackUserLocation=false] If `true` the Geolocate Control becomes a toggle button and when active the map will receive updates to the user's location as it changes.
|
|
55458
|
+
* @param {boolean} [options.showAccuracyCircle=true] By default, if showUserLocation is `true`, a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to `false` to disable. Always disabled when showUserLocation is `false`.
|
|
55459
|
+
* @param {boolean} [options.showUserLocation=true] By default a dot will be shown on the map at the user's location. Set to `false` to disable.
|
|
55410
55460
|
*
|
|
55411
55461
|
* @example
|
|
55412
55462
|
* map.addControl(new maplibregl.GeolocateControl({
|
|
@@ -55959,7 +56009,7 @@ const defaultOptions$1 = {
|
|
|
55959
56009
|
* A `ScaleControl` control displays the ratio of a distance on the map to the corresponding distance on the ground.
|
|
55960
56010
|
*
|
|
55961
56011
|
* @implements {IControl}
|
|
55962
|
-
* @param {
|
|
56012
|
+
* @param {ScaleOptions} [options]
|
|
55963
56013
|
* @param {number} [options.maxWidth='100'] The maximum length of the scale control in pixels.
|
|
55964
56014
|
* @param {string} [options.unit='metric'] Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).
|
|
55965
56015
|
* @example
|
|
@@ -56069,7 +56119,7 @@ function getRoundNum(num) {
|
|
|
56069
56119
|
* is in fullscreen mode, and is restored when the map exist fullscreen mode.
|
|
56070
56120
|
*
|
|
56071
56121
|
* @implements {IControl}
|
|
56072
|
-
* @param {
|
|
56122
|
+
* @param {FullscreenOptions} [options]
|
|
56073
56123
|
* @param {HTMLElement} [options.container] `container` is the [compatible DOM element](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#Compatible_elements) which should be made full screen. By default, the map container element will be made full screen.
|
|
56074
56124
|
*
|
|
56075
56125
|
* @example
|
|
@@ -56226,13 +56276,12 @@ class FullscreenControl extends performance.Evented {
|
|
|
56226
56276
|
}
|
|
56227
56277
|
|
|
56228
56278
|
/**
|
|
56229
|
-
*
|
|
56279
|
+
* A `TerrainControl` control contains a button for turning the terrain on and off.
|
|
56230
56280
|
*
|
|
56231
56281
|
* @implements {IControl}
|
|
56232
|
-
* @param {
|
|
56233
|
-
* @param {string} [options.
|
|
56234
|
-
* @param {
|
|
56235
|
-
* @param {number} [options.options.exaggeration]
|
|
56282
|
+
* @param {TerrainSpecification} [options]
|
|
56283
|
+
* @param {string} [options.source] The ID of the raster-dem source to use.
|
|
56284
|
+
* @param {number} [options.exaggeration]
|
|
56236
56285
|
* @example
|
|
56237
56286
|
* var map = new maplibregl.Map({TerrainControl: false})
|
|
56238
56287
|
* .addControl(new maplibregl.TerrainControl({
|
|
@@ -56305,7 +56354,7 @@ const focusQuerySelector = [
|
|
|
56305
56354
|
/**
|
|
56306
56355
|
* A popup component.
|
|
56307
56356
|
*
|
|
56308
|
-
* @param {
|
|
56357
|
+
* @param {PopupOptions} [options]
|
|
56309
56358
|
* @param {boolean} [options.closeButton=true] If `true`, a close button will appear in the
|
|
56310
56359
|
* top right corner of the popup.
|
|
56311
56360
|
* @param {boolean} [options.closeOnClick=true] If `true`, the popup will closed when the
|
|
@@ -56314,7 +56363,7 @@ const focusQuerySelector = [
|
|
|
56314
56363
|
* map moves.
|
|
56315
56364
|
* @param {boolean} [options.focusAfterOpen=true] If `true`, the popup will try to focus the
|
|
56316
56365
|
* first focusable element inside the popup.
|
|
56317
|
-
* @param {
|
|
56366
|
+
* @param {PositionAnchor} [options.anchor] - A string indicating the part of the Popup that should
|
|
56318
56367
|
* be positioned closest to the coordinate set via {@link Popup#setLngLat}.
|
|
56319
56368
|
* Options are `'center'`, `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-left'`,
|
|
56320
56369
|
* `'top-right'`, `'bottom-left'`, and `'bottom-right'`. If unset the anchor will be
|