maplibre-gl 2.0.3 → 2.1.1

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.
Files changed (58) hide show
  1. package/build/rollup_plugins.js +1 -0
  2. package/dist/maplibre-gl-dev.js +54589 -0
  3. package/dist/maplibre-gl.css +1 -1
  4. package/dist/maplibre-gl.d.ts +49 -15
  5. package/dist/maplibre-gl.js +3 -3
  6. package/dist/maplibre-gl.js.map +1 -1
  7. package/dist/package.json +1 -0
  8. package/package.json +78 -100
  9. package/src/css/maplibre-gl.css +36 -36
  10. package/src/data/bucket/symbol_bucket.test.ts +1 -1
  11. package/src/data/bucket/symbol_bucket.ts +3 -3
  12. package/src/data/program_configuration.ts +1 -1
  13. package/src/render/draw_debug.ts +1 -1
  14. package/src/render/glyph_manager.ts +1 -1
  15. package/src/render/painter.ts +5 -3
  16. package/src/render/program/circle_program.ts +1 -1
  17. package/src/render/program/line_program.ts +3 -3
  18. package/src/render/program/symbol_program.ts +1 -1
  19. package/src/source/geojson_source.test.ts +2 -1
  20. package/src/source/geojson_source.ts +1 -1
  21. package/src/source/image_source.test.ts +153 -0
  22. package/src/source/raster_dem_tile_source.test.ts +2 -1
  23. package/src/source/raster_dem_tile_source.ts +1 -1
  24. package/src/source/raster_tile_source.test.ts +2 -1
  25. package/src/source/raster_tile_source.ts +1 -1
  26. package/src/source/source_cache.test.ts +1 -1
  27. package/src/source/tile.test.ts +1 -1
  28. package/src/source/tile_cache.test.ts +6 -4
  29. package/src/source/tile_id.test.ts +10 -12
  30. package/src/source/tile_id.ts +2 -2
  31. package/src/source/vector_tile_source.test.ts +14 -2
  32. package/src/source/vector_tile_source.ts +3 -4
  33. package/src/style/load_glyph_range.test.ts +0 -2
  34. package/src/style/load_sprite.ts +2 -1
  35. package/src/style/properties.ts +1 -1
  36. package/src/style/style.test.ts +24 -13
  37. package/src/style/style.ts +1 -1
  38. package/src/style/style_layer/custom_style_layer.ts +2 -2
  39. package/src/style/style_layer/fill_extrusion_style_layer.ts +1 -1
  40. package/src/style/style_layer/symbol_style_layer.ts +19 -0
  41. package/src/style/style_layer/symbol_style_layer_properties.ts +6 -0
  42. package/src/style-spec/CHANGELOG.md +6 -0
  43. package/src/style-spec/package.json +1 -1
  44. package/src/style-spec/reference/v8.json +68 -2
  45. package/src/style-spec/types.ts +2 -0
  46. package/src/symbol/collision_index.ts +19 -19
  47. package/src/symbol/grid_index.test.ts +42 -19
  48. package/src/symbol/grid_index.ts +62 -33
  49. package/src/symbol/placement.ts +82 -53
  50. package/src/symbol/symbol_style_layer.test.ts +48 -1
  51. package/src/ui/camera.test.ts +4 -4
  52. package/src/ui/camera.ts +8 -0
  53. package/src/ui/control/logo_control.test.ts +1 -0
  54. package/src/ui/handler/scroll_zoom.test.ts +2 -1
  55. package/src/ui/map.test.ts +77 -10
  56. package/src/ui/map.ts +33 -8
  57. package/src/util/ajax.test.ts +206 -0
  58. package/src/util/test/util.ts +14 -0
@@ -0,0 +1 @@
1
+ { "type": "commonjs" }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "maplibre-gl",
3
3
  "description": "BSD licensed community fork of mapbox-gl, a WebGL interactive maps library",
4
- "version": "2.0.3",
4
+ "version": "2.1.1",
5
5
  "main": "dist/maplibre-gl.js",
6
6
  "style": "dist/maplibre-gl.css",
7
7
  "license": "BSD-3-Clause",
@@ -9,13 +9,10 @@
9
9
  "type": "git",
10
10
  "url": "git://github.com/maplibre/maplibre-gl-js.git"
11
11
  },
12
- "engines": {
13
- "node": ">=16.0.0"
14
- },
15
12
  "types": "dist/maplibre-gl.d.ts",
16
13
  "type": "module",
17
14
  "dependencies": {
18
- "@mapbox/geojson-rewind": "^0.5.0",
15
+ "@mapbox/geojson-rewind": "^0.5.1",
19
16
  "@mapbox/jsonlint-lines-primitives": "^2.0.2",
20
17
  "@mapbox/mapbox-gl-supported": "^2.0.1",
21
18
  "@mapbox/point-geometry": "^0.1.0",
@@ -23,154 +20,137 @@
23
20
  "@mapbox/unitbezier": "^0.0.1",
24
21
  "@mapbox/vector-tile": "^1.3.1",
25
22
  "@mapbox/whoots-js": "^3.1.0",
26
- "@types/geojson": "^7946.0.7",
27
- "@types/mapbox__point-geometry": "^0.1.2",
28
- "@types/mapbox__vector-tile": "^1.3.0",
29
- "@types/pbf": "^3.0.2",
30
23
  "csscolorparser": "~1.0.3",
31
- "earcut": "^2.2.2",
24
+ "earcut": "^2.2.3",
32
25
  "geojson-vt": "^3.2.1",
33
- "gl-matrix": "^3.2.1",
26
+ "gl-matrix": "^3.4.3",
34
27
  "murmurhash-js": "^1.0.0",
35
28
  "pbf": "^3.2.1",
36
- "potpack": "^1.0.1",
29
+ "potpack": "^1.0.2",
37
30
  "quickselect": "^2.0.0",
38
31
  "supercluster": "^7.1.4",
39
32
  "tinyqueue": "^2.0.3",
40
- "vt-pbf": "^3.1.1"
33
+ "vt-pbf": "^3.1.3"
41
34
  },
42
35
  "devDependencies": {
43
- "@babel/core": "^7.16.0",
36
+ "@babel/core": "^7.16.12",
44
37
  "@mapbox/gazetteer": "^5.1.0",
45
- "@mapbox/mapbox-gl-rtl-text": "^0.2.1",
38
+ "@mapbox/mapbox-gl-rtl-text": "^0.2.3",
46
39
  "@mapbox/mvt-fixtures": "^3.6.0",
47
- "@octokit/rest": "^18.10.0",
48
- "@rollup/plugin-commonjs": "^21.0.0",
40
+ "@rollup/plugin-commonjs": "^21.0.1",
49
41
  "@rollup/plugin-json": "^4.1.0",
50
- "@rollup/plugin-node-resolve": "^13.0.6",
51
- "@rollup/plugin-replace": "^3.0.0",
42
+ "@rollup/plugin-node-resolve": "^13.1.3",
43
+ "@rollup/plugin-replace": "^3.0.1",
52
44
  "@rollup/plugin-strip": "^2.1.0",
53
45
  "@rollup/plugin-typescript": "^8.3.0",
54
- "@types/babel__core": "^7.1.12",
55
- "@types/babelify": "^7.3.6",
56
- "@types/benchmark": "^2.1.0",
57
- "@types/browserify": "^12.0.36",
58
- "@types/cssnano": "^4.0.0",
59
- "@types/d3": "^4.13.12",
60
- "@types/diff": "^4.0.2",
46
+ "@types/babel__core": "^7.1.18",
47
+ "@types/babelify": "^7.3.7",
48
+ "@types/benchmark": "^2.1.1",
49
+ "@types/browserify": "^12.0.37",
50
+ "@types/cssnano": "^5.0.0",
51
+ "@types/d3": "^7.1.0",
52
+ "@types/diff": "^5.0.2",
61
53
  "@types/earcut": "^2.1.1",
62
54
  "@types/ejs": "^3.1.0",
63
- "@types/eslint": "^8.2.1",
55
+ "@types/eslint": "^8.4.1",
56
+ "@types/geojson": "^7946.0.8",
64
57
  "@types/gl": "^4.1.0",
65
- "@types/glob": "^7.1.3",
66
- "@types/jest": "^27.0.2",
67
- "@types/jsdom": "^16.2.5",
68
- "@types/jsonwebtoken": "^8.5.5",
58
+ "@types/glob": "^7.2.0",
59
+ "@types/jest": "^27.4.0",
60
+ "@types/jsdom": "^16.2.14",
69
61
  "@types/lodash.template": "^4.5.0",
70
- "@types/minimist": "^1.2.1",
62
+ "@types/mapbox__point-geometry": "^0.1.2",
63
+ "@types/mapbox__vector-tile": "^1.3.0",
64
+ "@types/minimist": "^1.2.2",
71
65
  "@types/murmurhash-js": "^1.0.3",
72
- "@types/node-notifier": "^8.0.0",
73
- "@types/npm-packlist": "^1.1.1",
74
- "@types/offscreencanvas": "^2019.6.3",
75
- "@types/pixelmatch": "^5.2.2",
66
+ "@types/node-notifier": "^8.0.2",
67
+ "@types/offscreencanvas": "^2019.6.4",
68
+ "@types/pbf": "^3.0.2",
69
+ "@types/pixelmatch": "^5.2.4",
76
70
  "@types/pngjs": "^6.0.1",
77
71
  "@types/puppeteer": "^5.4.4",
78
- "@types/react": "^17.0.19",
79
- "@types/react-dom": "^17.0.9",
80
- "@types/request": "^2.48.7",
81
- "@types/rollup-plugin-json": "^3.0.2",
72
+ "@types/react": "^17.0.38",
73
+ "@types/react-dom": "^17.0.11",
74
+ "@types/request": "^2.48.8",
75
+ "@types/rollup-plugin-json": "^3.0.3",
82
76
  "@types/selenium-webdriver": "^4.0.16",
83
77
  "@types/shuffle-seed": "^1.1.0",
84
- "@types/sinon": "^10.0.2",
85
- "@types/stylelint": "^13.13.2",
86
- "@types/supercluster": "^5.0.2",
78
+ "@types/sinon": "^10.0.9",
79
+ "@types/supercluster": "^5.0.3",
87
80
  "@types/tape": "^4.13.2",
88
81
  "@types/window-or-global": "^1.0.4",
89
- "@typescript-eslint/eslint-plugin": "^5.9.1",
90
- "@typescript-eslint/parser": "^5.9.1",
82
+ "@typescript-eslint/eslint-plugin": "^5.10.1",
83
+ "@typescript-eslint/parser": "^5.10.1",
91
84
  "address": "^1.1.2",
92
85
  "babel-eslint": "^10.0.1",
93
- "babel-jest": "^27.2.5",
86
+ "babel-jest": "^27.4.6",
94
87
  "babelify": "^10.0.0",
95
88
  "benchmark": "^2.1.4",
96
89
  "browserify": "^17.0.0",
97
90
  "canvas": "^2.9.0",
98
- "chokidar": "^3.0.2",
99
- "cssnano": "^5.0.8",
100
- "d3": "^4.12.0",
101
- "diff": "^4.0.1",
102
- "documentation": "~12.1.1",
103
- "dts-bundle-generator": "^6.0.0",
91
+ "chokidar": "^3.5.3",
92
+ "cssnano": "^5.0.16",
93
+ "d3": "^7.3.0",
94
+ "d3-queue": "^3.0.7",
95
+ "diff": "^5.0.0",
96
+ "documentation": "13.0.2",
97
+ "dts-bundle-generator": "^6.4.0",
104
98
  "ejs": "^3.1.6",
105
- "eslint": "^7.32.0",
99
+ "eslint": "^8.7.0",
106
100
  "eslint-config-mourner": "^3.0.0",
107
- "eslint-plugin-html": "^6.1.2",
108
- "eslint-plugin-import": "^2.24.2",
109
- "eslint-plugin-jest": "^25.2.2",
110
- "eslint-plugin-jsdoc": "^37.0.3",
111
- "eslint-plugin-react": "^7.25.1",
101
+ "eslint-plugin-html": "^6.2.0",
102
+ "eslint-plugin-import": "^2.25.4",
103
+ "eslint-plugin-jest": "^26.0.0",
104
+ "eslint-plugin-jsdoc": "^37.7.0",
105
+ "eslint-plugin-react": "^7.28.0",
112
106
  "gl": "^5.0.0",
113
- "glob": "^7.1.4",
114
- "is-builtin-module": "^3.0.0",
115
- "jest": "^27.2.4",
107
+ "glob": "^7.2.0",
108
+ "is-builtin-module": "^3.1.0",
109
+ "jest": "^27.4.7",
116
110
  "jest-canvas-mock": "^2.3.1",
117
- "jest-codemods": "^0.25.0",
118
111
  "jest-raw-loader": "^1.0.1",
119
- "jscodeshift": "^0.13.0",
120
- "jsdom": "^13.0.0",
112
+ "jsdom": "^19.0.0",
121
113
  "json-stringify-pretty-compact": "^3.0.0",
122
- "jsonwebtoken": "^8.3.0",
123
- "list-npm-contents": "^1.0.2",
124
- "lodash": "^4.17.19",
125
- "lodash.template": "^4.5.0",
126
114
  "mapbox-gl-styles": "^2.0.2",
127
115
  "minimist": "^1.2.5",
128
116
  "mock-geolocation": "^1.0.11",
129
117
  "node-notifier": "^10.0.0",
130
118
  "node-plantuml": "^0.9.0",
131
119
  "npm-font-open-sans": "^1.1.0",
132
- "npm-packlist": "^3.0.0",
133
120
  "npm-run-all": "^4.1.5",
134
121
  "nyc": "^15.1.0",
135
- "pirates": "^4.0.1",
136
- "pixelmatch": "^5.1.0",
122
+ "pdf-merger-js": "^3.3.2",
123
+ "pixelmatch": "^5.2.1",
137
124
  "pngjs": "^6.0.0",
138
- "postcss": "^8.3.11",
139
- "postcss-cli": "^9.0.2",
125
+ "postcss": "^8.4.5",
126
+ "postcss-cli": "^9.1.0",
140
127
  "postcss-inline-svg": "^5.0.0",
141
- "pretty-bytes": "^5.1.0",
142
- "puppeteer": "^13.0.1",
143
- "qrcode-terminal": "^0.12.0",
128
+ "pretty-bytes": "^5.6.0",
129
+ "puppeteer": "^13.1.2",
144
130
  "react": "^17.0.2",
145
131
  "react-dom": "^17.0.2",
146
- "replace-in-file": "^6.2.0",
147
132
  "request": "^2.88.0",
148
- "rollup": "^2.56.3",
149
- "rollup-plugin-buble": "^0.19.8",
150
- "rollup-plugin-commonjs": "^10.1.0",
151
- "rollup-plugin-node-resolve": "^5.2.0",
152
- "rollup-plugin-replace": "^2.2.0",
133
+ "rollup": "^2.66.1",
153
134
  "rollup-plugin-sourcemaps": "^0.6.3",
154
135
  "rollup-plugin-terser": "^7.0.2",
155
136
  "rollup-plugin-unassert": "^0.3.0",
156
137
  "rollup-pluginutils": "^2.8.2",
157
138
  "rw": "^1.3.3",
158
- "selenium-webdriver": "^4.0.0-rc-1",
139
+ "selenium-webdriver": "^4.1.1",
159
140
  "semver": "^7.3.5",
160
141
  "shuffle-seed": "^1.1.6",
161
142
  "sinon": "^12.0.1",
162
- "source-map-explorer": "^2.5.1",
143
+ "source-map-explorer": "^2.5.2",
163
144
  "st": "^3.0.0",
164
- "stylelint": "^13.13.1",
165
- "stylelint-config-standard": "^22.0.0",
166
- "tap": "~12.4.1",
167
- "tap-parser": "^10.0.1",
168
- "tape": "^5.3.1",
145
+ "stylelint": "^14.3.0",
146
+ "stylelint-config-standard": "^24.0.0",
147
+ "tap-parser": "^10.1.0",
148
+ "tape": "^5.5.0",
169
149
  "tape-filter": "^1.0.4",
170
- "testem": "^3.5.0",
171
- "ts-jest": "^27.0.5",
172
- "ts-node": "^10.2.1",
173
- "typescript": "^4.5.4"
150
+ "testem": "^3.6.0",
151
+ "ts-jest": "^27.1.3",
152
+ "ts-node": "^10.4.0",
153
+ "typescript": "^4.5.5"
174
154
  },
175
155
  "browser": {
176
156
  "./rollup/build/tsc/src/util/web_worker.js": "./build/web_worker_replacement.js"
@@ -203,23 +183,21 @@
203
183
  "test": "run-s lint lint-css lint-docs test-unit",
204
184
  "test-suite": "run-s test-render test-query test-expressions",
205
185
  "test-suite-clean": "find test/integration/{render,query, expressions}-tests -mindepth 2 -type d -exec test -e \"{}/actual.png\" \\; -not \\( -exec test -e \"{}/style.json\" \\; \\) -print | xargs -t rm -r",
206
- "test-unit": "tap --node-arg --no-warnings --node-arg --experimental-specifier-resolution=node --node-arg --experimental-json-modules --reporter classic --no-coverage test/unit",
207
- "test-unit-file": "tap --node-arg --no-warnings --node-arg --experimental-specifier-resolution=node --node-arg --experimental-json-modules --reporter classic --no-coverage ",
208
- "test-build": "tap --node-arg --no-warnings --node-arg --experimental-specifier-resolution=node --node-arg --experimental-json-modules --reporter classic --no-coverage test/build/**/*.test.js",
209
- "test-browser": "tap --node-arg --no-warnings --node-arg --experimental-specifier-resolution=node --node-arg --experimental-json-modules --reporter classic --no-coverage test/browser/**/*.test.js",
186
+ "test-build": "jest ./test/build",
187
+ "test-browser": "jest ./test/browser",
210
188
  "test-render": "node --experimental-specifier-resolution=node --experimental-json-modules --max-old-space-size=2048 test/render.test.js",
211
189
  "watch-query": "testem -f test/integration/testem.cjs",
212
190
  "test-query": "testem ci -f test/integration/testem.cjs -R xunit > test/integration/query-tests/test-results.xml",
213
191
  "test-expressions": "node --experimental-specifier-resolution=node test/expression.test.js",
214
192
  "test-cov": "nyc --reporter=text-summary --reporter=lcov --cache run-s test-unit test-expressions test-query test-render",
215
- "test-jest": "jest",
193
+ "test-unit": "jest ./src",
216
194
  "codegen": "node --loader ts-node/esm --experimental-specifier-resolution=node build/generate-style-code.ts && node --loader ts-node/esm --experimental-specifier-resolution=node build/generate-struct-arrays.ts && node --loader ts-node/esm --experimental-specifier-resolution=node build/generate-style-spec.ts",
195
+ "benchmark": "node bench/run-benchmarks.js",
217
196
  "gl-stats": "node bench/gl-stats.js"
218
197
  },
219
198
  "files": [
220
199
  "build/",
221
- "dist/maplibre-gl*",
222
- "dist/style-spec/",
200
+ "dist/*",
223
201
  "src/"
224
202
  ]
225
203
  }
@@ -1,9 +1,9 @@
1
1
  .maplibregl-map,
2
2
  .mapboxgl-map {
3
- font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
3
+ font: 12px/20px "Helvetica Neue", Arial, Helvetica, sans-serif;
4
4
  overflow: hidden;
5
5
  position: relative;
6
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
6
+ -webkit-tap-highlight-color: rgb(0 0 0 / 0%);
7
7
  }
8
8
 
9
9
  .maplibregl-canvas,
@@ -117,9 +117,9 @@
117
117
 
118
118
  .maplibregl-ctrl-group:not(:empty),
119
119
  .mapboxgl-ctrl-group:not(:empty) {
120
- -moz-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
121
- -webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
122
- box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
120
+ -moz-box-shadow: 0 0 2px rgb(0 0 0 / 10%);
121
+ -webkit-box-shadow: 0 0 2px rgb(0 0 0 / 10%);
122
+ box-shadow: 0 0 0 2px rgb(0 0 0 / 10%);
123
123
  }
124
124
 
125
125
  @media (-ms-high-contrast: active) {
@@ -179,7 +179,7 @@
179
179
  .maplibregl-ctrl-group button:focus,
180
180
  .mapboxgl-ctrl-attrib-button:focus,
181
181
  .mapboxgl-ctrl-group button:focus {
182
- box-shadow: 0 0 2px 2px rgba(0, 150, 255, 1);
182
+ box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);
183
183
  }
184
184
 
185
185
  .maplibregl-ctrl button:disabled,
@@ -194,12 +194,12 @@
194
194
 
195
195
  .maplibregl-ctrl button:not(:disabled):hover,
196
196
  .mapboxgl-ctrl button:not(:disabled):hover {
197
- background-color: rgba(0, 0, 0, 0.05);
197
+ background-color: rgb(0 0 0 / 5%);
198
198
  }
199
199
 
200
200
  .maplibregl-ctrl-group button:focus:focus-visible,
201
201
  .mapboxgl-ctrl-group button:focus:focus-visible {
202
- box-shadow: 0 0 2px 2px rgba(0, 150, 255, 1);
202
+ box-shadow: 0 0 2px 2px rgb(0 150 255 / 100%);
203
203
  }
204
204
 
205
205
  .maplibregl-ctrl-group button:focus:not(:focus-visible),
@@ -224,75 +224,75 @@
224
224
 
225
225
  .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon,
226
226
  .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
227
- background-image: svg-load('svg/maplibregl-ctrl-zoom-out.svg', fill: #333);
227
+ background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #333);
228
228
  }
229
229
 
230
230
  .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
231
231
  .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {
232
- background-image: svg-load('svg/maplibregl-ctrl-zoom-in.svg', fill: #333);
232
+ background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #333);
233
233
  }
234
234
 
235
235
  @media (-ms-high-contrast: active) {
236
236
  .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon,
237
237
  .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
238
- background-image: svg-load('svg/maplibregl-ctrl-zoom-out.svg', fill: #fff);
238
+ background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #fff);
239
239
  }
240
240
 
241
241
  .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
242
242
  .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {
243
- background-image: svg-load('svg/maplibregl-ctrl-zoom-in.svg', fill: #fff);
243
+ background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #fff);
244
244
  }
245
245
  }
246
246
 
247
247
  @media (-ms-high-contrast: black-on-white) {
248
248
  .maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon,
249
249
  .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
250
- background-image: svg-load('svg/maplibregl-ctrl-zoom-out.svg', fill: #000);
250
+ background-image: svg-load("svg/maplibregl-ctrl-zoom-out.svg", fill: #000);
251
251
  }
252
252
 
253
253
  .maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
254
254
  .mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {
255
- background-image: svg-load('svg/maplibregl-ctrl-zoom-in.svg', fill: #000);
255
+ background-image: svg-load("svg/maplibregl-ctrl-zoom-in.svg", fill: #000);
256
256
  }
257
257
  }
258
258
 
259
259
  .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon,
260
260
  .mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {
261
- background-image: svg-load('svg/maplibregl-ctrl-fullscreen.svg', fill: #333);
261
+ background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #333);
262
262
  }
263
263
 
264
264
  .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon,
265
265
  .mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {
266
- background-image: svg-load('svg/maplibregl-ctrl-shrink.svg');
266
+ background-image: svg-load("svg/maplibregl-ctrl-shrink.svg");
267
267
  }
268
268
 
269
269
  @media (-ms-high-contrast: active) {
270
270
  .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon,
271
271
  .mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {
272
- background-image: svg-load('svg/maplibregl-ctrl-fullscreen.svg', fill: #fff);
272
+ background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #fff);
273
273
  }
274
274
 
275
275
  .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon,
276
276
  .mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {
277
- background-image: svg-load('svg/maplibregl-ctrl-shrink.svg', fill: #fff);
277
+ background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #fff);
278
278
  }
279
279
  }
280
280
 
281
281
  @media (-ms-high-contrast: black-on-white) {
282
282
  .maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon,
283
283
  .mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon {
284
- background-image: svg-load('svg/maplibregl-ctrl-fullscreen.svg', fill: #000);
284
+ background-image: svg-load("svg/maplibregl-ctrl-fullscreen.svg", fill: #000);
285
285
  }
286
286
 
287
287
  .maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon,
288
288
  .mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon {
289
- background-image: svg-load('svg/maplibregl-ctrl-shrink.svg', fill: #000);
289
+ background-image: svg-load("svg/maplibregl-ctrl-shrink.svg", fill: #000);
290
290
  }
291
291
  }
292
292
 
293
293
  .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon,
294
294
  .mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon {
295
- background-image: svg-load('svg/maplibregl-ctrl-compass.svg', fill: #333);
295
+ background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #333);
296
296
  }
297
297
 
298
298
  @media (-ms-high-contrast: active) {
@@ -310,7 +310,7 @@
310
310
  @media (-ms-high-contrast: black-on-white) {
311
311
  .maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon,
312
312
  .mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon {
313
- background-image: svg-load('svg/maplibregl-ctrl-compass.svg', fill: #000);
313
+ background-image: svg-load("svg/maplibregl-ctrl-compass.svg", fill: #000);
314
314
  }
315
315
  }
316
316
 
@@ -483,7 +483,7 @@ a.mapboxgl-ctrl-logo {
483
483
  background-repeat: no-repeat;
484
484
  cursor: pointer;
485
485
  overflow: hidden;
486
- background-image: svg-load('svg/maplibregl-ctrl-logo.svg');
486
+ background-image: svg-load("svg/maplibregl-ctrl-logo.svg");
487
487
  }
488
488
 
489
489
  a.maplibregl-ctrl-logo.maplibregl-compact,
@@ -519,7 +519,7 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
519
519
  .maplibregl-ctrl.maplibregl-ctrl-attrib,
520
520
  .mapboxgl-ctrl.mapboxgl-ctrl-attrib {
521
521
  padding: 0 5px;
522
- background-color: rgba(255, 255, 255, 0.5);
522
+ background-color: rgb(255 255 255 / 50%);
523
523
  margin: 0;
524
524
  }
525
525
 
@@ -558,8 +558,8 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
558
558
  display: none;
559
559
  cursor: pointer;
560
560
  position: absolute;
561
- background-image: svg-load('svg/maplibregl-ctrl-attrib.svg');
562
- background-color: rgba(255, 255, 255, 0.5);
561
+ background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");
562
+ background-color: rgb(255 255 255 / 50%);
563
563
  width: 24px;
564
564
  height: 24px;
565
565
  box-sizing: border-box;
@@ -586,7 +586,7 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
586
586
 
587
587
  .maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button,
588
588
  .mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button {
589
- background-color: rgba(0, 0, 0, 0.05);
589
+ background-color: rgb(0 0 0 / 5%);
590
590
  }
591
591
 
592
592
  .maplibregl-ctrl-bottom-right > .maplibregl-ctrl-attrib.maplibregl-compact::after,
@@ -617,20 +617,20 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
617
617
  @media screen and (-ms-high-contrast: active) {
618
618
  .maplibregl-ctrl-attrib.maplibregl-compact::after,
619
619
  .mapboxgl-ctrl-attrib.mapboxgl-compact::after {
620
- background-image: svg-load('svg/maplibregl-ctrl-attrib.svg', fill=#fff);
620
+ background-image: svg-load("svg/maplibregl-ctrl-attrib.svg", fill=#fff);
621
621
  }
622
622
  }
623
623
 
624
624
  @media screen and (-ms-high-contrast: black-on-white) {
625
625
  .maplibregl-ctrl-attrib.maplibregl-compact::after,
626
626
  .mapboxgl-ctrl-attrib.mapboxgl-compact::after {
627
- background-image: svg-load('svg/maplibregl-ctrl-attrib.svg');
627
+ background-image: svg-load("svg/maplibregl-ctrl-attrib.svg");
628
628
  }
629
629
  }
630
630
 
631
631
  .maplibregl-ctrl-attrib a,
632
632
  .mapboxgl-ctrl-attrib a {
633
- color: rgba(0, 0, 0, 0.75);
633
+ color: rgb(0 0 0 / 75%);
634
634
  text-decoration: none;
635
635
  }
636
636
 
@@ -647,7 +647,7 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
647
647
 
648
648
  .maplibregl-ctrl-scale,
649
649
  .mapboxgl-ctrl-scale {
650
- background-color: rgba(255, 255, 255, 0.75);
650
+ background-color: rgb(255 255 255 / 75%);
651
651
  font-size: 10px;
652
652
  border-width: medium 2px 2px;
653
653
  border-style: none solid solid;
@@ -789,7 +789,7 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
789
789
 
790
790
  .maplibregl-popup-close-button:hover,
791
791
  .mapboxgl-popup-close-button:hover {
792
- background-color: rgba(0, 0, 0, 0.05);
792
+ background-color: rgb(0 0 0 / 5%);
793
793
  }
794
794
 
795
795
  .maplibregl-popup-content,
@@ -797,7 +797,7 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
797
797
  position: relative;
798
798
  background: #fff;
799
799
  border-radius: 3px;
800
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
800
+ box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
801
801
  padding: 15px 10px;
802
802
  pointer-events: auto;
803
803
  }
@@ -862,7 +862,7 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
862
862
  .maplibregl-user-location-dot::before,
863
863
  .mapboxgl-user-location-dot::before {
864
864
  background-color: #1da1f2;
865
- content: '';
865
+ content: "";
866
866
  width: 15px;
867
867
  height: 15px;
868
868
  border-radius: 50%;
@@ -877,14 +877,14 @@ a.mapboxgl-ctrl-logo.mapboxgl-compact {
877
877
  .mapboxgl-user-location-dot::after {
878
878
  border-radius: 50%;
879
879
  border: 2px solid #fff;
880
- content: '';
880
+ content: "";
881
881
  height: 19px;
882
882
  left: -2px;
883
883
  position: absolute;
884
884
  top: -2px;
885
885
  width: 19px;
886
886
  box-sizing: border-box;
887
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.35);
887
+ box-shadow: 0 0 3px rgb(0 0 0 / 35%);
888
888
  }
889
889
 
890
890
  @-webkit-keyframes maplibregl-user-location-dot-pulse {
@@ -11,7 +11,7 @@ import {OverscaledTileID} from '../../source/tile_id';
11
11
  import Tile from '../../source/tile';
12
12
  import CrossTileSymbolIndex from '../../symbol/cross_tile_symbol_index';
13
13
  import FeatureIndex from '../../data/feature_index';
14
- import {createSymbolBucket, createSymbolIconBucket} from '../../../test/util/create_symbol_layer_jest';
14
+ import {createSymbolBucket, createSymbolIconBucket} from '../../../test/util/create_symbol_layer';
15
15
  import {RGBAImage} from '../../util/image';
16
16
  import {ImagePosition} from '../../render/image_atlas';
17
17
  import {IndexedFeature, PopulateParameters} from '../bucket';
@@ -48,7 +48,7 @@ import type {
48
48
  } from '../bucket';
49
49
  import type {CollisionBoxArray, CollisionBox, SymbolInstance} from '../array_types';
50
50
  import type {StructArray, StructArrayMember, ViewType} from '../../util/struct_array';
51
- import SymbolStyleLayer from '../../style/style_layer/symbol_style_layer';
51
+ import SymbolStyleLayer, {getOverlapMode} from '../../style/style_layer/symbol_style_layer';
52
52
  import type Context from '../../gl/context';
53
53
  import type IndexBuffer from '../../gl/index_buffer';
54
54
  import type VertexBuffer from '../../gl/vertex_buffer';
@@ -388,8 +388,8 @@ class SymbolBucket implements Bucket {
388
388
  const sortKey = layout.get('symbol-sort-key');
389
389
  const zOrder = layout.get('symbol-z-order');
390
390
  this.canOverlap =
391
- layout.get('text-allow-overlap') ||
392
- layout.get('icon-allow-overlap') ||
391
+ getOverlapMode(layout, 'text-overlap', 'text-allow-overlap') !== 'never' ||
392
+ getOverlapMode(layout, 'icon-overlap', 'icon-allow-overlap') !== 'never' ||
393
393
  layout.get('text-ignore-placement') ||
394
394
  layout.get('icon-ignore-placement');
395
395
  this.sortFeaturesByKey = zOrder !== 'viewport-y' && !sortKey.isConstant();
@@ -129,7 +129,7 @@ class ConstantBinder implements UniformBinder {
129
129
 
130
130
  class CrossFadedConstantBinder implements UniformBinder {
131
131
  uniformNames: Array<string>;
132
- patternFrom: Array<number> ;
132
+ patternFrom: Array<number>;
133
133
  patternTo: Array<number>;
134
134
  pixelRatioFrom: number;
135
135
  pixelRatioTo: number;
@@ -55,7 +55,7 @@ function drawDebugSSRect(painter: Painter, x: number, y: number, width: number,
55
55
  const gl = context.gl;
56
56
 
57
57
  gl.enable(gl.SCISSOR_TEST);
58
- gl.scissor(x * devicePixelRatio, y * devicePixelRatio, width * devicePixelRatio, height * devicePixelRatio);
58
+ gl.scissor(x * painter.pixelRatio, y * painter.pixelRatio, width * painter.pixelRatio, height * painter.pixelRatio);
59
59
  context.clear({color});
60
60
  gl.disable(gl.SCISSOR_TEST);
61
61
  }
@@ -103,7 +103,7 @@ export default class GlyphManager {
103
103
  let requests = entry.requests[range];
104
104
  if (!requests) {
105
105
  requests = entry.requests[range] = [];
106
- GlyphManager.loadGlyphRange(stack, range, this.url as any, this.requestManager,
106
+ GlyphManager.loadGlyphRange(stack, range, this.url, this.requestManager,
107
107
  (err, response?: {
108
108
  [_: number]: StyleGlyph | null;
109
109
  } | null) => {
@@ -92,6 +92,7 @@ class Painter {
92
92
  emptyProgramConfiguration: ProgramConfiguration;
93
93
  width: number;
94
94
  height: number;
95
+ pixelRatio: number;
95
96
  tileExtentBuffer: VertexBuffer;
96
97
  tileExtentSegments: SegmentVector;
97
98
  debugBuffer: VertexBuffer;
@@ -146,9 +147,10 @@ class Painter {
146
147
  * Update the GL viewport, projection matrix, and transforms to compensate
147
148
  * for a new width and height value.
148
149
  */
149
- resize(width: number, height: number) {
150
- this.width = width * devicePixelRatio;
151
- this.height = height * devicePixelRatio;
150
+ resize(width: number, height: number, pixelRatio: number) {
151
+ this.width = width * pixelRatio;
152
+ this.height = height * pixelRatio;
153
+ this.pixelRatio = pixelRatio;
152
154
  this.context.viewport.set([0, 0, this.width, this.height]);
153
155
 
154
156
  if (this.style) {
@@ -53,7 +53,7 @@ const circleUniformValues = (
53
53
  layer.paint.get('circle-translate'),
54
54
  layer.paint.get('circle-translate-anchor')),
55
55
  'u_pitch_with_map': +(pitchWithMap),
56
- 'u_device_pixel_ratio': devicePixelRatio,
56
+ 'u_device_pixel_ratio': painter.pixelRatio,
57
57
  'u_extrude_scale': extrudeScale
58
58
  };
59
59
  };