maplibre-gl 6.0.0-8 → 6.0.0-9
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 +0 -2
- package/build/banner.ts +4 -2
- package/build/generate-docs.ts +28 -12
- package/build/generate-struct-arrays.ts +6 -6
- package/build/generate-style-code.ts +1 -1
- package/build/readme.md +1 -1
- package/dist/maplibre-gl-dev.mjs +1815 -1676
- package/dist/maplibre-gl-dev.mjs.map +1 -1
- package/dist/maplibre-gl-worker-dev.mjs +1633 -1581
- package/dist/maplibre-gl-worker-dev.mjs.map +1 -1
- package/dist/maplibre-gl-worker.mjs +2 -2
- package/dist/maplibre-gl-worker.mjs.map +1 -1
- package/dist/maplibre-gl.d.ts +10631 -10460
- package/dist/maplibre-gl.mjs +35 -35
- package/dist/maplibre-gl.mjs.map +1 -1
- package/package.json +14 -14
- package/src/data/array_types.g.ts +137 -137
- package/src/data/bucket/circle_attributes.ts +5 -3
- package/src/data/bucket/circle_bucket.ts +7 -7
- package/src/data/bucket/dash_attributes.ts +2 -2
- package/src/data/bucket/fill_attributes.ts +5 -3
- package/src/data/bucket/fill_bucket.ts +7 -7
- package/src/data/bucket/fill_extrusion_attributes.ts +6 -4
- package/src/data/bucket/fill_extrusion_bucket.ts +9 -9
- package/src/data/bucket/line_attributes.ts +5 -3
- package/src/data/bucket/line_attributes_ext.ts +5 -3
- package/src/data/bucket/line_bucket.ts +13 -13
- package/src/data/bucket/pattern_attributes.ts +2 -2
- package/src/data/bucket/pattern_bucket_features.ts +2 -2
- package/src/data/bucket/symbol_attributes.ts +14 -14
- package/src/data/bucket/symbol_bucket.ts +36 -35
- package/src/data/dem_data.ts +6 -6
- package/src/data/feature_index.ts +3 -3
- package/src/data/feature_position_map.ts +1 -1
- package/src/data/pos3d_attributes.ts +4 -2
- package/src/data/pos_attributes.ts +4 -2
- package/src/data/program_configuration.ts +12 -12
- package/src/data/raster_bounds_attributes.ts +4 -2
- package/src/data/segment.ts +3 -3
- package/src/geo/bounds.ts +2 -2
- package/src/geo/lng_lat.ts +1 -1
- package/src/geo/lng_lat_bounds.ts +2 -2
- package/src/geo/mercator_coordinate.ts +8 -8
- package/src/geo/projection/camera_helper.ts +2 -2
- package/src/geo/projection/globe_covering_tiles_details_provider.ts +2 -2
- package/src/geo/projection/globe_projection.ts +4 -4
- package/src/geo/projection/globe_projection_error_measurement.ts +1 -1
- package/src/geo/projection/globe_utils.ts +2 -2
- package/src/geo/projection/mercator_projection.ts +1 -1
- package/src/geo/projection/mercator_transform.ts +2 -2
- package/src/geo/projection/projection.ts +1 -1
- package/src/geo/projection/vertical_perspective_projection.ts +2 -2
- package/src/geo/transform_helper.ts +15 -15
- package/src/index.ts +10 -8
- package/src/render/fill_large_mesh_arrays.ts +1 -1
- package/src/render/glyph_manager.ts +5 -5
- package/src/render/image_atlas.ts +3 -3
- package/src/render/image_manager.ts +15 -15
- package/src/render/line_atlas.ts +8 -6
- package/src/render/painter.ts +19 -19
- package/src/render/subdivision_granularity_settings.ts +1 -1
- package/src/render/terrain.ts +5 -5
- package/src/shaders/encode_attribute.ts +1 -1
- package/src/shaders/shaders.ts +40 -1
- package/src/source/canvas_source.ts +6 -6
- package/src/source/geojson_source.test.ts +28 -33
- package/src/source/geojson_source.ts +19 -19
- package/src/source/image_source.ts +5 -5
- package/src/source/protocol_crud.ts +3 -3
- package/src/source/raster_dem_tile_source.test.ts +4 -4
- package/src/source/raster_dem_tile_source.ts +3 -2
- package/src/source/raster_dem_tile_worker_source.ts +1 -1
- package/src/source/raster_tile_source.ts +9 -9
- package/src/source/rtl_text_plugin_worker.ts +4 -4
- package/src/source/source_state.test.ts +40 -1
- package/src/source/source_state.ts +17 -9
- package/src/source/vector_tile_overzoomed.ts +3 -3
- package/src/source/vector_tile_source.ts +7 -6
- package/src/source/video_source.ts +7 -7
- package/src/style/create_style_layer.ts +14 -1
- package/src/style/evaluation_parameters.ts +1 -1
- package/src/style/format_section_override.ts +2 -2
- package/src/style/light.ts +5 -5
- package/src/style/parse_glyph_pbf.ts +1 -1
- package/src/style/pauseable_placement.ts +4 -4
- package/src/style/properties.ts +8 -8
- package/src/style/query_utils.ts +4 -4
- package/src/style/sky.ts +6 -6
- package/src/style/style.test.ts +26 -0
- package/src/style/style.ts +76 -65
- package/src/style/style_image.ts +1 -1
- package/src/style/style_layer/background_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/circle_style_layer.ts +1 -1
- package/src/style/style_layer/circle_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/color_relief_style_layer.ts +1 -1
- package/src/style/style_layer/color_relief_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/custom_style_layer.ts +9 -9
- package/src/style/style_layer/fill_extrusion_style_layer.ts +2 -2
- package/src/style/style_layer/fill_extrusion_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/fill_style_layer.ts +3 -3
- package/src/style/style_layer/fill_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/heatmap_style_layer.ts +5 -5
- package/src/style/style_layer/heatmap_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/hillshade_style_layer.ts +1 -1
- package/src/style/style_layer/hillshade_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/line_style_layer.ts +12 -12
- package/src/style/style_layer/line_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/raster_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/symbol_style_layer.ts +4 -4
- package/src/style/style_layer/symbol_style_layer_properties.g.ts +1 -1
- package/src/style/style_layer/variable_text_anchor.ts +1 -1
- package/src/style/style_layer.ts +17 -17
- package/src/style/style_layer_index.ts +2 -2
- package/src/style/validate_style.ts +7 -7
- package/src/style/zoom_history.ts +1 -1
- package/src/symbol/anchor.ts +1 -1
- package/src/symbol/check_max_angle.ts +1 -1
- package/src/symbol/collision_index.ts +15 -9
- package/src/symbol/cross_tile_symbol_index.ts +9 -9
- package/src/symbol/get_anchors.ts +1 -1
- package/src/symbol/grid_index.ts +3 -3
- package/src/symbol/opacity_state.ts +1 -1
- package/src/symbol/path_interpolator.ts +1 -1
- package/src/symbol/placement.ts +15 -15
- package/src/symbol/projection.ts +6 -6
- package/src/symbol/shaping.ts +1 -1
- package/src/symbol/symbol_layout.ts +1 -1
- package/src/symbol/symbol_size.ts +1 -1
- package/src/symbol/tagged_string.ts +7 -7
- package/src/tile/terrain_tile_manager.test.ts +3 -3
- package/src/tile/terrain_tile_manager.ts +4 -4
- package/src/tile/tile.test.ts +24 -0
- package/src/tile/tile.ts +30 -21
- package/src/tile/tile_bounds.ts +1 -1
- package/src/tile/tile_cache.ts +4 -4
- package/src/tile/tile_id.ts +17 -17
- package/src/tile/tile_manager.ts +38 -35
- package/src/tile/tile_manager_in_view_tiles.test.ts +22 -1
- package/src/tile/tile_manager_in_view_tiles.ts +7 -6
- package/src/tile/tile_manager_raster.ts +2 -2
- package/src/tile/tile_manager_raster_dem.ts +1 -1
- package/src/ui/anchor.ts +1 -1
- package/src/ui/camera.ts +13 -13
- package/src/ui/control/attribution_control.test.ts +4 -2
- package/src/ui/control/attribution_control.ts +8 -8
- package/src/ui/control/fullscreen_control.ts +11 -11
- package/src/ui/control/geolocate_control.ts +15 -15
- package/src/ui/control/globe_control.test.ts +4 -2
- package/src/ui/control/globe_control.ts +4 -4
- package/src/ui/control/logo_control.test.ts +3 -2
- package/src/ui/control/logo_control.ts +3 -3
- package/src/ui/control/navigation_control.ts +17 -17
- package/src/ui/control/scale_control.ts +6 -6
- package/src/ui/control/terrain_control.test.ts +5 -2
- package/src/ui/control/terrain_control.ts +4 -4
- package/src/ui/events.ts +3 -3
- package/src/ui/handler/box_zoom.ts +10 -10
- package/src/ui/handler/click_zoom.ts +7 -7
- package/src/ui/handler/cooperative_gestures.ts +7 -7
- package/src/ui/handler/drag_handler.ts +14 -14
- package/src/ui/handler/drag_move_state_manager.ts +23 -23
- package/src/ui/handler/handler_util.ts +2 -2
- package/src/ui/handler/keyboard.ts +8 -8
- package/src/ui/handler/map_event.ts +27 -27
- package/src/ui/handler/mouse.ts +1 -1
- package/src/ui/handler/scroll_zoom.ts +21 -15
- package/src/ui/handler/shim/dblclick_zoom.ts +4 -4
- package/src/ui/handler/shim/drag_pan.ts +4 -4
- package/src/ui/handler/shim/drag_rotate.ts +4 -4
- package/src/ui/handler/shim/two_fingers_touch.ts +8 -8
- package/src/ui/handler/tap_drag_zoom.ts +10 -10
- package/src/ui/handler/tap_recognizer.ts +8 -8
- package/src/ui/handler/tap_zoom.ts +9 -9
- package/src/ui/handler/touch_pan.ts +11 -11
- package/src/ui/handler/transform-provider.ts +4 -4
- package/src/ui/handler/two_fingers_touch.ts +3 -3
- package/src/ui/handler_inertia.ts +3 -3
- package/src/ui/handler_manager.ts +20 -20
- package/src/ui/hash.ts +9 -9
- package/src/ui/map.ts +36 -36
- package/src/ui/map_tests/map_bounds.test.ts +2 -2
- package/src/ui/map_tests/map_canvas.test.ts +2 -1
- package/src/ui/marker.ts +11 -11
- package/src/ui/popup.ts +10 -10
- package/src/util/abort_error.ts +1 -1
- package/src/util/actor.test.ts +17 -19
- package/src/util/actor.ts +11 -8
- package/src/util/ajax.ts +2 -2
- package/src/util/browser.ts +4 -2
- package/src/util/dictionary_coder.ts +2 -2
- package/src/util/dispatcher.test.ts +12 -14
- package/src/util/dispatcher.ts +39 -19
- package/src/util/dom.ts +5 -5
- package/src/util/evented.ts +3 -3
- package/src/util/find_pole_of_inaccessibility.ts +1 -1
- package/src/util/global_worker_pool.ts +4 -4
- package/src/util/image.ts +8 -8
- package/src/util/intersection_tests.ts +6 -6
- package/src/util/primitives/bounding_volume_cache.ts +1 -1
- package/src/util/ref_properties.ts +7 -1
- package/src/util/request_manager.ts +2 -2
- package/src/util/request_performance.ts +1 -1
- package/src/util/script_detection.ts +10 -10
- package/src/util/struct_array.ts +19 -11
- package/src/util/task_queue.ts +3 -3
- package/src/util/test/null_gl.ts +294 -292
- package/src/util/test/util.ts +35 -20
- package/src/util/throttled_invoker.ts +2 -2
- package/src/util/transferable_grid_index.ts +8 -8
- package/src/util/util.ts +6 -6
- package/src/util/vectortile_to_geojson.ts +1 -1
- package/src/util/verticalize_punctuation.ts +1 -1
- package/src/util/web_worker.test.ts +39 -11
- package/src/util/web_worker.ts +54 -4
- package/src/util/web_worker_transfer.test.ts +4 -0
- package/src/util/web_worker_transfer.ts +1 -1
- package/src/util/worker_pool.test.ts +11 -14
- package/src/util/worker_pool.ts +19 -17
- package/src/webgl/context.ts +13 -13
- package/src/webgl/draw/draw_background.ts +1 -1
- package/src/webgl/draw/draw_circle.ts +1 -1
- package/src/webgl/draw/draw_collision_debug.ts +1 -1
- package/src/webgl/draw/draw_color_relief.ts +1 -1
- package/src/webgl/draw/draw_custom.ts +1 -1
- package/src/webgl/draw/draw_debug.ts +2 -2
- package/src/webgl/draw/draw_fill.ts +1 -1
- package/src/webgl/draw/draw_fill_extrusion.ts +1 -1
- package/src/webgl/draw/draw_heatmap.ts +1 -1
- package/src/webgl/draw/draw_hillshade.ts +1 -1
- package/src/webgl/draw/draw_line.ts +1 -1
- package/src/webgl/draw/draw_raster.ts +1 -1
- package/src/webgl/draw/draw_sky.ts +2 -2
- package/src/webgl/draw/draw_symbol.ts +1 -1
- package/src/webgl/draw/draw_terrain.ts +3 -3
- package/src/webgl/framebuffer.ts +1 -1
- package/src/webgl/index_buffer.ts +3 -3
- package/src/webgl/program/program_uniforms.ts +55 -17
- package/src/webgl/program.ts +1 -1
- package/src/webgl/render_to_texture.test.ts +5 -5
- package/src/webgl/render_to_texture.ts +1 -1
- package/src/webgl/texture.ts +4 -4
- package/src/webgl/value.ts +30 -30
- package/src/webgl/vertex_array_object.ts +3 -3
- package/src/webgl/vertex_buffer.ts +5 -5
package/README.md
CHANGED
|
@@ -29,8 +29,6 @@ Include the following code in the `<body>` of your HTML file.
|
|
|
29
29
|
<script type='module'>
|
|
30
30
|
import * as maplibregl from 'https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.mjs';
|
|
31
31
|
|
|
32
|
-
maplibregl.setWorkerUrl('https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl-worker.mjs');
|
|
33
|
-
|
|
34
32
|
const map = new maplibregl.Map({
|
|
35
33
|
container: 'map',
|
|
36
34
|
style: 'https://demotiles.maplibre.org/style.json', // stylesheet location
|
package/build/banner.ts
CHANGED
|
@@ -5,8 +5,10 @@ import {dirname, join} from 'path';
|
|
|
5
5
|
const packageJSONPath = join(dirname(fileURLToPath(import.meta.url)), '../package.json');
|
|
6
6
|
const packageJSON = JSON.parse(readFileSync(packageJSONPath, 'utf8'));
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
`/**
|
|
8
|
+
const banner: string =
|
|
9
|
+
`/**
|
|
10
10
|
* MapLibre GL JS
|
|
11
11
|
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v${packageJSON.version}/LICENSE.txt
|
|
12
12
|
*/`;
|
|
13
|
+
|
|
14
|
+
export default banner;
|
package/build/generate-docs.ts
CHANGED
|
@@ -95,28 +95,44 @@ function generateMarkdownForExample(title: string, description: string, file: st
|
|
|
95
95
|
|
|
96
96
|
${description}
|
|
97
97
|
|
|
98
|
-
<iframe src="
|
|
98
|
+
<iframe src="${file}" width="100%" style="border:none; height:400px"></iframe>
|
|
99
99
|
|
|
100
100
|
${codeBlock}
|
|
101
101
|
`;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
/**
|
|
105
|
+
* This method converts png files to webp files in order to improve performance of docs,
|
|
106
|
+
* This is considered a build artifact and should not be checked in, but generated as part of the docs generation process.
|
|
107
|
+
*/
|
|
108
|
+
async function packImages(indexArray: HtmlDoc[]) {
|
|
106
109
|
const promises: Array<Promise<any>> = [];
|
|
107
110
|
for (const indexArrayItem of indexArray) {
|
|
108
111
|
const imagePath = `docs/assets/examples/${indexArrayItem.mdFileName.replace('.md', '.png')}`;
|
|
109
112
|
const outputPath = imagePath.replace('.png', '.webp');
|
|
110
113
|
promises.push(sharp(imagePath).webp({quality: 90, lossless: false}).toFile(outputPath));
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}){ loading=lazy }
|
|
114
|
+
}
|
|
115
|
+
await Promise.all(promises);
|
|
116
|
+
}
|
|
115
117
|
|
|
116
|
-
|
|
118
|
+
function generateMarkdownIndexFileOfAllExamples(indexArray: HtmlDoc[]): string {
|
|
119
|
+
let indexMarkdown = '# Overview\n\n<div class="examples-grid">\n';
|
|
120
|
+
for (const indexArrayItem of indexArray) {
|
|
121
|
+
const cardImg = `../assets/examples/${indexArrayItem.mdFileName.replace('.md', '.webp')}`;
|
|
122
|
+
const desc = indexArrayItem.description || '';
|
|
123
|
+
const cardFileName = indexArrayItem.mdFileName.replace(/.md$/, '/');
|
|
124
|
+
indexMarkdown += `<a class="example-card" href="./${cardFileName}">
|
|
125
|
+
<div class="example-card-image">
|
|
126
|
+
<img src="${cardImg}" loading="lazy" alt="${desc}">
|
|
127
|
+
${indexArrayItem.isNew ? '<span class="example-card-badge">new</span>' : ''}
|
|
128
|
+
</div>
|
|
129
|
+
<div class="example-card-content">
|
|
130
|
+
<h3>${indexArrayItem.title}</h3>
|
|
131
|
+
<p>${desc}</p>
|
|
132
|
+
</div>
|
|
133
|
+
</a>
|
|
117
134
|
`;
|
|
118
135
|
}
|
|
119
|
-
await Promise.all(promises);
|
|
120
136
|
return indexMarkdown;
|
|
121
137
|
}
|
|
122
138
|
|
|
@@ -169,8 +185,8 @@ async function generateExamplesFolder() {
|
|
|
169
185
|
const exampleMarkdown = generateMarkdownForExample(title, description, file, htmlContent, isNew);
|
|
170
186
|
fs.writeFileSync(path.join(examplesDocsFolder, mdFileName), exampleMarkdown);
|
|
171
187
|
}
|
|
172
|
-
|
|
173
|
-
const indexMarkdown =
|
|
188
|
+
await packImages(indexArray);
|
|
189
|
+
const indexMarkdown = generateMarkdownIndexFileOfAllExamples(indexArray);
|
|
174
190
|
fs.writeFileSync(path.join(examplesDocsFolder, 'index.md'), indexMarkdown);
|
|
175
191
|
}
|
|
176
192
|
|
|
@@ -235,7 +251,7 @@ function updateMapLibreVersionForUNPKG() {
|
|
|
235
251
|
let indexContent = fs.readFileSync(indexPath, 'utf-8');
|
|
236
252
|
|
|
237
253
|
// Replace the version number
|
|
238
|
-
indexContent = indexContent.replace(/unpkg\.com\/maplibre-gl@\^
|
|
254
|
+
indexContent = indexContent.replace(/unpkg\.com\/maplibre-gl@\^[^/'"]+/g, `unpkg.com/maplibre-gl@^${packageJson.version}`);
|
|
239
255
|
|
|
240
256
|
// Save index.md
|
|
241
257
|
fs.writeFileSync(indexPath, indexContent);
|
|
@@ -247,7 +247,7 @@ class ${structArrayLayoutClass} extends StructArray {`);
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
output.push(`
|
|
250
|
-
_refreshViews() {`);
|
|
250
|
+
_refreshViews(): void {`);
|
|
251
251
|
|
|
252
252
|
for (const type of usedTypes) {
|
|
253
253
|
output.push(
|
|
@@ -279,13 +279,13 @@ class ${structArrayLayoutClass} extends StructArray {`);
|
|
|
279
279
|
|
|
280
280
|
output.push(
|
|
281
281
|
`
|
|
282
|
-
public emplaceBack(${argNamesTyped.join(', ')}) {
|
|
282
|
+
public emplaceBack(${argNamesTyped.join(', ')}): number {
|
|
283
283
|
const i = this.length;
|
|
284
284
|
this.resize(i + 1);
|
|
285
285
|
return this.emplace(i, ${argNames.join(', ')});
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
public emplace(i: number, ${argNamesTyped.join(', ')}) {`);
|
|
288
|
+
public emplace(i: number, ${argNamesTyped.join(', ')}): number {`);
|
|
289
289
|
|
|
290
290
|
for (const size of usedTypeSizes) {
|
|
291
291
|
output.push(
|
|
@@ -361,7 +361,7 @@ class ${structTypeClass} extends Struct {
|
|
|
361
361
|
const componentAccess = `this._structArray.${member.view}[${index}]`;
|
|
362
362
|
|
|
363
363
|
output.push(
|
|
364
|
-
` get ${name}() { return ${componentAccess}; }`);
|
|
364
|
+
` get ${name}(): number { return ${componentAccess}; }`);
|
|
365
365
|
|
|
366
366
|
// generate setters for properties that are updated during runtime symbol placement; others are read-only
|
|
367
367
|
if (name === 'crossTileID' || name === 'placedOrientation' || name === 'hidden') {
|
|
@@ -373,7 +373,7 @@ class ${structTypeClass} extends Struct {
|
|
|
373
373
|
// Special case used for the CollisionBoxArray type
|
|
374
374
|
if (hasAnchorPoint) {
|
|
375
375
|
output.push(
|
|
376
|
-
' get anchorPoint() { return new Point(this.anchorPointX, this.anchorPointY); }');
|
|
376
|
+
' get anchorPoint(): Point { return new Point(this.anchorPointX, this.anchorPointY); }');
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
output.push(
|
|
@@ -400,7 +400,7 @@ export class ${structArrayClass} extends ${structArrayLayoutClass} {`);
|
|
|
400
400
|
const componentOffset = (member.offset / member.size + c).toFixed(0);
|
|
401
401
|
const componentStride = size / member.size;
|
|
402
402
|
output.push(
|
|
403
|
-
` ${name}(index: number) { return this.${member.view}[index * ${componentStride} + ${componentOffset}]; }`);
|
|
403
|
+
` ${name}(index: number): number { return this.${member.view}[index * ${componentStride} + ${componentOffset}]; }`);
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
} else if (includeStructAccessors) { // get(i)
|
|
@@ -278,7 +278,7 @@ const getPaint = () => paint = paint || new Properties({`);
|
|
|
278
278
|
output.push(
|
|
279
279
|
`});
|
|
280
280
|
|
|
281
|
-
export default ({ get paint() { return getPaint() }${layoutProperties.length ?
|
|
281
|
+
export default ({ get paint(): Properties<${layerType}PaintProps> { return getPaint() }${layoutProperties.length ? `, get layout(): Properties<${layerType}LayoutProps> { return getLayout() }` : ''} });`);
|
|
282
282
|
|
|
283
283
|
return output.join('\n');
|
|
284
284
|
}
|
package/build/readme.md
CHANGED
|
@@ -16,7 +16,7 @@ These commands will use [rolldown](https://rolldown.rs/) to bundle the code as E
|
|
|
16
16
|
- `dist/maplibre-gl.mjs` (main bundle, entry: `src/index.ts`)
|
|
17
17
|
- `dist/maplibre-gl-worker.mjs` (worker bundle, entry: `src/source/worker.ts`)
|
|
18
18
|
|
|
19
|
-
The main bundle creates the worker via `new Worker(url, {type: 'module'})
|
|
19
|
+
The main bundle creates the worker via `new Worker(url, {type: 'module'})`. The URL defaults to a sibling of the loaded module (resolved via `import.meta.url`) and can be overridden by calling `setWorkerUrl()`. Cross-origin URLs are fetched via CORS and laundered through a same-origin Blob URL, since the `Worker` constructor rejects cross-origin URLs even when CORS allows the fetch.
|
|
20
20
|
|
|
21
21
|
`banner.ts` is used to create a banner at the beginning of the output file.
|
|
22
22
|
|