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
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
|
|
5
|
+
import spec from '../src/style-spec/reference/v8.json';
|
|
6
|
+
|
|
7
|
+
function camelCase(str: string): string {
|
|
8
|
+
return str.replace(/-(.)/g, function (_, x) {
|
|
9
|
+
return x.toUpperCase();
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function pascalCase(str: string): string {
|
|
14
|
+
let almostCamelized = camelCase(str);
|
|
15
|
+
return almostCamelized[0].toUpperCase() + almostCamelized.slice(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function nativeType(property) {
|
|
19
|
+
switch (property.type) {
|
|
20
|
+
case 'boolean':
|
|
21
|
+
return 'boolean';
|
|
22
|
+
case 'number':
|
|
23
|
+
return 'number';
|
|
24
|
+
case 'string':
|
|
25
|
+
return 'string';
|
|
26
|
+
case 'enum':
|
|
27
|
+
return Object.keys(property.values).map(v => JSON.stringify(v)).join(' | ');
|
|
28
|
+
case 'color':
|
|
29
|
+
return 'Color';
|
|
30
|
+
case 'formatted':
|
|
31
|
+
return 'Formatted';
|
|
32
|
+
case 'resolvedImage':
|
|
33
|
+
return 'ResolvedImage';
|
|
34
|
+
case 'array':
|
|
35
|
+
if (property.length) {
|
|
36
|
+
return `[${new Array(property.length).fill(nativeType({type: property.value})).join(', ')}]`;
|
|
37
|
+
} else {
|
|
38
|
+
return `Array<${nativeType({type: property.value, values: property.values})}>`;
|
|
39
|
+
}
|
|
40
|
+
default: throw new Error(`unknown type for ${property.name}`)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function possiblyEvaluatedType(property) {
|
|
45
|
+
const propType = nativeType(property);
|
|
46
|
+
|
|
47
|
+
switch (property['property-type']) {
|
|
48
|
+
case 'color-ramp':
|
|
49
|
+
return 'ColorRampProperty';
|
|
50
|
+
case 'cross-faded':
|
|
51
|
+
return `CrossFaded<${propType}>`;
|
|
52
|
+
case 'cross-faded-data-driven':
|
|
53
|
+
return `PossiblyEvaluatedPropertyValue<CrossFaded<${propType}>>`;
|
|
54
|
+
case 'data-driven':
|
|
55
|
+
return `PossiblyEvaluatedPropertyValue<${propType}>`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return propType;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function propertyType(property) {
|
|
62
|
+
switch (property['property-type']) {
|
|
63
|
+
case 'data-driven':
|
|
64
|
+
return `DataDrivenProperty<${nativeType(property)}>`;
|
|
65
|
+
case 'cross-faded':
|
|
66
|
+
return `CrossFadedProperty<${nativeType(property)}>`;
|
|
67
|
+
case 'cross-faded-data-driven':
|
|
68
|
+
return `CrossFadedDataDrivenProperty<${nativeType(property)}>`;
|
|
69
|
+
case 'color-ramp':
|
|
70
|
+
return 'ColorRampProperty';
|
|
71
|
+
case 'data-constant':
|
|
72
|
+
case 'constant':
|
|
73
|
+
return `DataConstantProperty<${nativeType(property)}>`;
|
|
74
|
+
default:
|
|
75
|
+
throw new Error(`unknown property-type "${property['property-type']}" for ${property.name}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function runtimeType(property) {
|
|
80
|
+
switch (property.type) {
|
|
81
|
+
case 'boolean':
|
|
82
|
+
return 'BooleanType';
|
|
83
|
+
case 'number':
|
|
84
|
+
return 'NumberType';
|
|
85
|
+
case 'string':
|
|
86
|
+
case 'enum':
|
|
87
|
+
return 'StringType';
|
|
88
|
+
case 'color':
|
|
89
|
+
return 'ColorType';
|
|
90
|
+
case 'formatted':
|
|
91
|
+
return 'FormattedType';
|
|
92
|
+
case 'Image':
|
|
93
|
+
return 'ImageType';
|
|
94
|
+
case 'array':
|
|
95
|
+
if (property.length) {
|
|
96
|
+
return `array(${runtimeType({type: property.value})}, ${property.length})`;
|
|
97
|
+
} else {
|
|
98
|
+
return `array(${runtimeType({type: property.value})})`;
|
|
99
|
+
}
|
|
100
|
+
default: throw new Error(`unknown type for ${property.name}`)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function overrides(property) {
|
|
105
|
+
return `{ runtimeType: ${runtimeType(property)}, getOverride: (o) => o.${camelCase(property.name)}, hasOverride: (o) => !!o.${camelCase(property.name)} }`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function propertyValue(property, type) {
|
|
109
|
+
const propertyAsSpec = `styleSpec["${type}_${property.layerType}"]["${property.name}"] as any as StylePropertySpecification`;
|
|
110
|
+
|
|
111
|
+
switch (property['property-type']) {
|
|
112
|
+
case 'data-driven':
|
|
113
|
+
if (property.overridable) {
|
|
114
|
+
return `new DataDrivenProperty(${propertyAsSpec}, ${overrides(property)})`;
|
|
115
|
+
} else {
|
|
116
|
+
return `new DataDrivenProperty(${propertyAsSpec})`;
|
|
117
|
+
}
|
|
118
|
+
case 'cross-faded':
|
|
119
|
+
return `new CrossFadedProperty(${propertyAsSpec})`;
|
|
120
|
+
case 'cross-faded-data-driven':
|
|
121
|
+
return `new CrossFadedDataDrivenProperty(${propertyAsSpec})`;
|
|
122
|
+
case 'color-ramp':
|
|
123
|
+
return `new ColorRampProperty(${propertyAsSpec})`;
|
|
124
|
+
case 'data-constant':
|
|
125
|
+
case 'constant':
|
|
126
|
+
return `new DataConstantProperty(${propertyAsSpec})`;
|
|
127
|
+
default:
|
|
128
|
+
throw new Error(`unknown property-type "${property['property-type']}" for ${property.name}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const layers = Object.keys(spec.layer.type.values).map((type) => {
|
|
133
|
+
const layoutProperties = Object.keys(spec[`layout_${type}`]).reduce((memo, name) => {
|
|
134
|
+
if (name !== 'visibility') {
|
|
135
|
+
spec[`layout_${type}`][name].name = name;
|
|
136
|
+
spec[`layout_${type}`][name].layerType = type;
|
|
137
|
+
memo.push(spec[`layout_${type}`][name]);
|
|
138
|
+
}
|
|
139
|
+
return memo;
|
|
140
|
+
}, []);
|
|
141
|
+
|
|
142
|
+
const paintProperties = Object.keys(spec[`paint_${type}`]).reduce((memo, name) => {
|
|
143
|
+
spec[`paint_${type}`][name].name = name;
|
|
144
|
+
spec[`paint_${type}`][name].layerType = type;
|
|
145
|
+
memo.push(spec[`paint_${type}`][name]);
|
|
146
|
+
return memo;
|
|
147
|
+
}, []);
|
|
148
|
+
|
|
149
|
+
return { type, layoutProperties, paintProperties };
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
function emitlayerProperties(locals) {
|
|
153
|
+
const output = [];
|
|
154
|
+
const layerType = pascalCase(locals.type);
|
|
155
|
+
const {
|
|
156
|
+
layoutProperties,
|
|
157
|
+
paintProperties
|
|
158
|
+
} = locals;
|
|
159
|
+
|
|
160
|
+
output.push(
|
|
161
|
+
`// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.
|
|
162
|
+
/* eslint-disable */
|
|
163
|
+
|
|
164
|
+
import styleSpec from '../../style-spec/reference/latest';
|
|
165
|
+
|
|
166
|
+
import {
|
|
167
|
+
Properties,
|
|
168
|
+
DataConstantProperty,
|
|
169
|
+
DataDrivenProperty,
|
|
170
|
+
CrossFadedDataDrivenProperty,
|
|
171
|
+
CrossFadedProperty,
|
|
172
|
+
ColorRampProperty,
|
|
173
|
+
PossiblyEvaluatedPropertyValue,
|
|
174
|
+
CrossFaded
|
|
175
|
+
} from '../properties';
|
|
176
|
+
|
|
177
|
+
import type Color from '../../style-spec/util/color';
|
|
178
|
+
|
|
179
|
+
import type Formatted from '../../style-spec/expression/types/formatted';
|
|
180
|
+
|
|
181
|
+
import type ResolvedImage from '../../style-spec/expression/types/resolved_image';
|
|
182
|
+
import {StylePropertySpecification} from '../../style-spec/style-spec';
|
|
183
|
+
`);
|
|
184
|
+
|
|
185
|
+
const overridables = paintProperties.filter(p => p.overridable);
|
|
186
|
+
if (overridables.length) {
|
|
187
|
+
output.push(
|
|
188
|
+
`import {
|
|
189
|
+
${overridables.reduce((imports, prop) => { imports.push(runtimeType(prop)); return imports; }, []).join(',\n ')}
|
|
190
|
+
} from '../../style-spec/expression/types';
|
|
191
|
+
`);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (layoutProperties.length) {
|
|
195
|
+
output.push(
|
|
196
|
+
`export type ${layerType}LayoutProps = {`);
|
|
197
|
+
|
|
198
|
+
for (const property of layoutProperties) {
|
|
199
|
+
output.push(
|
|
200
|
+
` "${property.name}": ${propertyType(property)},`);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
output.push(
|
|
204
|
+
`};
|
|
205
|
+
|
|
206
|
+
export type ${layerType}LayoutPropsPossiblyEvaluated = {`);
|
|
207
|
+
|
|
208
|
+
for (const property of layoutProperties) {
|
|
209
|
+
output.push(
|
|
210
|
+
` "${property.name}": ${possiblyEvaluatedType(property)},`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
output.push(
|
|
214
|
+
`};
|
|
215
|
+
|
|
216
|
+
const layout: Properties<${layerType}LayoutProps> = new Properties({`);
|
|
217
|
+
|
|
218
|
+
for (const property of layoutProperties) {
|
|
219
|
+
output.push(
|
|
220
|
+
` "${property.name}": ${propertyValue(property, 'layout')},`);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
output.push(
|
|
224
|
+
'});');
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (paintProperties.length) {
|
|
228
|
+
output.push(
|
|
229
|
+
`
|
|
230
|
+
export type ${layerType}PaintProps = {`);
|
|
231
|
+
|
|
232
|
+
for (const property of paintProperties) {
|
|
233
|
+
output.push(
|
|
234
|
+
` "${property.name}": ${propertyType(property)},`);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
output.push(
|
|
238
|
+
`};
|
|
239
|
+
|
|
240
|
+
export type ${layerType}PaintPropsPossiblyEvaluated = {`);
|
|
241
|
+
|
|
242
|
+
for (const property of paintProperties) {
|
|
243
|
+
output.push(
|
|
244
|
+
` "${property.name}": ${possiblyEvaluatedType(property)},`);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
output.push(
|
|
248
|
+
'};');
|
|
249
|
+
} else {
|
|
250
|
+
output.push(
|
|
251
|
+
`export type ${layerType}PaintProps = {};`);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
output.push(
|
|
255
|
+
`
|
|
256
|
+
const paint: Properties<${layerType}PaintProps> = new Properties({`);
|
|
257
|
+
|
|
258
|
+
for (const property of paintProperties) {
|
|
259
|
+
output.push(
|
|
260
|
+
` "${property.name}": ${propertyValue(property, 'paint')},`);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
output.push(
|
|
264
|
+
`});
|
|
265
|
+
|
|
266
|
+
export default ({ paint${layoutProperties.length ? ', layout' : ''} } as {
|
|
267
|
+
paint: Properties<${layerType}PaintProps>${layoutProperties.length ? ',\n layout: Properties<' + layerType + 'LayoutProps>' : ''}
|
|
268
|
+
});`);
|
|
269
|
+
|
|
270
|
+
return output.join('\n');
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
for (const layer of layers) {
|
|
274
|
+
fs.writeFileSync(`src/style/style_layer/${layer.type.replace('-', '_')}_style_layer_properties.ts`, emitlayerProperties(layer))
|
|
275
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as properties from '../src/style-spec/util/properties';
|
|
3
|
+
|
|
4
|
+
import spec from '../src/style-spec/reference/v8.json';
|
|
5
|
+
|
|
6
|
+
function unionType(values) {
|
|
7
|
+
if (Array.isArray(values)) {
|
|
8
|
+
return values.map(v => JSON.stringify(v)).join(' | ');
|
|
9
|
+
} else {
|
|
10
|
+
return Object.keys(values).map(v => JSON.stringify(v)).join(' | ');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function propertyType(property) {
|
|
15
|
+
if (typeof property.type === 'function') {
|
|
16
|
+
return property.type();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const baseType = (() => {
|
|
20
|
+
switch (property.type) {
|
|
21
|
+
case 'string':
|
|
22
|
+
case 'number':
|
|
23
|
+
case 'boolean':
|
|
24
|
+
return property.type;
|
|
25
|
+
case 'enum':
|
|
26
|
+
return unionType(property.values);
|
|
27
|
+
case 'array':
|
|
28
|
+
const elementType = propertyType(typeof property.value === 'string' ? {type: property.value, values: property.values} : property.value)
|
|
29
|
+
if (property.length) {
|
|
30
|
+
return `[${Array(property.length).fill(elementType).join(', ')}]`;
|
|
31
|
+
} else {
|
|
32
|
+
return `Array<${elementType}>`;
|
|
33
|
+
}
|
|
34
|
+
case 'light':
|
|
35
|
+
return 'LightSpecification';
|
|
36
|
+
case 'sources':
|
|
37
|
+
return '{[_: string]: SourceSpecification}';
|
|
38
|
+
case '*':
|
|
39
|
+
return 'unknown';
|
|
40
|
+
default:
|
|
41
|
+
return `${property.type.slice(0, 1).toUpperCase()}${property.type.slice(1)}Specification`;
|
|
42
|
+
}
|
|
43
|
+
})();
|
|
44
|
+
|
|
45
|
+
if (properties.supportsPropertyExpression(property)) {
|
|
46
|
+
return `DataDrivenPropertyValueSpecification<${baseType}>`;
|
|
47
|
+
} else if (properties.supportsZoomExpression(property)) {
|
|
48
|
+
return `PropertyValueSpecification<${baseType}>`;
|
|
49
|
+
} else if (property.expression) {
|
|
50
|
+
return 'ExpressionSpecificationArray';
|
|
51
|
+
} else {
|
|
52
|
+
return baseType;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function propertyDeclaration(key, property) {
|
|
57
|
+
return `"${key}"${property.required ? '' : '?'}: ${propertyType(property)}`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function objectDeclaration(key, properties) {
|
|
61
|
+
return `export type ${key} = ${objectType(properties, '')};`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function objectType(properties, indent) {
|
|
65
|
+
return `{
|
|
66
|
+
${Object.keys(properties)
|
|
67
|
+
.filter(k => k !== '*')
|
|
68
|
+
.map(k => ` ${indent}${propertyDeclaration(k, properties[k])}`)
|
|
69
|
+
.join(',\n')}
|
|
70
|
+
${indent}}`
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function sourceTypeName(key) {
|
|
74
|
+
return key.replace(/source_(.)(.*)/, (_, _1, _2) => `${_1.toUpperCase()}${_2}SourceSpecification`)
|
|
75
|
+
.replace(/_dem/, 'DEM')
|
|
76
|
+
.replace(/Geojson/, 'GeoJSON');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function layerTypeName(key) {
|
|
80
|
+
return key.split('-').map(k => k.replace(/(.)(.*)/, (_, _1, _2) => `${_1.toUpperCase()}${_2}`)).concat('LayerSpecification').join('');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function layerType(key) {
|
|
84
|
+
const layer = spec.layer as any;
|
|
85
|
+
|
|
86
|
+
layer.type = {
|
|
87
|
+
type: 'enum',
|
|
88
|
+
values: [key],
|
|
89
|
+
required: true
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
delete layer.ref;
|
|
93
|
+
delete layer['paint.*'];
|
|
94
|
+
|
|
95
|
+
layer.paint.type = () => {
|
|
96
|
+
return objectType(spec[`paint_${key}`], ' ');
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
layer.layout.type = () => {
|
|
100
|
+
return objectType(spec[`layout_${key}`], ' ');
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
if (key === 'background') {
|
|
104
|
+
delete layer.source;
|
|
105
|
+
delete layer['source-layer'];
|
|
106
|
+
delete layer.filter;
|
|
107
|
+
} else {
|
|
108
|
+
layer.source.required = true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return objectDeclaration(layerTypeName(key), layer);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const layerTypes = Object.keys(spec.layer.type.values);
|
|
115
|
+
|
|
116
|
+
fs.writeFileSync('src/style-spec/types.ts',
|
|
117
|
+
`// Generated code; do not edit. Edit build/generate-style-spec.ts instead.
|
|
118
|
+
/* eslint-disable */
|
|
119
|
+
|
|
120
|
+
export type ColorSpecification = string;
|
|
121
|
+
|
|
122
|
+
export type FormattedSpecification = string;
|
|
123
|
+
|
|
124
|
+
export type ResolvedImageSpecification = string;
|
|
125
|
+
|
|
126
|
+
export type PromoteIdSpecification = {[_: string]: string} | string;
|
|
127
|
+
|
|
128
|
+
export type FilterSpecificationInputType = string | number | boolean;
|
|
129
|
+
export type FilterSpecification =
|
|
130
|
+
// Lookup
|
|
131
|
+
| ['at', number, (number |string)[]]
|
|
132
|
+
| ['get', string, Record<string, unknown>?]
|
|
133
|
+
| ['has', string, Record<string, unknown>?]
|
|
134
|
+
| ['in', ...FilterSpecificationInputType[], FilterSpecificationInputType | FilterSpecificationInputType[]]
|
|
135
|
+
| ['index-of', FilterSpecificationInputType, FilterSpecificationInputType | FilterSpecificationInputType[]]
|
|
136
|
+
| ['length', string | string[]]
|
|
137
|
+
| ['slice', string | string[], number]
|
|
138
|
+
// Decision
|
|
139
|
+
| ['!', FilterSpecification]
|
|
140
|
+
| ['!=', string | FilterSpecification, FilterSpecificationInputType]
|
|
141
|
+
| ['<', string | FilterSpecification, FilterSpecificationInputType]
|
|
142
|
+
| ['<=', string | FilterSpecification, FilterSpecificationInputType]
|
|
143
|
+
| ['==', string | FilterSpecification, FilterSpecificationInputType]
|
|
144
|
+
| ['>', string | FilterSpecification, FilterSpecificationInputType]
|
|
145
|
+
| ['>=', string | FilterSpecification, FilterSpecificationInputType]
|
|
146
|
+
| ["all", ...FilterSpecification[], FilterSpecificationInputType]
|
|
147
|
+
| ["any", ...FilterSpecification[], FilterSpecificationInputType]
|
|
148
|
+
| ["case", ...FilterSpecification[], FilterSpecificationInputType]
|
|
149
|
+
| ["coalesce", ...FilterSpecification[], FilterSpecificationInputType]
|
|
150
|
+
| ["match", ...FilterSpecification[], FilterSpecificationInputType]
|
|
151
|
+
| ["within", ...FilterSpecification[], FilterSpecificationInputType]
|
|
152
|
+
// Used in convert.ts
|
|
153
|
+
| ["!in", ...FilterSpecification[], FilterSpecificationInputType]
|
|
154
|
+
| ["!has", ...FilterSpecification[], FilterSpecificationInputType]
|
|
155
|
+
| ["none", ...FilterSpecification[], FilterSpecificationInputType]
|
|
156
|
+
// Fallbak for others
|
|
157
|
+
| Array<string | FilterSpecification>
|
|
158
|
+
|
|
159
|
+
export type TransitionSpecification = {
|
|
160
|
+
duration?: number,
|
|
161
|
+
delay?: number
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// Note: doesn't capture interpolatable vs. non-interpolatable types.
|
|
165
|
+
|
|
166
|
+
export type CameraFunctionSpecification<T> =
|
|
167
|
+
{ type: 'exponential', stops: Array<[number, T]> }
|
|
168
|
+
| { type: 'interval', stops: Array<[number, T]> };
|
|
169
|
+
|
|
170
|
+
export type SourceFunctionSpecification<T> =
|
|
171
|
+
{ type: 'exponential', stops: Array<[number, T]>, property: string, default?: T }
|
|
172
|
+
| { type: 'interval', stops: Array<[number, T]>, property: string, default?: T }
|
|
173
|
+
| { type: 'categorical', stops: Array<[string | number | boolean, T]>, property: string, default?: T }
|
|
174
|
+
| { type: 'identity', property: string, default?: T };
|
|
175
|
+
|
|
176
|
+
export type CompositeFunctionSpecification<T> =
|
|
177
|
+
{ type: 'exponential', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
|
|
178
|
+
| { type: 'interval', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T }
|
|
179
|
+
| { type: 'categorical', stops: Array<[{zoom: number, value: string | number | boolean}, T]>, property: string, default?: T };
|
|
180
|
+
|
|
181
|
+
export type ExpressionSpecificationArray = Array<unknown>;
|
|
182
|
+
|
|
183
|
+
export type PropertyValueSpecification<T> =
|
|
184
|
+
T
|
|
185
|
+
| CameraFunctionSpecification<T>
|
|
186
|
+
| ExpressionSpecificationArray;
|
|
187
|
+
|
|
188
|
+
export type DataDrivenPropertyValueSpecification<T> =
|
|
189
|
+
T
|
|
190
|
+
| CameraFunctionSpecification<T>
|
|
191
|
+
| SourceFunctionSpecification<T>
|
|
192
|
+
| CompositeFunctionSpecification<T>
|
|
193
|
+
| ExpressionSpecificationArray;
|
|
194
|
+
|
|
195
|
+
${objectDeclaration('StyleSpecification', spec.$root)}
|
|
196
|
+
|
|
197
|
+
${objectDeclaration('LightSpecification', spec.light)}
|
|
198
|
+
|
|
199
|
+
${spec.source.map(key => objectDeclaration(sourceTypeName(key), spec[key])).join('\n\n')}
|
|
200
|
+
|
|
201
|
+
export type SourceSpecification =
|
|
202
|
+
${spec.source.map(key => ` | ${sourceTypeName(key)}`).join('\n')}
|
|
203
|
+
|
|
204
|
+
${layerTypes.map(key => layerType(key)).join('\n\n')}
|
|
205
|
+
|
|
206
|
+
export type LayerSpecification =
|
|
207
|
+
${layerTypes.map(key => ` | ${layerTypeName(key)}`).join('\n')};
|
|
208
|
+
|
|
209
|
+
`);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default function glsl_to_js(code, minify) {
|
|
2
|
+
if (minify) {
|
|
3
|
+
code = code.trim() // strip whitespace at the start/end
|
|
4
|
+
.replace(/\s*\/\/[^\n]*\n/g, '\n') // strip double-slash comments
|
|
5
|
+
.replace(/\n+/g, '\n') // collapse multi line breaks
|
|
6
|
+
.replace(/\n\s+/g, '\n') // strip identation
|
|
7
|
+
.replace(/\s?([+-\/*=,])\s?/g, '$1') // strip whitespace around operators
|
|
8
|
+
.replace(/([;\(\),\{\}])\n(?=[^#])/g, '$1'); // strip more line breaks
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
return `export default ${JSON.stringify(code)};`;
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import glob from 'glob';
|
|
3
|
+
import child_process from 'child_process';
|
|
4
|
+
import glsl_to_js from './glsl_to_js.js';
|
|
5
|
+
|
|
6
|
+
let args = process.argv.slice(2);
|
|
7
|
+
let outputBaseDir = args[0];
|
|
8
|
+
let minify = args[1];
|
|
9
|
+
|
|
10
|
+
console.log(`Copying glsl files to ${outputBaseDir}, minify: ${minify}`);
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This script is intended to copy the glsl file to the compilation output folder,
|
|
14
|
+
* change their extension to .js and export the shaders as strings in javascript.
|
|
15
|
+
* It will also minify them a bit if needed and change the extension to .js
|
|
16
|
+
* After that it will create a combined typescript definition file and manipulate it a bit
|
|
17
|
+
* It will also create a simple package.json file to allow importing this package in webpack
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
glob("./src/**/*.glsl", null, (err, files) => {
|
|
21
|
+
for (let file of files) {
|
|
22
|
+
let code = fs.readFileSync(file, 'utf8');
|
|
23
|
+
let content = glsl_to_js(code, minify);
|
|
24
|
+
let fileName = outputBaseDir + '/' + file.split('/').splice(-1) + ".js";
|
|
25
|
+
fs.writeFileSync(fileName, content);
|
|
26
|
+
}
|
|
27
|
+
console.log(`Finished converting ${files.length} glsl files`);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (!fs.existsSync("dist")) {
|
|
31
|
+
fs.mkdirSync("dist");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
console.log(`Starting bundling types`);
|
|
35
|
+
const outputFile = "./dist/maplibre-gl.d.ts";
|
|
36
|
+
child_process.execSync(`dts-bundle-generator --no-check --umd-module-name=maplibregl -o ${outputFile} ./src/index.ts`);
|
|
37
|
+
let types = fs.readFileSync(outputFile, 'utf8');
|
|
38
|
+
// Classes are not exported but should be since this is exported as UMD - fixing...
|
|
39
|
+
types = types.replace(/declare class/g, "export declare class");
|
|
40
|
+
// Missing vector-tile types that are added to this file too
|
|
41
|
+
let file = fs.readFileSync("./src/types/packages-types/vector-tile/index.d.ts", 'utf8');
|
|
42
|
+
let lines = file.split("\n").filter(Boolean);
|
|
43
|
+
lines.pop(); // last } is removed too.
|
|
44
|
+
types = lines.join("\n") + "\n" + types;
|
|
45
|
+
// remove imports of vector-tile and declare module lines
|
|
46
|
+
types = types.split("\n")
|
|
47
|
+
.filter(l => !l.includes("@mapbox/vector-tile"))
|
|
48
|
+
.join("\n");
|
|
49
|
+
fs.writeFileSync(outputFile, types);
|
|
50
|
+
console.log(`Finished bundling types`);
|
|
51
|
+
|
|
52
|
+
fs.writeFileSync("./dist/package.json", '{ "type": "commonjs" }');
|
package/build/readme.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Build Scripts
|
|
2
|
+
This folder holds common build scripts accessed via the various `npm run` commands.
|
|
3
|
+
|
|
4
|
+
## Bundeling all the code
|
|
5
|
+
|
|
6
|
+
The bundeling process can be split into several steps:
|
|
7
|
+
|
|
8
|
+
`npx run tsc`
|
|
9
|
+
This command will transpile all the typescript files into javascript files and place them in the `rollup/build` folder.
|
|
10
|
+
|
|
11
|
+
`npm run build-glsl`
|
|
12
|
+
This command will copy all the shader files to the build output and convert the shaders into strings that can be imported to javascript.
|
|
13
|
+
|
|
14
|
+
`npm run build-css`
|
|
15
|
+
This command will compile the css code and create the css file.
|
|
16
|
+
|
|
17
|
+
`npm run build-prod` or `npm run build-prod-min` or `npm run build-dev`
|
|
18
|
+
These commands will use rollup to bundle the code. This is where the magic happens and uses some files in this folder.
|
|
19
|
+
|
|
20
|
+
`banner.js` is used to create a banner at the beginning of the output file
|
|
21
|
+
|
|
22
|
+
`rollup_plugins.js` is used to define common plugins for rollup configurations
|
|
23
|
+
|
|
24
|
+
`rollup_plugin_minify_style_spec.js` is used to specify the plugin used in style spec bundeling
|
|
25
|
+
|
|
26
|
+
In the `rollup` folder there are some files that are used as linking files as they link to other files for rollup to pick when bundling.
|
|
27
|
+
Rollup also has a configuration in the `package.json` file to signal which files it needs to replace when bundling for the browser, this is where `web_worker_replacement.js` is used - as it replaces the node mocking of web worker that is present in the source code.
|
|
28
|
+
|
|
29
|
+
Rollup is generating 3 files throughout the process of bundling:
|
|
30
|
+
|
|
31
|
+
`index.js` a file containing all the code that will run in the main thread.
|
|
32
|
+
|
|
33
|
+
`shared.js` a file containing all the code shared between the main and worker code.
|
|
34
|
+
|
|
35
|
+
`worker.js` a file containing all the code the will run in the worker threads.
|
|
36
|
+
|
|
37
|
+
These 3 files are then referenced and used by the `bundle_prelude.js` file. It allows loading the web wroker code automatically in web workers without any extra effort from someone who would like to use the library, i.e. it simply works.
|
|
38
|
+
|
|
39
|
+
### check-bundle-size.js
|
|
40
|
+
This file is used by CI to make sure the bundle size is kept constant
|
|
41
|
+
|
|
42
|
+
<hr>
|
|
43
|
+
|
|
44
|
+
### `npm run codegen`
|
|
45
|
+
The `codegen` command runs the following three scripts, to update the corresponding code files based on the `v8.json` style source, and other data files. Contributers should run this command manually when the underlying style data is modified. The generated code files are then commited to the repo.
|
|
46
|
+
#### generate-struct-arrays.ts
|
|
47
|
+
Generates `data/array_types.ts`, which consists of:
|
|
48
|
+
- `StructArrayLayout_*` subclasses, one for each underlying memory layout
|
|
49
|
+
- Named exports mapping each conceptual array type (e.g., `CircleLayoutArray`) to its corresponding `StructArrayLayout` class
|
|
50
|
+
- Specific named `StructArray` subclasses, when type-specific struct accessors are needed (e.g., `CollisionBoxArray`)
|
|
51
|
+
#### generate-style-code.ts
|
|
52
|
+
Generates the various `style/style_layer/[layer type]_style_layer_properties.ts` code files based on the content of `v8.json`. These files provide the type signatures for the paint and layout properties for each type of style layer.
|
|
53
|
+
#### generate-style-spec.ts
|
|
54
|
+
Generates `style-spec/types.ts` based on the content of `v8.json`. This provides the type signatures for a style specification (sources, layers, etc.).
|
|
55
|
+
<hr>
|
|
56
|
+
|
|
57
|
+
### Generate Release Nodes
|
|
58
|
+
The following files are being used to generate release notes:
|
|
59
|
+
|
|
60
|
+
`release-notes.js` Used to generate release notes when releasing a new version
|
|
61
|
+
|
|
62
|
+
`release-notes.md.ejs` Used for the generation as a template file
|
package/build/release-notes.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import {execSync} from 'child_process';
|
|
5
|
+
import * as ejs from 'ejs';
|
|
6
|
+
import _ from 'lodash';
|
|
7
|
+
import semver from 'semver';
|
|
8
8
|
|
|
9
9
|
const changelogPath = 'CHANGELOG.md';
|
|
10
10
|
const changelog = fs.readFileSync(changelogPath, 'utf8');
|
|
@@ -36,6 +36,7 @@ let previousVersion = semver.maxSatisfying(gitTags, "<" + currentVersion, { incl
|
|
|
36
36
|
const regex = /^## (\d+\.\d+\.\d+).*?\n(.+?)(?=\n^## \d+\.\d+\.\d+.*?\n)/gms;
|
|
37
37
|
|
|
38
38
|
let releaseNotes = [];
|
|
39
|
+
let match;
|
|
39
40
|
// eslint-disable-next-line no-cond-assign
|
|
40
41
|
while (match = regex.exec(changelog)) {
|
|
41
42
|
releaseNotes.push({
|