maplibre-gl 2.0.0-pre.5 → 2.0.2
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/CHANGELOG.md +39 -4
- package/README.md +41 -9
- package/build/generate-struct-arrays.ts +439 -0
- package/build/generate-style-code.ts +275 -0
- package/build/generate-style-spec.ts +209 -0
- package/build/glsl_to_js.js +12 -0
- package/build/post-ts-build.js +52 -0
- package/build/readme.md +62 -0
- package/build/release-notes.js +6 -5
- package/build/rollup_plugins.js +24 -2
- package/build/web_worker_replacement.js +1 -1
- package/dist/maplibre-gl.css +1 -1
- package/dist/maplibre-gl.d.ts +10696 -0
- package/dist/maplibre-gl.js +6 -6
- package/dist/maplibre-gl.js.map +1 -1
- package/dist/package.json +1 -0
- package/package.json +50 -38
- package/src/css/maplibre-gl.css +1 -1
- package/src/data/array_types.ts +22 -21
- package/src/data/bucket/circle_bucket.ts +1 -0
- package/src/data/bucket/fill_bucket.test.ts +94 -0
- package/src/data/bucket/fill_bucket.ts +1 -0
- package/src/data/bucket/fill_extrusion_bucket.ts +1 -0
- package/src/data/bucket/line_bucket.test.ts +142 -0
- package/src/data/bucket/line_bucket.ts +1 -0
- package/src/data/bucket/symbol_bucket.test.ts +229 -0
- package/src/data/bucket/symbol_bucket.ts +1 -0
- package/src/data/bucket.ts +1 -0
- package/src/data/dem_data.test.ts +269 -0
- package/src/data/evaluation_feature.ts +1 -0
- package/src/data/feature_index.ts +9 -8
- package/src/data/feature_position_map.test.ts +33 -0
- package/src/data/load_geometry.test.ts +49 -0
- package/src/data/load_geometry.ts +1 -0
- package/src/data/program_configuration.ts +1 -0
- package/src/geo/edge_insets.test.ts +83 -0
- package/src/geo/edge_insets.ts +34 -4
- package/src/geo/lng_lat.test.ts +75 -0
- package/src/geo/lng_lat.ts +2 -2
- package/src/geo/lng_lat_bounds.test.ts +204 -0
- package/src/geo/mercator_coordinate.test.ts +34 -0
- package/src/geo/transform.test.ts +341 -0
- package/src/geo/transform.ts +1 -1
- package/src/gl/context.ts +3 -3
- package/src/gl/state.test.ts +191 -0
- package/src/gl/stencil_mode.ts +3 -3
- package/src/gl/types.ts +1 -1
- package/src/gl/value.ts +3 -3
- package/src/gl/vertex_buffer.test.ts +52 -0
- package/src/index.test.ts +7 -0
- package/src/index.ts +12 -15
- package/src/render/glyph_manager.test.ts +170 -0
- package/src/render/glyph_manager.ts +15 -15
- package/src/render/image_atlas.ts +1 -7
- package/src/render/image_manager.ts +2 -2
- package/src/render/line_atlas.test.ts +38 -0
- package/src/render/painter.ts +1 -1
- package/src/render/uniform_binding.test.ts +122 -0
- package/src/shaders/encode_attribute.test.ts +11 -0
- package/src/shaders/fill_pattern.fragment.glsl +3 -0
- package/src/shaders/line_pattern.fragment.glsl +3 -0
- package/src/source/canvas_source.test.ts +180 -0
- package/src/source/geojson_source.test.ts +353 -0
- package/src/source/geojson_source.ts +34 -47
- package/src/source/geojson_worker_source.test.ts +277 -0
- package/src/source/geojson_wrapper.test.ts +32 -0
- package/src/source/geojson_wrapper.ts +2 -1
- package/src/source/image_source.ts +4 -4
- package/src/source/query_features.test.ts +36 -0
- package/src/source/query_features.ts +5 -1
- package/src/source/raster_dem_tile_source.test.ts +152 -0
- package/src/source/raster_dem_tile_worker_source.test.ts +38 -0
- package/src/source/raster_tile_source.test.ts +141 -0
- package/src/source/source.ts +3 -3
- package/src/source/source_cache.test.ts +1594 -0
- package/src/source/tile.test.ts +290 -0
- package/src/source/tile.ts +6 -1
- package/src/source/tile_cache.test.ts +131 -0
- package/src/source/tile_id.test.ts +114 -0
- package/src/source/tile_id.ts +1 -0
- package/src/source/vector_tile_source.test.ts +345 -0
- package/src/source/vector_tile_source.ts +4 -4
- package/src/source/vector_tile_worker_source.ts +1 -0
- package/src/source/video_source.test.ts +64 -0
- package/src/source/video_source.ts +1 -1
- package/src/source/worker.test.ts +152 -0
- package/src/source/worker_tile.test.ts +102 -0
- package/src/source/worker_tile.ts +1 -0
- package/src/style/format_section_override.test.ts +64 -0
- package/src/style/light.test.ts +88 -0
- package/src/style/load_glyph_range.test.ts +45 -0
- package/src/style/load_glyph_range.ts +1 -1
- package/src/style/style.test.ts +2119 -0
- package/src/style/style.ts +21 -21
- package/src/style/style_image.ts +62 -60
- package/src/style/style_layer/background_style_layer.ts +5 -5
- package/src/style/style_layer/background_style_layer_properties.ts +13 -16
- package/src/style/style_layer/circle_style_layer.ts +8 -7
- package/src/style/style_layer/circle_style_layer_properties.ts +37 -36
- package/src/style/style_layer/custom_style_layer.ts +82 -79
- package/src/style/style_layer/fill_extrusion_style_layer.ts +9 -6
- package/src/style/style_layer/fill_extrusion_style_layer_properties.ts +27 -26
- package/src/style/style_layer/fill_style_layer.test.ts +37 -0
- package/src/style/style_layer/fill_style_layer.ts +8 -7
- package/src/style/style_layer/fill_style_layer_properties.ts +29 -28
- package/src/style/style_layer/heatmap_style_layer.ts +5 -5
- package/src/style/style_layer/heatmap_style_layer_properties.ts +19 -21
- package/src/style/style_layer/hillshade_style_layer.ts +5 -5
- package/src/style/style_layer/hillshade_style_layer_properties.ts +22 -23
- package/src/style/style_layer/line_style_layer.ts +8 -7
- package/src/style/style_layer/line_style_layer_properties.ts +43 -43
- package/src/style/style_layer/raster_style_layer.ts +5 -5
- package/src/style/style_layer/raster_style_layer_properties.ts +28 -26
- package/src/style/style_layer/symbol_style_layer.ts +9 -9
- package/src/style/style_layer/symbol_style_layer_properties.ts +124 -124
- package/src/style/style_layer.test.ts +373 -0
- package/src/style/style_layer.ts +18 -20
- package/src/style/style_layer_index.test.ts +99 -0
- package/src/style-spec/CHANGELOG.md +11 -0
- package/src/style-spec/composite.test.ts +106 -0
- package/src/style-spec/declass.test.ts +118 -0
- package/src/style-spec/deref.test.ts +47 -0
- package/src/style-spec/diff.test.ts +413 -0
- package/src/style-spec/empty.test.ts +14 -0
- package/src/style-spec/expression/expression.test.ts +64 -0
- package/src/style-spec/expression/stops.test.ts +23 -0
- package/src/style-spec/feature_filter/convert.ts +11 -11
- package/src/style-spec/feature_filter/feature_filter.test.ts +624 -0
- package/src/style-spec/format.test.ts +30 -0
- package/src/style-spec/format.ts +2 -2
- package/src/style-spec/function/index.test.ts +988 -0
- package/src/style-spec/group_by_layout.test.ts +64 -0
- package/src/style-spec/migrate/v8.test.ts +507 -0
- package/src/style-spec/migrate/v9.test.ts +76 -0
- package/src/style-spec/package.json +2 -1
- package/src/style-spec/reference/v8.json +11 -11
- package/src/style-spec/style-spec.test.ts +201 -0
- package/src/style-spec/types.ts +376 -364
- package/src/style-spec/util/color.test.ts +18 -0
- package/src/style-spec/util/color_spaces.test.ts +28 -0
- package/src/style-spec/util/interpolate.test.ts +16 -0
- package/src/style-spec/validate_style.min.ts +1 -1
- package/src/symbol/anchor.test.ts +14 -0
- package/src/symbol/check_max_angle.test.ts +48 -0
- package/src/symbol/clip_line.test.ts +154 -0
- package/src/symbol/collision_feature.test.ts +81 -0
- package/src/symbol/collision_index.ts +13 -7
- package/src/symbol/cross_tile_symbol_index.test.ts +238 -0
- package/src/symbol/get_anchors.test.ts +113 -0
- package/src/symbol/grid_index.test.ts +52 -0
- package/src/symbol/grid_index.ts +113 -69
- package/src/symbol/mergelines.test.ts +30 -0
- package/src/symbol/path_interpolator.test.ts +134 -0
- package/src/symbol/placement.ts +29 -24
- package/src/symbol/quads.test.ts +157 -0
- package/src/symbol/shaping.test.ts +392 -0
- package/src/symbol/symbol_layout.ts +26 -19
- package/src/symbol/symbol_style_layer.test.ts +103 -0
- package/src/types/packages-types/vector-tile/index.d.ts +27 -0
- package/src/ui/anchor.ts +3 -3
- package/src/ui/camera.test.ts +1883 -0
- package/src/ui/camera.ts +69 -61
- package/src/ui/control/attribution_control.test.ts +448 -0
- package/src/ui/control/attribution_control.ts +24 -26
- package/src/ui/control/control.ts +90 -0
- package/src/ui/control/fullscreen_control.test.ts +54 -0
- package/src/ui/control/fullscreen_control.ts +3 -3
- package/src/ui/control/geolocate_control.test.ts +452 -0
- package/src/ui/control/geolocate_control.ts +8 -8
- package/src/ui/control/logo_control.test.ts +134 -0
- package/src/ui/control/logo_control.ts +1 -1
- package/src/ui/control/navigation_control.ts +4 -4
- package/src/ui/control/scale_control.test.ts +53 -0
- package/src/ui/control/scale_control.ts +5 -5
- package/src/ui/events.ts +128 -15
- package/src/ui/handler/box_zoom.test.ts +165 -0
- package/src/ui/handler/dblclick_zoom.test.ts +181 -0
- package/src/ui/handler/drag_pan.test.ts +488 -0
- package/src/ui/handler/drag_rotate.test.ts +861 -0
- package/src/ui/handler/keyboard.test.ts +237 -0
- package/src/ui/handler/map_event.test.ts +96 -0
- package/src/ui/handler/map_event.ts +3 -1
- package/src/ui/handler/mouse_rotate.test.ts +64 -0
- package/src/ui/handler/scroll_zoom.test.ts +275 -0
- package/src/ui/handler/touch_zoom_rotate.test.ts +285 -0
- package/src/ui/hash.test.ts +293 -0
- package/src/ui/map/isMoving.test.ts +166 -0
- package/src/ui/map/isRotating.test.ts +64 -0
- package/src/ui/map/isZooming.test.ts +89 -0
- package/src/ui/map/requestRenderFrame.test.ts +41 -0
- package/src/ui/map.test.ts +2063 -0
- package/src/ui/map.ts +129 -235
- package/src/ui/map_events.test.ts +617 -0
- package/src/ui/marker.test.ts +774 -0
- package/src/ui/marker.ts +6 -6
- package/src/ui/popup.test.ts +739 -0
- package/src/ui/popup.ts +7 -7
- package/src/util/actor.test.ts +73 -0
- package/src/util/ajax.ts +10 -6
- package/src/util/browser.test.ts +26 -0
- package/src/util/browser.ts +1 -1
- package/src/util/classify_rings.test.ts +147 -0
- package/src/util/color_ramp.test.ts +106 -0
- package/src/util/dispatcher.test.ts +54 -0
- package/src/util/dom.ts +97 -120
- package/src/util/evented.test.ts +222 -0
- package/src/util/evented.ts +1 -1
- package/src/util/find_pole_of_inaccessibility.test.ts +21 -0
- package/src/util/image.ts +4 -4
- package/src/util/point.ts +10 -3
- package/src/util/primitives.test.ts +140 -0
- package/src/util/request_manager.test.ts +21 -0
- package/src/util/request_manager.ts +1 -1
- package/src/util/resolve_tokens.test.ts +41 -0
- package/src/util/struct_array.test.ts +101 -0
- package/src/util/task_queue.test.ts +114 -0
- package/src/util/test/util.ts +101 -0
- package/src/util/throttle.test.ts +45 -0
- package/src/util/tile_request_cache.test.ts +101 -0
- package/src/util/transferable_grid_index.test.ts +56 -0
- package/src/util/transferable_grid_index.ts +216 -0
- package/src/util/util.test.ts +309 -0
- package/src/util/vectortile_to_geojson.ts +4 -2
- package/src/util/web_worker.ts +2 -2
- package/src/util/web_worker_transfer.test.ts +80 -0
- package/src/util/web_worker_transfer.ts +2 -18
- package/src/util/worker_pool.test.ts +43 -0
- package/build/diff-tarball.js +0 -28
- package/build/generate-flow-typed-style-spec.js +0 -188
- package/build/generate-release-list.js +0 -21
- package/build/generate-struct-arrays.js +0 -243
- package/build/generate-style-code.js +0 -159
- package/build/print-release-url.js +0 -6
- package/dist/maplibre-gl-csp-worker.js +0 -2
- package/dist/maplibre-gl-csp-worker.js.map +0 -1
- package/dist/maplibre-gl-csp.js +0 -2
- package/dist/maplibre-gl-csp.js.map +0 -1
- package/dist/maplibre-gl-dev.js +0 -54948
- package/dist/maplibre-gl-unminified.js +0 -39602
- package/dist/maplibre-gl-unminified.js.map +0 -1
- package/dist/style-spec/index.es.js +0 -14930
- package/dist/style-spec/index.es.js.map +0 -1
- package/dist/style-spec/index.js +0 -14955
- package/dist/style-spec/index.js.map +0 -1
- package/src/style/style_layer/layer_properties.js.ejs +0 -69
- package/src/types/non-typed-modules.d.ts +0 -124
- package/src/ui/control/control.d.ts +0 -8
- package/src/util/struct_array.js.ejs +0 -112
- package/src/util/struct_array_layout.js.ejs +0 -98
- package/types/data/array_types.d.ts +0 -459
- package/types/data/array_types.d.ts.map +0 -1
- package/types/data/bucket/circle_attributes.d.ts +0 -4
- package/types/data/bucket/circle_attributes.d.ts.map +0 -1
- package/types/data/bucket/circle_bucket.d.ts +0 -50
- package/types/data/bucket/circle_bucket.d.ts.map +0 -1
- package/types/data/bucket/fill_attributes.d.ts +0 -4
- package/types/data/bucket/fill_attributes.d.ts.map +0 -1
- package/types/data/bucket/fill_bucket.d.ts +0 -51
- package/types/data/bucket/fill_bucket.d.ts.map +0 -1
- package/types/data/bucket/fill_extrusion_attributes.d.ts +0 -4
- package/types/data/bucket/fill_extrusion_attributes.d.ts.map +0 -1
- package/types/data/bucket/fill_extrusion_bucket.d.ts +0 -48
- package/types/data/bucket/fill_extrusion_bucket.d.ts.map +0 -1
- package/types/data/bucket/heatmap_bucket.d.ts +0 -7
- package/types/data/bucket/heatmap_bucket.d.ts.map +0 -1
- package/types/data/bucket/line_attributes.d.ts +0 -4
- package/types/data/bucket/line_attributes.d.ts.map +0 -1
- package/types/data/bucket/line_attributes_ext.d.ts +0 -4
- package/types/data/bucket/line_attributes_ext.d.ts.map +0 -1
- package/types/data/bucket/line_bucket.d.ts +0 -93
- package/types/data/bucket/line_bucket.d.ts.map +0 -1
- package/types/data/bucket/pattern_attributes.d.ts +0 -3
- package/types/data/bucket/pattern_attributes.d.ts.map +0 -1
- package/types/data/bucket/pattern_bucket_features.d.ts +0 -9
- package/types/data/bucket/pattern_bucket_features.d.ts.map +0 -1
- package/types/data/bucket/symbol_attributes.d.ts +0 -13
- package/types/data/bucket/symbol_attributes.d.ts.map +0 -1
- package/types/data/bucket/symbol_bucket.d.ts +0 -213
- package/types/data/bucket/symbol_bucket.d.ts.map +0 -1
- package/types/data/bucket.d.ts +0 -97
- package/types/data/bucket.d.ts.map +0 -1
- package/types/data/dem_data.d.ts +0 -17
- package/types/data/dem_data.d.ts.map +0 -1
- package/types/data/evaluation_feature.d.ts +0 -26
- package/types/data/evaluation_feature.d.ts.map +0 -1
- package/types/data/extent.d.ts +0 -18
- package/types/data/extent.d.ts.map +0 -1
- package/types/data/feature_index.d.ts +0 -77
- package/types/data/feature_index.d.ts.map +0 -1
- package/types/data/feature_position_map.d.ts +0 -21
- package/types/data/feature_position_map.d.ts.map +0 -1
- package/types/data/index_array_type.d.ts +0 -10
- package/types/data/index_array_type.d.ts.map +0 -1
- package/types/data/load_geometry.d.ts +0 -9
- package/types/data/load_geometry.d.ts.map +0 -1
- package/types/data/pos_attributes.d.ts +0 -3
- package/types/data/pos_attributes.d.ts.map +0 -1
- package/types/data/program_configuration.d.ts +0 -125
- package/types/data/program_configuration.d.ts.map +0 -1
- package/types/data/raster_bounds_attributes.d.ts +0 -3
- package/types/data/raster_bounds_attributes.d.ts.map +0 -1
- package/types/data/segment.d.ts +0 -23
- package/types/data/segment.d.ts.map +0 -1
- package/types/geo/edge_insets.d.ts +0 -56
- package/types/geo/edge_insets.d.ts.map +0 -1
- package/types/geo/lng_lat.d.ts +0 -110
- package/types/geo/lng_lat.d.ts.map +0 -1
- package/types/geo/lng_lat_bounds.d.ts +0 -175
- package/types/geo/lng_lat_bounds.d.ts.map +0 -1
- package/types/geo/mercator_coordinate.d.ts +0 -87
- package/types/geo/mercator_coordinate.d.ts.map +0 -1
- package/types/geo/transform.d.ts +0 -221
- package/types/geo/transform.d.ts.map +0 -1
- package/types/gl/color_mode.d.ts +0 -14
- package/types/gl/color_mode.d.ts.map +0 -1
- package/types/gl/context.d.ts +0 -73
- package/types/gl/context.d.ts.map +0 -1
- package/types/gl/cull_face_mode.d.ts +0 -11
- package/types/gl/cull_face_mode.d.ts.map +0 -1
- package/types/gl/depth_mode.d.ts +0 -12
- package/types/gl/depth_mode.d.ts.map +0 -1
- package/types/gl/framebuffer.d.ts +0 -14
- package/types/gl/framebuffer.d.ts.map +0 -1
- package/types/gl/index_buffer.d.ts +0 -14
- package/types/gl/index_buffer.d.ts.map +0 -1
- package/types/gl/stencil_mode.d.ts +0 -13
- package/types/gl/stencil_mode.d.ts.map +0 -1
- package/types/gl/types.d.ts +0 -46
- package/types/gl/types.d.ts.map +0 -1
- package/types/gl/value.d.ts +0 -163
- package/types/gl/value.d.ts.map +0 -1
- package/types/gl/vertex_buffer.d.ts +0 -37
- package/types/gl/vertex_buffer.d.ts.map +0 -1
- package/types/index.d.ts +0 -200
- package/types/index.d.ts.map +0 -1
- package/types/render/draw_background.d.ts +0 -6
- package/types/render/draw_background.d.ts.map +0 -1
- package/types/render/draw_circle.d.ts +0 -7
- package/types/render/draw_circle.d.ts.map +0 -1
- package/types/render/draw_collision_debug.d.ts +0 -7
- package/types/render/draw_collision_debug.d.ts.map +0 -1
- package/types/render/draw_custom.d.ts +0 -6
- package/types/render/draw_custom.d.ts.map +0 -1
- package/types/render/draw_debug.d.ts +0 -7
- package/types/render/draw_debug.d.ts.map +0 -1
- package/types/render/draw_fill.d.ts +0 -7
- package/types/render/draw_fill.d.ts.map +0 -1
- package/types/render/draw_fill_extrusion.d.ts +0 -7
- package/types/render/draw_fill_extrusion.d.ts.map +0 -1
- package/types/render/draw_heatmap.d.ts +0 -7
- package/types/render/draw_heatmap.d.ts.map +0 -1
- package/types/render/draw_hillshade.d.ts +0 -7
- package/types/render/draw_hillshade.d.ts.map +0 -1
- package/types/render/draw_line.d.ts +0 -6
- package/types/render/draw_line.d.ts.map +0 -1
- package/types/render/draw_raster.d.ts +0 -7
- package/types/render/draw_raster.d.ts.map +0 -1
- package/types/render/draw_symbol.d.ts +0 -10
- package/types/render/draw_symbol.d.ts.map +0 -1
- package/types/render/glyph_atlas.d.ts +0 -27
- package/types/render/glyph_atlas.d.ts.map +0 -1
- package/types/render/glyph_manager.d.ts +0 -44
- package/types/render/glyph_manager.d.ts.map +0 -1
- package/types/render/image_atlas.d.ts +0 -49
- package/types/render/image_atlas.d.ts.map +0 -1
- package/types/render/image_manager.d.ts +0 -64
- package/types/render/image_manager.d.ts.map +0 -1
- package/types/render/line_atlas.d.ts +0 -43
- package/types/render/line_atlas.d.ts.map +0 -1
- package/types/render/painter.d.ts +0 -140
- package/types/render/painter.d.ts.map +0 -1
- package/types/render/program/background_program.d.ts +0 -42
- package/types/render/program/background_program.d.ts.map +0 -1
- package/types/render/program/circle_program.d.ts +0 -19
- package/types/render/program/circle_program.d.ts.map +0 -1
- package/types/render/program/clipping_mask_program.d.ts +0 -11
- package/types/render/program/clipping_mask_program.d.ts.map +0 -1
- package/types/render/program/collision_program.d.ts +0 -25
- package/types/render/program/collision_program.d.ts.map +0 -1
- package/types/render/program/debug_program.d.ts +0 -15
- package/types/render/program/debug_program.d.ts.map +0 -1
- package/types/render/program/fill_extrusion_program.d.ts +0 -37
- package/types/render/program/fill_extrusion_program.d.ts.map +0 -1
- package/types/render/program/fill_program.d.ts +0 -43
- package/types/render/program/fill_program.d.ts.map +0 -1
- package/types/render/program/heatmap_program.d.ts +0 -25
- package/types/render/program/heatmap_program.d.ts.map +0 -1
- package/types/render/program/hillshade_program.d.ts +0 -30
- package/types/render/program/hillshade_program.d.ts.map +0 -1
- package/types/render/program/line_program.d.ts +0 -55
- package/types/render/program/line_program.d.ts.map +0 -1
- package/types/render/program/pattern.d.ts +0 -39
- package/types/render/program/pattern.d.ts.map +0 -1
- package/types/render/program/program_uniforms.d.ts +0 -28
- package/types/render/program/program_uniforms.d.ts.map +0 -1
- package/types/render/program/raster_program.d.ts +0 -27
- package/types/render/program/raster_program.d.ts.map +0 -1
- package/types/render/program/symbol_program.d.ts +0 -84
- package/types/render/program/symbol_program.d.ts.map +0 -1
- package/types/render/program.d.ts +0 -31
- package/types/render/program.d.ts.map +0 -1
- package/types/render/texture.d.ts +0 -37
- package/types/render/texture.d.ts.map +0 -1
- package/types/render/uniform_binding.d.ts +0 -50
- package/types/render/uniform_binding.d.ts.map +0 -1
- package/types/render/vertex_array_object.d.ts +0 -21
- package/types/render/vertex_array_object.d.ts.map +0 -1
- package/types/shaders/encode_attribute.d.ts +0 -9
- package/types/shaders/encode_attribute.d.ts.map +0 -1
- package/types/shaders/shaders.d.ts +0 -160
- package/types/shaders/shaders.d.ts.map +0 -1
- package/types/source/canvas_source.d.ts +0 -88
- package/types/source/canvas_source.d.ts.map +0 -1
- package/types/source/geojson_source.d.ts +0 -142
- package/types/source/geojson_source.d.ts.map +0 -1
- package/types/source/geojson_worker_source.d.ts +0 -143
- package/types/source/geojson_worker_source.d.ts.map +0 -1
- package/types/source/geojson_wrapper.d.ts +0 -28
- package/types/source/geojson_wrapper.d.ts.map +0 -1
- package/types/source/image_source.d.ts +0 -123
- package/types/source/image_source.d.ts.map +0 -1
- package/types/source/load_tilejson.d.ts +0 -6
- package/types/source/load_tilejson.d.ts.map +0 -1
- package/types/source/pixels_to_tile_units.d.ts +0 -18
- package/types/source/pixels_to_tile_units.d.ts.map +0 -1
- package/types/source/query_features.d.ts +0 -31
- package/types/source/query_features.d.ts.map +0 -1
- package/types/source/raster_dem_tile_source.d.ts +0 -26
- package/types/source/raster_dem_tile_source.d.ts.map +0 -1
- package/types/source/raster_dem_tile_worker_source.d.ts +0 -19
- package/types/source/raster_dem_tile_worker_source.d.ts.map +0 -1
- package/types/source/raster_tile_source.d.ts +0 -41
- package/types/source/raster_tile_source.d.ts.map +0 -1
- package/types/source/rtl_text_plugin.d.ts +0 -34
- package/types/source/rtl_text_plugin.d.ts.map +0 -1
- package/types/source/source.d.ts +0 -81
- package/types/source/source.d.ts.map +0 -1
- package/types/source/source_cache.d.ts +0 -194
- package/types/source/source_cache.d.ts.map +0 -1
- package/types/source/source_state.d.ts +0 -32
- package/types/source/source_state.d.ts.map +0 -1
- package/types/source/tile.d.ts +0 -135
- package/types/source/tile.d.ts.map +0 -1
- package/types/source/tile_bounds.d.ts +0 -12
- package/types/source/tile_bounds.d.ts.map +0 -1
- package/types/source/tile_cache.d.ts +0 -100
- package/types/source/tile_cache.d.ts.map +0 -1
- package/types/source/tile_id.d.ts +0 -41
- package/types/source/tile_id.d.ts.map +0 -1
- package/types/source/vector_tile_source.d.ts +0 -87
- package/types/source/vector_tile_source.d.ts.map +0 -1
- package/types/source/vector_tile_worker_source.d.ts +0 -80
- package/types/source/vector_tile_worker_source.d.ts.map +0 -1
- package/types/source/video_source.d.ts +0 -85
- package/types/source/video_source.d.ts.map +0 -1
- package/types/source/worker.d.ts +0 -82
- package/types/source/worker.d.ts.map +0 -1
- package/types/source/worker_source.d.ts +0 -103
- package/types/source/worker_source.d.ts.map +0 -1
- package/types/source/worker_tile.d.ts +0 -29
- package/types/source/worker_tile.d.ts.map +0 -1
- package/types/style/create_style_layer.d.ts +0 -14
- package/types/style/create_style_layer.d.ts.map +0 -1
- package/types/style/evaluation_parameters.d.ts +0 -20
- package/types/style/evaluation_parameters.d.ts.map +0 -1
- package/types/style/format_section_override.d.ts +0 -14
- package/types/style/format_section_override.d.ts.map +0 -1
- package/types/style/light.d.ts +0 -47
- package/types/style/light.d.ts.map +0 -1
- package/types/style/load_glyph_range.d.ts +0 -7
- package/types/style/load_glyph_range.d.ts.map +0 -1
- package/types/style/load_sprite.d.ts +0 -8
- package/types/style/load_sprite.d.ts.map +0 -1
- package/types/style/parse_glyph_pbf.d.ts +0 -4
- package/types/style/parse_glyph_pbf.d.ts.map +0 -1
- package/types/style/pauseable_placement.d.ts +0 -35
- package/types/style/pauseable_placement.d.ts.map +0 -1
- package/types/style/properties.d.ts +0 -327
- package/types/style/properties.d.ts.map +0 -1
- package/types/style/query_utils.d.ts +0 -8
- package/types/style/query_utils.d.ts.map +0 -1
- package/types/style/style.d.ts +0 -259
- package/types/style/style.d.ts.map +0 -1
- package/types/style/style_glyph.d.ts +0 -14
- package/types/style/style_glyph.d.ts.map +0 -1
- package/types/style/style_image.d.ts +0 -116
- package/types/style/style_image.d.ts.map +0 -1
- package/types/style/style_layer/background_style_layer.d.ts +0 -13
- package/types/style/style_layer/background_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/background_style_layer_properties.d.ts +0 -18
- package/types/style/style_layer/background_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/circle_style_layer.d.ts +0 -24
- package/types/style/style_layer/circle_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/circle_style_layer_properties.d.ts +0 -40
- package/types/style/style_layer/circle_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/custom_style_layer.d.ts +0 -163
- package/types/style/style_layer/custom_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/fill_extrusion_style_layer.d.ts +0 -27
- package/types/style/style_layer/fill_extrusion_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/fill_extrusion_style_layer_properties.d.ts +0 -28
- package/types/style/style_layer/fill_extrusion_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/fill_style_layer.d.ts +0 -26
- package/types/style/style_layer/fill_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/fill_style_layer_properties.d.ts +0 -33
- package/types/style/style_layer/fill_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/heatmap_style_layer.d.ts +0 -27
- package/types/style/style_layer/heatmap_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/heatmap_style_layer_properties.d.ts +0 -20
- package/types/style/style_layer/heatmap_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/hillshade_style_layer.d.ts +0 -14
- package/types/style/style_layer/hillshade_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/hillshade_style_layer_properties.d.ts +0 -23
- package/types/style/style_layer/hillshade_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/line_style_layer.d.ts +0 -30
- package/types/style/style_layer/line_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/line_style_layer_properties.d.ts +0 -49
- package/types/style/style_layer/line_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/raster_style_layer.d.ts +0 -13
- package/types/style/style_layer/raster_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/raster_style_layer_properties.d.ts +0 -26
- package/types/style/style_layer/raster_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/symbol_style_layer.d.ts +0 -28
- package/types/style/style_layer/symbol_style_layer.d.ts.map +0 -1
- package/types/style/style_layer/symbol_style_layer_properties.d.ts +0 -128
- package/types/style/style_layer/symbol_style_layer_properties.d.ts.map +0 -1
- package/types/style/style_layer/typed_style_layer.d.ts +0 -9
- package/types/style/style_layer/typed_style_layer.d.ts.map +0 -1
- package/types/style/style_layer.d.ts +0 -63
- package/types/style/style_layer.d.ts.map +0 -1
- package/types/style/style_layer_index.d.ts +0 -26
- package/types/style/style_layer_index.d.ts.map +0 -1
- package/types/style/validate_style.d.ts +0 -28
- package/types/style/validate_style.d.ts.map +0 -1
- package/types/style/zoom_history.d.ts +0 -11
- package/types/style/zoom_history.d.ts.map +0 -1
- package/types/style-spec/composite.d.ts +0 -2
- package/types/style-spec/composite.d.ts.map +0 -1
- package/types/style-spec/declass.d.ts +0 -18
- package/types/style-spec/declass.d.ts.map +0 -1
- package/types/style-spec/deref.d.ts +0 -16
- package/types/style-spec/deref.d.ts.map +0 -1
- package/types/style-spec/diff.d.ts +0 -43
- package/types/style-spec/diff.d.ts.map +0 -1
- package/types/style-spec/empty.d.ts +0 -2
- package/types/style-spec/empty.d.ts.map +0 -1
- package/types/style-spec/error/parsing_error.d.ts +0 -7
- package/types/style-spec/error/parsing_error.d.ts.map +0 -1
- package/types/style-spec/error/validation_error.d.ts +0 -9
- package/types/style-spec/error/validation_error.d.ts.map +0 -1
- package/types/style-spec/expression/compound_expression.d.ts +0 -34
- package/types/style-spec/expression/compound_expression.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/assertion.d.ts +0 -16
- package/types/style-spec/expression/definitions/assertion.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/at.d.ts +0 -18
- package/types/style-spec/expression/definitions/at.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/case.d.ts +0 -18
- package/types/style-spec/expression/definitions/case.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/coalesce.d.ts +0 -16
- package/types/style-spec/expression/definitions/coalesce.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/coercion.d.ts +0 -26
- package/types/style-spec/expression/definitions/coercion.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/collator.d.ts +0 -18
- package/types/style-spec/expression/definitions/collator.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/comparison.d.ts +0 -89
- package/types/style-spec/expression/definitions/comparison.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/format.d.ts +0 -23
- package/types/style-spec/expression/definitions/format.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/image.d.ts +0 -16
- package/types/style-spec/expression/definitions/image.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/in.d.ts +0 -17
- package/types/style-spec/expression/definitions/in.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/index.d.ts +0 -4
- package/types/style-spec/expression/definitions/index.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/index_of.d.ts +0 -18
- package/types/style-spec/expression/definitions/index_of.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/interpolate.d.ts +0 -31
- package/types/style-spec/expression/definitions/interpolate.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/length.d.ts +0 -16
- package/types/style-spec/expression/definitions/length.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/let.d.ts +0 -17
- package/types/style-spec/expression/definitions/let.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/literal.d.ts +0 -16
- package/types/style-spec/expression/definitions/literal.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/match.d.ts +0 -23
- package/types/style-spec/expression/definitions/match.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/number_format.d.ts +0 -19
- package/types/style-spec/expression/definitions/number_format.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/slice.d.ts +0 -18
- package/types/style-spec/expression/definitions/slice.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/step.d.ts +0 -19
- package/types/style-spec/expression/definitions/step.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/var.d.ts +0 -17
- package/types/style-spec/expression/definitions/var.d.ts.map +0 -1
- package/types/style-spec/expression/definitions/within.d.ts +0 -18
- package/types/style-spec/expression/definitions/within.d.ts.map +0 -1
- package/types/style-spec/expression/evaluation_context.d.ts +0 -26
- package/types/style-spec/expression/evaluation_context.d.ts.map +0 -1
- package/types/style-spec/expression/expression.d.ts +0 -26
- package/types/style-spec/expression/expression.d.ts.map +0 -1
- package/types/style-spec/expression/index.d.ts +0 -126
- package/types/style-spec/expression/index.d.ts.map +0 -1
- package/types/style-spec/expression/is_constant.d.ts +0 -6
- package/types/style-spec/expression/is_constant.d.ts.map +0 -1
- package/types/style-spec/expression/parsing_context.d.ts +0 -54
- package/types/style-spec/expression/parsing_context.d.ts.map +0 -1
- package/types/style-spec/expression/parsing_error.d.ts +0 -7
- package/types/style-spec/expression/parsing_error.d.ts.map +0 -1
- package/types/style-spec/expression/runtime_error.d.ts +0 -8
- package/types/style-spec/expression/runtime_error.d.ts.map +0 -1
- package/types/style-spec/expression/scope.d.ts +0 -17
- package/types/style-spec/expression/scope.d.ts.map +0 -1
- package/types/style-spec/expression/stops.d.ts +0 -8
- package/types/style-spec/expression/stops.d.ts.map +0 -1
- package/types/style-spec/expression/types/collator.d.ts +0 -23
- package/types/style-spec/expression/types/collator.d.ts.map +0 -1
- package/types/style-spec/expression/types/formatted.d.ts +0 -20
- package/types/style-spec/expression/types/formatted.d.ts.map +0 -1
- package/types/style-spec/expression/types/resolved_image.d.ts +0 -13
- package/types/style-spec/expression/types/resolved_image.d.ts.map +0 -1
- package/types/style-spec/expression/types.d.ts +0 -64
- package/types/style-spec/expression/types.d.ts.map +0 -1
- package/types/style-spec/expression/values.d.ts +0 -14
- package/types/style-spec/expression/values.d.ts.map +0 -1
- package/types/style-spec/feature_filter/convert.d.ts +0 -8
- package/types/style-spec/feature_filter/convert.d.ts.map +0 -1
- package/types/style-spec/feature_filter/index.d.ts +0 -21
- package/types/style-spec/feature_filter/index.d.ts.map +0 -1
- package/types/style-spec/format.d.ts +0 -24
- package/types/style-spec/format.d.ts.map +0 -1
- package/types/style-spec/function/convert.d.ts +0 -5
- package/types/style-spec/function/convert.d.ts.map +0 -1
- package/types/style-spec/function/index.d.ts +0 -30
- package/types/style-spec/function/index.d.ts.map +0 -1
- package/types/style-spec/group_by_layout.d.ts +0 -18
- package/types/style-spec/group_by_layout.d.ts.map +0 -1
- package/types/style-spec/migrate/expressions.d.ts +0 -8
- package/types/style-spec/migrate/expressions.d.ts.map +0 -1
- package/types/style-spec/migrate/v8.d.ts +0 -2
- package/types/style-spec/migrate/v8.d.ts.map +0 -1
- package/types/style-spec/migrate/v9.d.ts +0 -2
- package/types/style-spec/migrate/v9.d.ts.map +0 -1
- package/types/style-spec/migrate.d.ts +0 -15
- package/types/style-spec/migrate.d.ts.map +0 -1
- package/types/style-spec/read_style.d.ts +0 -2
- package/types/style-spec/read_style.d.ts.map +0 -1
- package/types/style-spec/reference/latest.d.ts +0 -3
- package/types/style-spec/reference/latest.d.ts.map +0 -1
- package/types/style-spec/style-spec.d.ts +0 -98
- package/types/style-spec/style-spec.d.ts.map +0 -1
- package/types/style-spec/types.d.ts +0 -417
- package/types/style-spec/types.d.ts.map +0 -1
- package/types/style-spec/util/color.d.ts +0 -41
- package/types/style-spec/util/color.d.ts.map +0 -1
- package/types/style-spec/util/color_spaces.d.ts +0 -41
- package/types/style-spec/util/color_spaces.d.ts.map +0 -1
- package/types/style-spec/util/deep_equal.d.ts +0 -8
- package/types/style-spec/util/deep_equal.d.ts.map +0 -1
- package/types/style-spec/util/extend.d.ts +0 -2
- package/types/style-spec/util/extend.d.ts.map +0 -1
- package/types/style-spec/util/get_type.d.ts +0 -2
- package/types/style-spec/util/get_type.d.ts.map +0 -1
- package/types/style-spec/util/interpolate.d.ts +0 -5
- package/types/style-spec/util/interpolate.d.ts.map +0 -1
- package/types/style-spec/util/properties.d.ts +0 -5
- package/types/style-spec/util/properties.d.ts.map +0 -1
- package/types/style-spec/util/ref_properties.d.ts +0 -3
- package/types/style-spec/util/ref_properties.d.ts.map +0 -1
- package/types/style-spec/util/result.d.ts +0 -16
- package/types/style-spec/util/result.d.ts.map +0 -1
- package/types/style-spec/util/unbundle_jsonlint.d.ts +0 -3
- package/types/style-spec/util/unbundle_jsonlint.d.ts.map +0 -1
- package/types/style-spec/validate/latest.d.ts +0 -3
- package/types/style-spec/validate/latest.d.ts.map +0 -1
- package/types/style-spec/validate/validate.d.ts +0 -2
- package/types/style-spec/validate/validate.d.ts.map +0 -1
- package/types/style-spec/validate/validate_array.d.ts +0 -2
- package/types/style-spec/validate/validate_array.d.ts.map +0 -1
- package/types/style-spec/validate/validate_boolean.d.ts +0 -3
- package/types/style-spec/validate/validate_boolean.d.ts.map +0 -1
- package/types/style-spec/validate/validate_color.d.ts +0 -3
- package/types/style-spec/validate/validate_color.d.ts.map +0 -1
- package/types/style-spec/validate/validate_constants.d.ts +0 -3
- package/types/style-spec/validate/validate_constants.d.ts.map +0 -1
- package/types/style-spec/validate/validate_enum.d.ts +0 -2
- package/types/style-spec/validate/validate_enum.d.ts.map +0 -1
- package/types/style-spec/validate/validate_expression.d.ts +0 -3
- package/types/style-spec/validate/validate_expression.d.ts.map +0 -1
- package/types/style-spec/validate/validate_filter.d.ts +0 -2
- package/types/style-spec/validate/validate_filter.d.ts.map +0 -1
- package/types/style-spec/validate/validate_formatted.d.ts +0 -2
- package/types/style-spec/validate/validate_formatted.d.ts.map +0 -1
- package/types/style-spec/validate/validate_function.d.ts +0 -2
- package/types/style-spec/validate/validate_function.d.ts.map +0 -1
- package/types/style-spec/validate/validate_glyphs_url.d.ts +0 -3
- package/types/style-spec/validate/validate_glyphs_url.d.ts.map +0 -1
- package/types/style-spec/validate/validate_image.d.ts +0 -2
- package/types/style-spec/validate/validate_image.d.ts.map +0 -1
- package/types/style-spec/validate/validate_layer.d.ts +0 -2
- package/types/style-spec/validate/validate_layer.d.ts.map +0 -1
- package/types/style-spec/validate/validate_layout_property.d.ts +0 -2
- package/types/style-spec/validate/validate_layout_property.d.ts.map +0 -1
- package/types/style-spec/validate/validate_light.d.ts +0 -2
- package/types/style-spec/validate/validate_light.d.ts.map +0 -1
- package/types/style-spec/validate/validate_number.d.ts +0 -3
- package/types/style-spec/validate/validate_number.d.ts.map +0 -1
- package/types/style-spec/validate/validate_object.d.ts +0 -2
- package/types/style-spec/validate/validate_object.d.ts.map +0 -1
- package/types/style-spec/validate/validate_paint_property.d.ts +0 -2
- package/types/style-spec/validate/validate_paint_property.d.ts.map +0 -1
- package/types/style-spec/validate/validate_property.d.ts +0 -2
- package/types/style-spec/validate/validate_property.d.ts.map +0 -1
- package/types/style-spec/validate/validate_source.d.ts +0 -2
- package/types/style-spec/validate/validate_source.d.ts.map +0 -1
- package/types/style-spec/validate/validate_string.d.ts +0 -3
- package/types/style-spec/validate/validate_string.d.ts.map +0 -1
- package/types/style-spec/validate_style.d.ts +0 -5333
- package/types/style-spec/validate_style.d.ts.map +0 -1
- package/types/style-spec/validate_style.min.d.ts +0 -5336
- package/types/style-spec/validate_style.min.d.ts.map +0 -1
- package/types/style-spec/visit.d.ts +0 -17
- package/types/style-spec/visit.d.ts.map +0 -1
- package/types/symbol/anchor.d.ts +0 -9
- package/types/symbol/anchor.d.ts.map +0 -1
- package/types/symbol/check_max_angle.d.ts +0 -18
- package/types/symbol/check_max_angle.d.ts.map +0 -1
- package/types/symbol/clip_line.d.ts +0 -15
- package/types/symbol/clip_line.d.ts.map +0 -1
- package/types/symbol/collision_feature.d.ts +0 -29
- package/types/symbol/collision_feature.d.ts.map +0 -1
- package/types/symbol/collision_index.d.ts +0 -57
- package/types/symbol/collision_index.d.ts.map +0 -1
- package/types/symbol/cross_tile_symbol_index.d.ts +0 -67
- package/types/symbol/cross_tile_symbol_index.d.ts.map +0 -1
- package/types/symbol/get_anchors.d.ts +0 -7
- package/types/symbol/get_anchors.d.ts.map +0 -1
- package/types/symbol/grid_index.d.ts +0 -49
- package/types/symbol/grid_index.d.ts.map +0 -1
- package/types/symbol/mergelines.d.ts +0 -3
- package/types/symbol/mergelines.d.ts.map +0 -1
- package/types/symbol/one_em.d.ts +0 -3
- package/types/symbol/one_em.d.ts.map +0 -1
- package/types/symbol/opacity_state.d.ts +0 -9
- package/types/symbol/opacity_state.d.ts.map +0 -1
- package/types/symbol/path_interpolator.d.ts +0 -13
- package/types/symbol/path_interpolator.d.ts.map +0 -1
- package/types/symbol/placement.d.ts +0 -141
- package/types/symbol/placement.d.ts.map +0 -1
- package/types/symbol/projection.d.ts +0 -37
- package/types/symbol/projection.d.ts.map +0 -1
- package/types/symbol/quads.d.ts +0 -52
- package/types/symbol/quads.d.ts.map +0 -1
- package/types/symbol/shaping.d.ts +0 -67
- package/types/symbol/shaping.d.ts.map +0 -1
- package/types/symbol/symbol_layout.d.ts +0 -26
- package/types/symbol/symbol_layout.d.ts.map +0 -1
- package/types/symbol/symbol_size.d.ts +0 -35
- package/types/symbol/symbol_size.d.ts.map +0 -1
- package/types/symbol/transform_text.d.ts +0 -5
- package/types/symbol/transform_text.d.ts.map +0 -1
- package/types/types/callback.d.ts +0 -2
- package/types/types/callback.d.ts.map +0 -1
- package/types/types/cancelable.d.ts +0 -4
- package/types/types/cancelable.d.ts.map +0 -1
- package/types/types/tilejson.d.ts +0 -16
- package/types/types/tilejson.d.ts.map +0 -1
- package/types/types/transferable.d.ts +0 -2
- package/types/types/transferable.d.ts.map +0 -1
- package/types/ui/anchor.d.ts +0 -6
- package/types/ui/anchor.d.ts.map +0 -1
- package/types/ui/camera.d.ts +0 -628
- package/types/ui/camera.d.ts.map +0 -1
- package/types/ui/control/attribution_control.d.ts +0 -41
- package/types/ui/control/attribution_control.d.ts.map +0 -1
- package/types/ui/control/fullscreen_control.d.ts +0 -36
- package/types/ui/control/fullscreen_control.d.ts.map +0 -1
- package/types/ui/control/geolocate_control.d.ts +0 -242
- package/types/ui/control/geolocate_control.d.ts.map +0 -1
- package/types/ui/control/logo_control.d.ts +0 -21
- package/types/ui/control/logo_control.d.ts.map +0 -1
- package/types/ui/control/navigation_control.d.ts +0 -63
- package/types/ui/control/navigation_control.d.ts.map +0 -1
- package/types/ui/control/scale_control.d.ts +0 -41
- package/types/ui/control/scale_control.d.ts.map +0 -1
- package/types/ui/default_locale.d.ts +0 -19
- package/types/ui/default_locale.d.ts.map +0 -1
- package/types/ui/events.d.ts +0 -1117
- package/types/ui/events.d.ts.map +0 -1
- package/types/ui/handler/box_zoom.d.ts +0 -59
- package/types/ui/handler/box_zoom.d.ts.map +0 -1
- package/types/ui/handler/click_zoom.d.ts +0 -16
- package/types/ui/handler/click_zoom.d.ts.map +0 -1
- package/types/ui/handler/handler_util.d.ts +0 -3
- package/types/ui/handler/handler_util.d.ts.map +0 -1
- package/types/ui/handler/keyboard.d.ts +0 -79
- package/types/ui/handler/keyboard.d.ts.map +0 -1
- package/types/ui/handler/map_event.d.ts +0 -44
- package/types/ui/handler/map_event.d.ts.map +0 -1
- package/types/ui/handler/mouse.d.ts +0 -46
- package/types/ui/handler/mouse.d.ts.map +0 -1
- package/types/ui/handler/scroll_zoom.d.ts +0 -97
- package/types/ui/handler/scroll_zoom.d.ts.map +0 -1
- package/types/ui/handler/shim/dblclick_zoom.d.ts +0 -41
- package/types/ui/handler/shim/dblclick_zoom.d.ts.map +0 -1
- package/types/ui/handler/shim/drag_pan.d.ts +0 -62
- package/types/ui/handler/shim/drag_pan.d.ts.map +0 -1
- package/types/ui/handler/shim/drag_rotate.d.ts +0 -47
- package/types/ui/handler/shim/drag_rotate.d.ts.map +0 -1
- package/types/ui/handler/shim/touch_zoom_rotate.d.ts +0 -71
- package/types/ui/handler/shim/touch_zoom_rotate.d.ts.map +0 -1
- package/types/ui/handler/tap_drag_zoom.d.ts +0 -23
- package/types/ui/handler/tap_drag_zoom.d.ts.map +0 -1
- package/types/ui/handler/tap_recognizer.d.ts +0 -34
- package/types/ui/handler/tap_recognizer.d.ts.map +0 -1
- package/types/ui/handler/tap_zoom.d.ts +0 -22
- package/types/ui/handler/tap_zoom.d.ts.map +0 -1
- package/types/ui/handler/touch_pan.d.ts +0 -34
- package/types/ui/handler/touch_pan.d.ts.map +0 -1
- package/types/ui/handler/touch_zoom_rotate.d.ts +0 -59
- package/types/ui/handler/touch_zoom_rotate.d.ts.map +0 -1
- package/types/ui/handler_inertia.d.ts +0 -22
- package/types/ui/handler_inertia.d.ts.map +0 -1
- package/types/ui/handler_manager.d.ts +0 -95
- package/types/ui/handler_manager.d.ts.map +0 -1
- package/types/ui/hash.d.ts +0 -15
- package/types/ui/hash.d.ts.map +0 -1
- package/types/ui/map.d.ts +0 -1758
- package/types/ui/map.d.ts.map +0 -1
- package/types/ui/marker.d.ts +0 -225
- package/types/ui/marker.d.ts.map +0 -1
- package/types/ui/popup.d.ts +0 -265
- package/types/ui/popup.d.ts.map +0 -1
- package/types/util/actor.d.ts +0 -47
- package/types/util/actor.d.ts.map +0 -1
- package/types/util/ajax.d.ts +0 -62
- package/types/util/ajax.d.ts.map +0 -1
- package/types/util/browser.d.ts +0 -18
- package/types/util/browser.d.ts.map +0 -1
- package/types/util/classify_rings.d.ts +0 -3
- package/types/util/classify_rings.d.ts.map +0 -1
- package/types/util/color_ramp.d.ts +0 -17
- package/types/util/color_ramp.d.ts.map +0 -1
- package/types/util/config.d.ts +0 -9
- package/types/util/config.d.ts.map +0 -1
- package/types/util/debug.d.ts +0 -12
- package/types/util/debug.d.ts.map +0 -1
- package/types/util/dictionary_coder.d.ts +0 -11
- package/types/util/dictionary_coder.d.ts.map +0 -1
- package/types/util/dispatcher.d.ts +0 -31
- package/types/util/dispatcher.d.ts.map +0 -1
- package/types/util/dom.d.ts +0 -23
- package/types/util/dom.d.ts.map +0 -1
- package/types/util/evented.d.ts +0 -73
- package/types/util/evented.d.ts.map +0 -1
- package/types/util/find_pole_of_inaccessibility.d.ts +0 -13
- package/types/util/find_pole_of_inaccessibility.d.ts.map +0 -1
- package/types/util/global_worker_pool.d.ts +0 -9
- package/types/util/global_worker_pool.d.ts.map +0 -1
- package/types/util/image.d.ts +0 -29
- package/types/util/image.d.ts.map +0 -1
- package/types/util/intersection_tests.d.ts +0 -14
- package/types/util/intersection_tests.d.ts.map +0 -1
- package/types/util/is_char_in_unicode_block.d.ts +0 -6
- package/types/util/is_char_in_unicode_block.d.ts.map +0 -1
- package/types/util/offscreen_canvas_supported.d.ts +0 -2
- package/types/util/offscreen_canvas_supported.d.ts.map +0 -1
- package/types/util/performance.d.ts +0 -35
- package/types/util/performance.d.ts.map +0 -1
- package/types/util/point.d.ts +0 -184
- package/types/util/point.d.ts.map +0 -1
- package/types/util/primitives.d.ts +0 -19
- package/types/util/primitives.d.ts.map +0 -1
- package/types/util/request_manager.d.ts +0 -13
- package/types/util/request_manager.d.ts.map +0 -1
- package/types/util/resolve_tokens.d.ts +0 -13
- package/types/util/resolve_tokens.d.ts.map +0 -1
- package/types/util/script_detection.d.ts +0 -47
- package/types/util/script_detection.d.ts.map +0 -1
- package/types/util/smart_wrap.d.ts +0 -20
- package/types/util/smart_wrap.d.ts.map +0 -1
- package/types/util/struct_array.d.ts +0 -124
- package/types/util/struct_array.d.ts.map +0 -1
- package/types/util/task_queue.d.ts +0 -19
- package/types/util/task_queue.d.ts.map +0 -1
- package/types/util/throttle.d.ts +0 -6
- package/types/util/throttle.d.ts.map +0 -1
- package/types/util/throttled_invoker.d.ts +0 -16
- package/types/util/throttled_invoker.d.ts.map +0 -1
- package/types/util/tile_request_cache.d.ts +0 -14
- package/types/util/tile_request_cache.d.ts.map +0 -1
- package/types/util/util.d.ts +0 -222
- package/types/util/util.d.ts.map +0 -1
- package/types/util/vectortile_to_geojson.d.ts +0 -13
- package/types/util/vectortile_to_geojson.d.ts.map +0 -1
- package/types/util/verticalize_punctuation.d.ts +0 -87
- package/types/util/verticalize_punctuation.d.ts.map +0 -1
- package/types/util/web_worker.d.ts +0 -25
- package/types/util/web_worker.d.ts.map +0 -1
- package/types/util/web_worker_transfer.d.ts +0 -39
- package/types/util/web_worker_transfer.d.ts.map +0 -1
- package/types/util/webp_supported.d.ts +0 -7
- package/types/util/webp_supported.d.ts.map +0 -1
- package/types/util/worker_pool.d.ts +0 -19
- package/types/util/worker_pool.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@
|
|
|
8
8
|
|
|
9
9
|
- *...Add new stuff here...*
|
|
10
10
|
|
|
11
|
+
## 2.0.2
|
|
12
|
+
|
|
13
|
+
### 🐞 Bug fixes
|
|
14
|
+
|
|
15
|
+
- Fix typescript generated file (#776).
|
|
16
|
+
|
|
17
|
+
## 2.0.1
|
|
18
|
+
|
|
19
|
+
### 🐞 Bug fixes
|
|
20
|
+
|
|
21
|
+
- Fix documentation of `addProtocol` and `removeProtocol`.
|
|
22
|
+
|
|
11
23
|
## 2.0.0
|
|
12
24
|
|
|
13
25
|
### Features and improvements
|
|
@@ -15,15 +27,38 @@
|
|
|
15
27
|
- Migrated the production code to typescript
|
|
16
28
|
- ** Breaking Change ** removed `version` from the public API
|
|
17
29
|
- ** Breaking Change ** stopped supporting IE (internet explorer)
|
|
18
|
-
- ** Breaking Change **
|
|
19
|
-
- ** Breaking Change ** removed `
|
|
20
|
-
-
|
|
21
|
-
-
|
|
30
|
+
- ** Breaking Change ** stopped supporting Chrome 49-65. Chrome 66+ required. For Chrome 49-65 support use version 1.15.2.
|
|
31
|
+
- ** Breaking Change ** removed all code related to `accessToken` and Mapbox specific urls starting with `mapbox://`. Telemetry and tracking code was removed.
|
|
32
|
+
- ** Breaking Change ** removed `baseApiUrl` as it was used only for Mapbox related urls
|
|
33
|
+
- ** Breaking Change ** typescript typings have changed:
|
|
34
|
+
- `Style` => `StyleSpecification`
|
|
35
|
+
- `AnyLayer` => `LayerSpecification`
|
|
36
|
+
- `AnySourceData` => `SourceSpecification`
|
|
37
|
+
- `MapboxEvent` => `MapLibreEvent`
|
|
38
|
+
- `MapboxOptions` => `MapOptions`
|
|
39
|
+
- `MapBoxZoomEvent` => `MapLibreZoomEvent`
|
|
40
|
+
- `*SourceRaw` + `*SourceOptions` => `*SourceSpecification`
|
|
41
|
+
- `*Source` (source implementation definition) were removed
|
|
42
|
+
- `*Layer` => `*LayerSpecification`
|
|
43
|
+
- `*Paint` => `*LayerSpecification['paint']`
|
|
44
|
+
- `*Layout` => `*LayerSpecification['layout']`
|
|
45
|
+
- `MapboxGeoJSONFeature` => `GeoJSONFeature`
|
|
46
|
+
- Added `redraw` function to map (#206)
|
|
47
|
+
- Improve attribution controls accessibility. See [#359](https://github.com/maplibre/maplibre-gl-js/issues/359)
|
|
48
|
+
- Allow maxPitch value up to 85, use values greater than 60 at your own risk (#574)
|
|
49
|
+
- `getImage` uses createImageBitmap when supported (#650)
|
|
22
50
|
|
|
23
51
|
### 🐞 Bug fixes
|
|
24
52
|
|
|
25
53
|
- Fix warning due to strict comparison of SDF property in image sprite (#303)
|
|
26
54
|
- Fix tile placeholder replacement to allow for placeholders to be in a URL more than once. (#348)
|
|
55
|
+
- Fix type check for non dom environment. (#334)
|
|
56
|
+
- Fix precision problem in patterns when overzoomed in OpenGL ES devices.
|
|
57
|
+
- Fix padding-top of the popup to improve readability of popup text (#354).
|
|
58
|
+
- Fix GeoJSONSource#loaded sometimes returning true while there are still pending loads (#669)
|
|
59
|
+
- Fix MapDataEvent#isSourceLoaded being true in GeoJSONSource "dataloading" event handlers (#694)
|
|
60
|
+
- Fix events being fired after Map#remove has been called when the WebGL context is lost and restored (#726)
|
|
61
|
+
- Fix nested expressions types definition [#757](https://github.com/maplibre/maplibre-gl-js/pull/757)
|
|
27
62
|
|
|
28
63
|
## 1.15.2
|
|
29
64
|
|
package/README.md
CHANGED
|
@@ -1,19 +1,49 @@
|
|
|
1
1
|
# MapLibre GL
|
|
2
2
|
|
|
3
|
-
**MapLibre GL** is a community
|
|
3
|
+
**MapLibre GL** is a community-led fork derived from [mapbox-gl-js](https://github.com/mapbox/mapbox-gl-js) before their switch to a non-OSS license.
|
|
4
4
|
|
|
5
5
|
### Migrating from mapbox-gl
|
|
6
6
|
|
|
7
7
|
If you depend on mapbox-gl directly, simply replace `mapbox-gl` with `maplibre-gl` in `package.json`:
|
|
8
|
+
|
|
9
|
+
Use
|
|
10
|
+
|
|
11
|
+
```diff
|
|
12
|
+
"dependencies": {
|
|
13
|
+
- "mapbox-gl": "^1.13.0"
|
|
14
|
+
+ "maplibre-gl": ">=1.15.2"
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
if it is important to you that the behaviour is similar to `mapbox-gl` version 1.x.
|
|
19
|
+
|
|
20
|
+
If you are OK with changes that integrate non-backward compatible features, install `maplibre-gl` version 2:
|
|
21
|
+
|
|
8
22
|
```diff
|
|
9
23
|
"dependencies": {
|
|
10
24
|
- "mapbox-gl": "^1.13.0"
|
|
11
|
-
+ "maplibre-gl": ">=
|
|
25
|
+
+ "maplibre-gl": ">=2.0.0"
|
|
12
26
|
}
|
|
13
27
|
```
|
|
14
28
|
|
|
15
|
-
And replace
|
|
29
|
+
And replace `mapboxgl` with `maplibregl` in your JavaScript and optionally in your HTML/CSS code:
|
|
30
|
+
|
|
31
|
+
> MapLibre GL JS is distributed via [unpkg.com](https://unpkg.com). For more informations please see [MapLibre GL is on unpkg.com](./docs/README-unpkg.md#maplibre-gl-on-unpkgcom).
|
|
32
|
+
|
|
16
33
|
```diff
|
|
34
|
+
- <script src="https://api.mapbox.com/mapbox-gl-js/v1.13.0/mapbox-gl.js"></script>
|
|
35
|
+
- <link
|
|
36
|
+
- href="https://api.mapbox.com/mapbox-gl-js/v1.13.0/mapbox-gl.css"
|
|
37
|
+
- rel="stylesheet"
|
|
38
|
+
- />
|
|
39
|
+
|
|
40
|
+
<!-- Use maplibre-gl version 1.15.2 for backwards compatibility with mapbox-gl version 1.x. -->
|
|
41
|
+
+ <script src="https://unpkg.com/maplibre-gl@1.15.2/dist/maplibre-gl.js"></script>
|
|
42
|
+
+ <link
|
|
43
|
+
+ href="https://unpkg.com/maplibre-gl@1.15.2/dist/maplibre-gl.css"
|
|
44
|
+
+ rel="stylesheet"
|
|
45
|
+
+ />
|
|
46
|
+
|
|
17
47
|
- var map = new mapboxgl.Map({
|
|
18
48
|
+ var map = new maplibregl.Map({
|
|
19
49
|
|
|
@@ -21,13 +51,15 @@ And replace ```mapboxgl``` with ```maplibregl``` in your JavaScript and optional
|
|
|
21
51
|
+ <button class="maplibregl-ctrl">
|
|
22
52
|
```
|
|
23
53
|
|
|
24
|
-
Want an example?
|
|
54
|
+
Want an example? Have a look at the official [MapLibre GL JS Documentation](https://maplibre.org/maplibre-gl-js-docs/example/).
|
|
25
55
|
|
|
26
56
|
Use MapLibre GL JS bindings for React (https://visgl.github.io/react-map-gl/docs/get-started/get-started#using-with-a-mapbox-gl-fork) and Angular (https://github.com/maplibre/ngx-maplibre-gl). Find more at [awesome-maplibre](https://github.com/maplibre/awesome-maplibre).
|
|
27
57
|
|
|
28
58
|
### Roadmap
|
|
29
59
|
|
|
30
|
-
This project's initial plans are outlined in the [Roadmap](https://github.com/maplibre/maplibre-gl-js/projects/2) project. The primary goal is consistency and
|
|
60
|
+
This project's initial plans are outlined in the [Roadmap](https://github.com/maplibre/maplibre-gl-js/projects/2) project. The primary goal is consistency and continued bug fixes and maintenance as we advance.
|
|
61
|
+
|
|
62
|
+
> **MapLibre GL** is developed following [Semantic Versioning (2.0.0)](http://semver.org/spec/v2.0.0.html).
|
|
31
63
|
|
|
32
64
|
### Getting Involved
|
|
33
65
|
|
|
@@ -35,18 +67,18 @@ Join the #maplibre slack channel at OSMUS: get an invite at https://osmus-slack.
|
|
|
35
67
|
|
|
36
68
|
### Community Leadership
|
|
37
69
|
|
|
38
|
-
|
|
70
|
+
You can find the official status of the backing community and steering committee in the [COMMUNITY.md](COMMUNITY.md) document.
|
|
39
71
|
|
|
40
72
|
### Avoid Fragmentation
|
|
41
73
|
|
|
42
|
-
If you depend on a free software alternative to `mapbox-gl-js`, please consider joining our effort! Anyone with a stake in a healthy community
|
|
74
|
+
If you depend on a free software alternative to `mapbox-gl-js`, please consider joining our effort! Anyone with a stake in a healthy community-led fork is welcome to help us figure out our next steps. We welcome contributors and leaders! MapLibre GL already represents the combined efforts of a few early fork efforts, and we all benefit from "one project" rather than "our way". If you know of other forks, please reach out to them and direct them here.
|
|
43
75
|
|
|
44
76
|
### Thank you Mapbox 🙏🏽
|
|
45
77
|
|
|
46
|
-
We'd like to acknowledge the amazing work Mapbox has contributed to open source. The open source community is sad to part ways with them, but we simultaneously feel grateful for everything they already contributed. `mapbox-gl-js` 1.x is an open source
|
|
78
|
+
We'd like to acknowledge the amazing work Mapbox has contributed to open source. The open source community is sad to part ways with them, but we simultaneously feel grateful for everything they already contributed. `mapbox-gl-js` 1.x is an open source achievement which now lives on as `maplibre-gl`. We're proud to develop on the shoulders of giants, thank you Mapbox 🙇🏽♀️.
|
|
47
79
|
|
|
48
80
|
Please keep in mind: Unauthorized backports are the biggest threat to the MapLibre project. It is unacceptable to backport code from mapbox-gl-js, which is not covered by the former BSD-3 license. If you are unsure about this issue, [please ask](https://github.com/maplibre/maplibre-gl-js/discussions)!
|
|
49
81
|
|
|
50
82
|
## License
|
|
51
83
|
|
|
52
|
-
MapLibre GL is licensed under the [3-Clause BSD license](./LICENSE.txt).
|
|
84
|
+
**MapLibre GL** is licensed under the [3-Clause BSD license](./LICENSE.txt).
|
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Generates the following:
|
|
3
|
+
* - data/array_types.js, which consists of:
|
|
4
|
+
* - StructArrayLayout_* subclasses, one for each underlying memory layout we need
|
|
5
|
+
* - Named exports mapping each conceptual array type (e.g., CircleLayoutArray) to its corresponding StructArrayLayout class
|
|
6
|
+
* - Particular, named StructArray subclasses, when fancy struct accessors are needed (e.g. CollisionBoxArray)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict'; // eslint-disable-line strict
|
|
10
|
+
|
|
11
|
+
import * as fs from 'fs';
|
|
12
|
+
import * as util from '../src/util/util';
|
|
13
|
+
import {createLayout, viewTypes} from '../src/util/struct_array';
|
|
14
|
+
import type {ViewType, StructArrayLayout} from '../src/util/struct_array';
|
|
15
|
+
|
|
16
|
+
import posAttributes from '../src/data/pos_attributes';
|
|
17
|
+
import rasterBoundsAttributes from '../src/data/raster_bounds_attributes';
|
|
18
|
+
import circleAttributes from '../src/data/bucket/circle_attributes';
|
|
19
|
+
import fillAttributes from '../src/data/bucket/fill_attributes';
|
|
20
|
+
import fillExtrusionAttributes from '../src/data/bucket/fill_extrusion_attributes';
|
|
21
|
+
import lineAttributes from '../src/data/bucket/line_attributes';
|
|
22
|
+
import lineAttributesExt from '../src/data/bucket/line_attributes_ext';
|
|
23
|
+
import patternAttributes from '../src/data/bucket/pattern_attributes';
|
|
24
|
+
// symbol layer specific arrays
|
|
25
|
+
import {
|
|
26
|
+
symbolLayoutAttributes,
|
|
27
|
+
dynamicLayoutAttributes,
|
|
28
|
+
placementOpacityAttributes,
|
|
29
|
+
collisionBox,
|
|
30
|
+
collisionBoxLayout,
|
|
31
|
+
collisionCircleLayout,
|
|
32
|
+
collisionVertexAttributes,
|
|
33
|
+
quadTriangle,
|
|
34
|
+
placement,
|
|
35
|
+
symbolInstance,
|
|
36
|
+
glyphOffset,
|
|
37
|
+
lineVertex
|
|
38
|
+
} from '../src/data/bucket/symbol_attributes';
|
|
39
|
+
|
|
40
|
+
const typeAbbreviations = {
|
|
41
|
+
'Int8': 'b',
|
|
42
|
+
'Uint8': 'ub',
|
|
43
|
+
'Int16': 'i',
|
|
44
|
+
'Uint16': 'ui',
|
|
45
|
+
'Int32': 'l',
|
|
46
|
+
'Uint32': 'ul',
|
|
47
|
+
'Float32': 'f'
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const arraysWithStructAccessors = [];
|
|
51
|
+
const arrayTypeEntries = new Set();
|
|
52
|
+
const layoutCache = {};
|
|
53
|
+
|
|
54
|
+
function normalizeMembers(members, usedTypes) {
|
|
55
|
+
return members.map((member) => {
|
|
56
|
+
if (usedTypes && !usedTypes.has(member.type)) {
|
|
57
|
+
usedTypes.add(member.type);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return util.extend(member, {
|
|
61
|
+
size: sizeOf(member.type),
|
|
62
|
+
view: member.type.toLowerCase()
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// - If necessary, write the StructArrayLayout_* class for the given layout
|
|
68
|
+
// - If `includeStructAccessors`, write the fancy subclass
|
|
69
|
+
// - Add an entry for `name` in the array type registry
|
|
70
|
+
function createStructArrayType(name: string, layout: StructArrayLayout, includeStructAccessors: boolean = false) {
|
|
71
|
+
const hasAnchorPoint = layout.members.some(m => m.name === 'anchorPointX');
|
|
72
|
+
|
|
73
|
+
// create the underlying StructArrayLayout class exists
|
|
74
|
+
const layoutClass = createStructArrayLayoutType(layout);
|
|
75
|
+
const arrayClass = `${camelize(name)}Array`;
|
|
76
|
+
|
|
77
|
+
if (includeStructAccessors) {
|
|
78
|
+
const usedTypes = new Set(['Uint8']);
|
|
79
|
+
const members = normalizeMembers(layout.members, usedTypes);
|
|
80
|
+
arraysWithStructAccessors.push({
|
|
81
|
+
arrayClass,
|
|
82
|
+
members,
|
|
83
|
+
size: layout.size,
|
|
84
|
+
usedTypes,
|
|
85
|
+
hasAnchorPoint,
|
|
86
|
+
layoutClass,
|
|
87
|
+
includeStructAccessors
|
|
88
|
+
});
|
|
89
|
+
} else {
|
|
90
|
+
arrayTypeEntries.add(`export class ${arrayClass} extends ${layoutClass} {}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function createStructArrayLayoutType({members, size, alignment}) {
|
|
95
|
+
const usedTypes = new Set(['Uint8']);
|
|
96
|
+
members = normalizeMembers(members, usedTypes);
|
|
97
|
+
|
|
98
|
+
// combine consecutive 'members' with same underlying type, summing their
|
|
99
|
+
// component counts
|
|
100
|
+
if (!alignment || alignment === 1) members = members.reduce((memo, member) => {
|
|
101
|
+
if (memo.length > 0 && memo[memo.length - 1].type === member.type) {
|
|
102
|
+
const last = memo[memo.length - 1];
|
|
103
|
+
return memo.slice(0, -1).concat(util.extend({}, last, {
|
|
104
|
+
components: last.components + member.components,
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
return memo.concat(member);
|
|
108
|
+
}, []);
|
|
109
|
+
|
|
110
|
+
const key = `${members.map(m => `${m.components}${typeAbbreviations[m.type]}`).join('')}${size}`;
|
|
111
|
+
const className = `StructArrayLayout${key}`;
|
|
112
|
+
// Layout alignment to 4 bytes boundaries can be an issue on some set of graphics cards. Particularly AMD.
|
|
113
|
+
if (size % 4 !== 0) { console.warn(`Warning: The layout ${className} is not aligned to 4-bytes boundaries.`); }
|
|
114
|
+
if (!layoutCache[key]) {
|
|
115
|
+
layoutCache[key] = {
|
|
116
|
+
className,
|
|
117
|
+
members,
|
|
118
|
+
size,
|
|
119
|
+
usedTypes
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return className;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function sizeOf(type: ViewType): number {
|
|
127
|
+
return viewTypes[type].BYTES_PER_ELEMENT;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function camelize (str) {
|
|
131
|
+
return str.replace(/(?:^|[-_])(.)/g, (_, x) => {
|
|
132
|
+
return /^[0-9]$/.test(x) ? _ : x.toUpperCase();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
createStructArrayType('pos', posAttributes);
|
|
137
|
+
createStructArrayType('raster_bounds', rasterBoundsAttributes);
|
|
138
|
+
|
|
139
|
+
// layout vertex arrays
|
|
140
|
+
const layoutAttributes = {
|
|
141
|
+
circle: circleAttributes,
|
|
142
|
+
fill: fillAttributes,
|
|
143
|
+
'fill-extrusion': fillExtrusionAttributes,
|
|
144
|
+
heatmap: circleAttributes,
|
|
145
|
+
line: lineAttributes,
|
|
146
|
+
lineExt: lineAttributesExt,
|
|
147
|
+
pattern: patternAttributes
|
|
148
|
+
};
|
|
149
|
+
for (const name in layoutAttributes) {
|
|
150
|
+
createStructArrayType(`${name.replace(/-/g, '_')}_layout`, layoutAttributes[name]);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
createStructArrayType('symbol_layout', symbolLayoutAttributes);
|
|
154
|
+
createStructArrayType('symbol_dynamic_layout', dynamicLayoutAttributes);
|
|
155
|
+
createStructArrayType('symbol_opacity', placementOpacityAttributes);
|
|
156
|
+
createStructArrayType('collision_box', collisionBox, true);
|
|
157
|
+
createStructArrayType('collision_box_layout', collisionBoxLayout);
|
|
158
|
+
createStructArrayType('collision_circle_layout', collisionCircleLayout);
|
|
159
|
+
createStructArrayType('collision_vertex', collisionVertexAttributes);
|
|
160
|
+
createStructArrayType('quad_triangle', quadTriangle);
|
|
161
|
+
createStructArrayType('placed_symbol', placement, true);
|
|
162
|
+
createStructArrayType('symbol_instance', symbolInstance, true);
|
|
163
|
+
createStructArrayType('glyph_offset', glyphOffset, true);
|
|
164
|
+
createStructArrayType('symbol_line_vertex', lineVertex, true);
|
|
165
|
+
|
|
166
|
+
// feature index array
|
|
167
|
+
createStructArrayType('feature_index', createLayout([
|
|
168
|
+
// the index of the feature in the original vectortile
|
|
169
|
+
{ type: 'Uint32', name: 'featureIndex' },
|
|
170
|
+
// the source layer the feature appears in
|
|
171
|
+
{ type: 'Uint16', name: 'sourceLayerIndex' },
|
|
172
|
+
// the bucket the feature appears in
|
|
173
|
+
{ type: 'Uint16', name: 'bucketIndex' }
|
|
174
|
+
]), true);
|
|
175
|
+
|
|
176
|
+
// triangle index array
|
|
177
|
+
createStructArrayType('triangle_index', createLayout([
|
|
178
|
+
{ type: 'Uint16', name: 'vertices', components: 3 }
|
|
179
|
+
]));
|
|
180
|
+
|
|
181
|
+
// line index array
|
|
182
|
+
createStructArrayType('line_index', createLayout([
|
|
183
|
+
{ type: 'Uint16', name: 'vertices', components: 2 }
|
|
184
|
+
]));
|
|
185
|
+
|
|
186
|
+
// line strip index array
|
|
187
|
+
createStructArrayType('line_strip_index', createLayout([
|
|
188
|
+
{ type: 'Uint16', name: 'vertices', components: 1 }
|
|
189
|
+
]));
|
|
190
|
+
|
|
191
|
+
// paint vertex arrays
|
|
192
|
+
|
|
193
|
+
// used by SourceBinder for float properties
|
|
194
|
+
createStructArrayLayoutType(createLayout([{
|
|
195
|
+
name: 'dummy name (unused for StructArrayLayout)',
|
|
196
|
+
type: 'Float32',
|
|
197
|
+
components: 1
|
|
198
|
+
}], 4));
|
|
199
|
+
|
|
200
|
+
// used by SourceBinder for color properties and CompositeBinder for float properties
|
|
201
|
+
createStructArrayLayoutType(createLayout([{
|
|
202
|
+
name: 'dummy name (unused for StructArrayLayout)',
|
|
203
|
+
type: 'Float32',
|
|
204
|
+
components: 2
|
|
205
|
+
}], 4));
|
|
206
|
+
|
|
207
|
+
// used by CompositeBinder for color properties
|
|
208
|
+
createStructArrayLayoutType(createLayout([{
|
|
209
|
+
name: 'dummy name (unused for StructArrayLayout)',
|
|
210
|
+
type: 'Float32',
|
|
211
|
+
components: 4
|
|
212
|
+
}], 4));
|
|
213
|
+
|
|
214
|
+
const layouts = Object.keys(layoutCache).map(k => layoutCache[k]);
|
|
215
|
+
|
|
216
|
+
function emitStructArrayLayout(locals) {
|
|
217
|
+
const output = [];
|
|
218
|
+
const {
|
|
219
|
+
className,
|
|
220
|
+
members,
|
|
221
|
+
size,
|
|
222
|
+
usedTypes
|
|
223
|
+
} = locals;
|
|
224
|
+
const structArrayLayoutClass = className;
|
|
225
|
+
|
|
226
|
+
output.push(
|
|
227
|
+
`/**
|
|
228
|
+
* Implementation of the StructArray layout:`);
|
|
229
|
+
|
|
230
|
+
for (const member of members) {
|
|
231
|
+
output.push(
|
|
232
|
+
` * [${member.offset}]: ${member.type}[${member.components}]`);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
output.push(
|
|
236
|
+
` *
|
|
237
|
+
* @private
|
|
238
|
+
*/
|
|
239
|
+
class ${structArrayLayoutClass} extends StructArray {`);
|
|
240
|
+
|
|
241
|
+
for (const type of usedTypes) {
|
|
242
|
+
output.push(
|
|
243
|
+
` ${type.toLowerCase()}: ${type}Array;`);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
output.push(`
|
|
247
|
+
_refreshViews() {`);
|
|
248
|
+
|
|
249
|
+
for (const type of usedTypes) {
|
|
250
|
+
output.push(
|
|
251
|
+
` this.${type.toLowerCase()} = new ${type}Array(this.arrayBuffer);`);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
output.push(
|
|
255
|
+
' }');
|
|
256
|
+
|
|
257
|
+
// prep for emplaceBack: collect type sizes and count the number of arguments
|
|
258
|
+
// we'll need
|
|
259
|
+
const bytesPerElement = size;
|
|
260
|
+
const usedTypeSizes = [];
|
|
261
|
+
const argNames = [];
|
|
262
|
+
const argNamesTyped = [];
|
|
263
|
+
|
|
264
|
+
for (const member of members) {
|
|
265
|
+
if (usedTypeSizes.indexOf(member.size) < 0) {
|
|
266
|
+
usedTypeSizes.push(member.size);
|
|
267
|
+
}
|
|
268
|
+
for (let c = 0; c < member.components; c++) {
|
|
269
|
+
// arguments v0, v1, v2, ... are, in order, the components of
|
|
270
|
+
// member 0, then the components of member 1, etc.
|
|
271
|
+
const name = `v${argNames.length}`;
|
|
272
|
+
argNames.push(name);
|
|
273
|
+
argNamesTyped.push(`${name}: number`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
output.push(
|
|
278
|
+
`
|
|
279
|
+
public emplaceBack(${argNamesTyped.join(', ')}) {
|
|
280
|
+
const i = this.length;
|
|
281
|
+
this.resize(i + 1);
|
|
282
|
+
return this.emplace(i, ${argNames.join(', ')});
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
public emplace(i: number, ${argNamesTyped.join(', ')}) {`);
|
|
286
|
+
|
|
287
|
+
for (const size of usedTypeSizes) {
|
|
288
|
+
output.push(
|
|
289
|
+
` const o${size.toFixed(0)} = i * ${(bytesPerElement / size).toFixed(0)};`);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
let argIndex = 0;
|
|
293
|
+
for (const member of members) {
|
|
294
|
+
for (let c = 0; c < member.components; c++) {
|
|
295
|
+
// The index for `member` component `c` into the appropriate type array is:
|
|
296
|
+
// this.{TYPE}[o{SIZE} + MEMBER_OFFSET + {c}] = v{X}
|
|
297
|
+
// where MEMBER_OFFSET = ROUND(member.offset / size) is the per-element
|
|
298
|
+
// offset of this member into the array
|
|
299
|
+
const index = `o${member.size.toFixed(0)} + ${(member.offset / member.size + c).toFixed(0)}`;
|
|
300
|
+
|
|
301
|
+
output.push(
|
|
302
|
+
` this.${member.view}[${index}] = v${argIndex++};`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
output.push(
|
|
307
|
+
` return i;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
${structArrayLayoutClass}.prototype.bytesPerElement = ${size};
|
|
312
|
+
register('${structArrayLayoutClass}', ${structArrayLayoutClass});
|
|
313
|
+
`);
|
|
314
|
+
|
|
315
|
+
return output.join('\n');
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function emitStructArray(locals) {
|
|
319
|
+
const output = [];
|
|
320
|
+
const {
|
|
321
|
+
arrayClass,
|
|
322
|
+
members,
|
|
323
|
+
size,
|
|
324
|
+
hasAnchorPoint,
|
|
325
|
+
layoutClass,
|
|
326
|
+
includeStructAccessors
|
|
327
|
+
} = locals;
|
|
328
|
+
|
|
329
|
+
const structTypeClass = arrayClass.replace('Array', 'Struct');
|
|
330
|
+
const structArrayClass = arrayClass;
|
|
331
|
+
const structArrayLayoutClass = layoutClass;
|
|
332
|
+
|
|
333
|
+
// collect components
|
|
334
|
+
const components = [];
|
|
335
|
+
for (const member of members) {
|
|
336
|
+
for (let c = 0; c < member.components; c++) {
|
|
337
|
+
let name = member.name;
|
|
338
|
+
if (member.components > 1) {
|
|
339
|
+
name += c;
|
|
340
|
+
}
|
|
341
|
+
components.push({name, member, component: c});
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// exceptions for which we generate accessors on the array rather than a separate struct for performance
|
|
346
|
+
const useComponentGetters = structArrayClass === 'GlyphOffsetArray' || structArrayClass === 'SymbolLineVertexArray';
|
|
347
|
+
|
|
348
|
+
if (includeStructAccessors && !useComponentGetters) {
|
|
349
|
+
output.push(
|
|
350
|
+
`class ${structTypeClass} extends Struct {
|
|
351
|
+
_structArray: ${structArrayClass};`);
|
|
352
|
+
|
|
353
|
+
for (const {name, member, component} of components) {
|
|
354
|
+
const elementOffset = `this._pos${member.size.toFixed(0)}`;
|
|
355
|
+
const componentOffset = (member.offset / member.size + component).toFixed(0);
|
|
356
|
+
const index = `${elementOffset} + ${componentOffset}`;
|
|
357
|
+
const componentAccess = `this._structArray.${member.view}[${index}]`;
|
|
358
|
+
|
|
359
|
+
output.push(
|
|
360
|
+
` get ${name}() { return ${componentAccess}; }`);
|
|
361
|
+
|
|
362
|
+
// generate setters for properties that are updated during runtime symbol placement; others are read-only
|
|
363
|
+
if (name === 'crossTileID' || name === 'placedOrientation' || name === 'hidden') {
|
|
364
|
+
output.push(
|
|
365
|
+
` set ${name}(x: number) { ${componentAccess} = x; }`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// Special case used for the CollisionBoxArray type
|
|
370
|
+
if (hasAnchorPoint) {
|
|
371
|
+
output.push(
|
|
372
|
+
' get anchorPoint() { return new Point(this.anchorPointX, this.anchorPointY); }');
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
output.push(
|
|
376
|
+
`}
|
|
377
|
+
|
|
378
|
+
${structTypeClass}.prototype.size = ${size};
|
|
379
|
+
|
|
380
|
+
export type ${structTypeClass.replace('Struct', '')} = ${structTypeClass};
|
|
381
|
+
`);
|
|
382
|
+
} // end 'if (includeStructAccessors)'
|
|
383
|
+
|
|
384
|
+
output.push(
|
|
385
|
+
`/**
|
|
386
|
+
* @private
|
|
387
|
+
*/
|
|
388
|
+
export class ${structArrayClass} extends ${structArrayLayoutClass} {`);
|
|
389
|
+
|
|
390
|
+
if (useComponentGetters) {
|
|
391
|
+
for (const member of members) {
|
|
392
|
+
for (let c = 0; c < member.components; c++) {
|
|
393
|
+
if (!includeStructAccessors) continue;
|
|
394
|
+
let name = `get${member.name}`;
|
|
395
|
+
if (member.components > 1) {
|
|
396
|
+
name += c;
|
|
397
|
+
}
|
|
398
|
+
const componentOffset = (member.offset / member.size + c).toFixed(0);
|
|
399
|
+
const componentStride = size / member.size;
|
|
400
|
+
output.push(
|
|
401
|
+
` ${name}(index: number) { return this.${member.view}[index * ${componentStride} + ${componentOffset}]; }`);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
} else if (includeStructAccessors) { // get(i)
|
|
405
|
+
output.push(
|
|
406
|
+
` /**
|
|
407
|
+
* Return the ${structTypeClass} at the given location in the array.
|
|
408
|
+
* @param {number} index The index of the element.
|
|
409
|
+
* @private
|
|
410
|
+
*/
|
|
411
|
+
get(index: number): ${structTypeClass} {
|
|
412
|
+
assert(!this.isTransferred);
|
|
413
|
+
return new ${structTypeClass}(this, index);
|
|
414
|
+
}`);
|
|
415
|
+
}
|
|
416
|
+
output.push(
|
|
417
|
+
`}
|
|
418
|
+
|
|
419
|
+
register('${structArrayClass}', ${structArrayClass});
|
|
420
|
+
`);
|
|
421
|
+
|
|
422
|
+
return output.join('\n');
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
fs.writeFileSync('src/data/array_types.ts',
|
|
426
|
+
`// This file is generated. Edit build/generate-struct-arrays.ts, then run \`npm run codegen\`.
|
|
427
|
+
|
|
428
|
+
import assert from 'assert';
|
|
429
|
+
import {Struct, StructArray} from '../util/struct_array';
|
|
430
|
+
import {register} from '../util/web_worker_transfer';
|
|
431
|
+
import Point from '../util/point';
|
|
432
|
+
|
|
433
|
+
${layouts.map(emitStructArrayLayout).join('\n')}
|
|
434
|
+
${arraysWithStructAccessors.map(emitStructArray).join('\n')}
|
|
435
|
+
${[...arrayTypeEntries].join('\n')}
|
|
436
|
+
export {
|
|
437
|
+
${layouts.map(layout => layout.className).join(',\n ')}
|
|
438
|
+
};
|
|
439
|
+
`);
|