mapbox-gl 1.13.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/.flowconfig +61 -0
- package/CHANGELOG.md +2485 -0
- package/LICENSE.txt +84 -0
- package/README.md +34 -0
- package/build/banner.js +4 -0
- package/build/check-bundle-size.js +140 -0
- package/build/diff-tarball.js +18 -0
- package/build/generate-access-token-script.js +11 -0
- package/build/generate-flow-typed-style-spec.js +188 -0
- package/build/generate-release-list.js +21 -0
- package/build/generate-struct-arrays.js +243 -0
- package/build/generate-style-code.js +159 -0
- package/build/mapbox-gl.js.flow +3 -0
- package/build/print-release-url.js +6 -0
- package/build/rollup_plugin_minify_style_spec.js +24 -0
- package/build/rollup_plugins.js +80 -0
- package/build/run-node +3 -0
- package/build/run-tap +8 -0
- package/build/test/build-tape.js +19 -0
- package/dist/mapbox-gl-csp-worker.js +2 -0
- package/dist/mapbox-gl-csp-worker.js.map +1 -0
- package/dist/mapbox-gl-csp.js +2 -0
- package/dist/mapbox-gl-csp.js.map +1 -0
- package/dist/mapbox-gl-dev.js +65889 -0
- package/dist/mapbox-gl-dev.js.flow +3 -0
- package/dist/mapbox-gl-unminified.js +42889 -0
- package/dist/mapbox-gl-unminified.js.map +1 -0
- package/dist/mapbox-gl.css +1 -0
- package/dist/mapbox-gl.js +42 -0
- package/dist/mapbox-gl.js.flow +3 -0
- package/dist/mapbox-gl.js.map +1 -0
- package/dist/style-spec/index.es.js +15032 -0
- package/dist/style-spec/index.es.js.map +1 -0
- package/dist/style-spec/index.js +15058 -0
- package/dist/style-spec/index.js.map +1 -0
- package/flow-typed/gl.js +5 -0
- package/flow-typed/jsdom.js +18 -0
- package/flow-typed/mapbox-gl-supported.js +9 -0
- package/flow-typed/mapbox-unitbezier.js +14 -0
- package/flow-typed/offscreen-canvas.js +9 -0
- package/flow-typed/pbf.js +25 -0
- package/flow-typed/point-geometry.js +44 -0
- package/flow-typed/potpack.js +12 -0
- package/flow-typed/sinon.js +28 -0
- package/flow-typed/vector-tile.js +41 -0
- package/package.json +173 -0
- package/src/css/mapbox-gl.css +812 -0
- package/src/css/svg/mapboxgl-ctrl-attrib.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-compass.svg +4 -0
- package/src/css/svg/mapboxgl-ctrl-fullscreen.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-geolocate.svg +5 -0
- package/src/css/svg/mapboxgl-ctrl-logo.svg +20 -0
- package/src/css/svg/mapboxgl-ctrl-shrink.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-zoom-in.svg +3 -0
- package/src/css/svg/mapboxgl-ctrl-zoom-out.svg +3 -0
- package/src/data/array_types.js +1135 -0
- package/src/data/bucket/circle_attributes.js +9 -0
- package/src/data/bucket/circle_bucket.js +201 -0
- package/src/data/bucket/fill_attributes.js +9 -0
- package/src/data/bucket/fill_bucket.js +229 -0
- package/src/data/bucket/fill_extrusion_attributes.js +10 -0
- package/src/data/bucket/fill_extrusion_bucket.js +283 -0
- package/src/data/bucket/heatmap_bucket.js +17 -0
- package/src/data/bucket/line_attributes.js +10 -0
- package/src/data/bucket/line_attributes_ext.js +10 -0
- package/src/data/bucket/line_bucket.js +594 -0
- package/src/data/bucket/pattern_attributes.js +12 -0
- package/src/data/bucket/pattern_bucket_features.js +60 -0
- package/src/data/bucket/symbol_attributes.js +117 -0
- package/src/data/bucket/symbol_bucket.js +937 -0
- package/src/data/bucket.js +123 -0
- package/src/data/dem_data.js +125 -0
- package/src/data/evaluation_feature.js +25 -0
- package/src/data/extent.js +18 -0
- package/src/data/feature_index.js +322 -0
- package/src/data/feature_position_map.js +131 -0
- package/src/data/index_array_type.js +16 -0
- package/src/data/load_geometry.js +46 -0
- package/src/data/pos_attributes.js +6 -0
- package/src/data/program_configuration.js +708 -0
- package/src/data/raster_bounds_attributes.js +7 -0
- package/src/data/segment.js +76 -0
- package/src/geo/edge_insets.js +102 -0
- package/src/geo/lng_lat.js +168 -0
- package/src/geo/lng_lat_bounds.js +276 -0
- package/src/geo/mercator_coordinate.js +150 -0
- package/src/geo/transform.js +834 -0
- package/src/gl/color_mode.js +34 -0
- package/src/gl/context.js +302 -0
- package/src/gl/cull_face_mode.js +26 -0
- package/src/gl/depth_mode.js +29 -0
- package/src/gl/framebuffer.js +44 -0
- package/src/gl/index_buffer.js +55 -0
- package/src/gl/stencil_mode.js +30 -0
- package/src/gl/types.js +84 -0
- package/src/gl/value.js +520 -0
- package/src/gl/vertex_buffer.js +119 -0
- package/src/index.js +230 -0
- package/src/render/draw_background.js +57 -0
- package/src/render/draw_circle.js +113 -0
- package/src/render/draw_collision_debug.js +172 -0
- package/src/render/draw_custom.js +49 -0
- package/src/render/draw_debug.js +127 -0
- package/src/render/draw_fill.js +124 -0
- package/src/render/draw_fill_extrusion.js +95 -0
- package/src/render/draw_heatmap.js +133 -0
- package/src/render/draw_hillshade.js +107 -0
- package/src/render/draw_line.js +125 -0
- package/src/render/draw_raster.js +125 -0
- package/src/render/draw_symbol.js +392 -0
- package/src/render/glyph_atlas.js +71 -0
- package/src/render/glyph_manager.js +182 -0
- package/src/render/image_atlas.js +149 -0
- package/src/render/image_manager.js +306 -0
- package/src/render/line_atlas.js +210 -0
- package/src/render/painter.js +654 -0
- package/src/render/program/background_program.js +103 -0
- package/src/render/program/circle_program.js +69 -0
- package/src/render/program/clipping_mask_program.js +20 -0
- package/src/render/program/collision_program.js +76 -0
- package/src/render/program/debug_program.js +35 -0
- package/src/render/program/fill_extrusion_program.js +122 -0
- package/src/render/program/fill_program.js +126 -0
- package/src/render/program/heatmap_program.js +83 -0
- package/src/render/program/hillshade_program.js +119 -0
- package/src/render/program/line_program.js +211 -0
- package/src/render/program/pattern.js +102 -0
- package/src/render/program/program_uniforms.js +42 -0
- package/src/render/program/raster_program.js +92 -0
- package/src/render/program/symbol_program.js +224 -0
- package/src/render/program.js +188 -0
- package/src/render/texture.js +122 -0
- package/src/render/uniform_binding.js +147 -0
- package/src/render/vertex_array_object.js +163 -0
- package/src/shaders/README.md +42 -0
- package/src/shaders/_prelude.fragment.glsl +17 -0
- package/src/shaders/_prelude.vertex.glsl +73 -0
- package/src/shaders/background.fragment.glsl +10 -0
- package/src/shaders/background.vertex.glsl +7 -0
- package/src/shaders/background_pattern.fragment.glsl +28 -0
- package/src/shaders/background_pattern.vertex.glsl +20 -0
- package/src/shaders/circle.fragment.glsl +39 -0
- package/src/shaders/circle.vertex.glsl +64 -0
- package/src/shaders/clipping_mask.fragment.glsl +3 -0
- package/src/shaders/clipping_mask.vertex.glsl +7 -0
- package/src/shaders/collision_box.fragment.glsl +21 -0
- package/src/shaders/collision_box.vertex.glsl +27 -0
- package/src/shaders/collision_circle.fragment.glsl +17 -0
- package/src/shaders/collision_circle.vertex.glsl +59 -0
- package/src/shaders/debug.fragment.glsl +9 -0
- package/src/shaders/debug.vertex.glsl +12 -0
- package/src/shaders/encode_attribute.js +17 -0
- package/src/shaders/fill.fragment.glsl +13 -0
- package/src/shaders/fill.vertex.glsl +13 -0
- package/src/shaders/fill_extrusion.fragment.glsl +9 -0
- package/src/shaders/fill_extrusion.vertex.glsl +66 -0
- package/src/shaders/fill_extrusion_pattern.fragment.glsl +45 -0
- package/src/shaders/fill_extrusion_pattern.vertex.glsl +79 -0
- package/src/shaders/fill_outline.fragment.glsl +17 -0
- package/src/shaders/fill_outline.vertex.glsl +17 -0
- package/src/shaders/fill_outline_pattern.fragment.glsl +43 -0
- package/src/shaders/fill_outline_pattern.vertex.glsl +44 -0
- package/src/shaders/fill_pattern.fragment.glsl +36 -0
- package/src/shaders/fill_pattern.vertex.glsl +39 -0
- package/src/shaders/heatmap.fragment.glsl +22 -0
- package/src/shaders/heatmap.vertex.glsl +54 -0
- package/src/shaders/heatmap_texture.fragment.glsl +14 -0
- package/src/shaders/heatmap_texture.vertex.glsl +11 -0
- package/src/shaders/hillshade.fragment.glsl +52 -0
- package/src/shaders/hillshade.vertex.glsl +11 -0
- package/src/shaders/hillshade_prepare.fragment.glsl +75 -0
- package/src/shaders/hillshade_prepare.vertex.glsl +15 -0
- package/src/shaders/index.js +20 -0
- package/src/shaders/line.fragment.glsl +30 -0
- package/src/shaders/line.vertex.glsl +85 -0
- package/src/shaders/line_gradient.fragment.glsl +34 -0
- package/src/shaders/line_gradient.vertex.glsl +88 -0
- package/src/shaders/line_pattern.fragment.glsl +74 -0
- package/src/shaders/line_pattern.vertex.glsl +99 -0
- package/src/shaders/line_sdf.fragment.glsl +45 -0
- package/src/shaders/line_sdf.vertex.glsl +98 -0
- package/src/shaders/raster.fragment.glsl +52 -0
- package/src/shaders/raster.vertex.glsl +21 -0
- package/src/shaders/shaders.js +185 -0
- package/src/shaders/symbol_icon.fragment.glsl +17 -0
- package/src/shaders/symbol_icon.vertex.glsl +94 -0
- package/src/shaders/symbol_sdf.fragment.glsl +52 -0
- package/src/shaders/symbol_sdf.vertex.glsl +115 -0
- package/src/shaders/symbol_text_and_icon.fragment.glsl +68 -0
- package/src/shaders/symbol_text_and_icon.vertex.glsl +116 -0
- package/src/source/canvas_source.js +238 -0
- package/src/source/geojson_source.js +370 -0
- package/src/source/geojson_worker_source.js +366 -0
- package/src/source/geojson_wrapper.js +94 -0
- package/src/source/image_source.js +307 -0
- package/src/source/load_tilejson.js +39 -0
- package/src/source/pixels_to_tile_units.js +21 -0
- package/src/source/query_features.js +208 -0
- package/src/source/raster_dem_tile_source.js +138 -0
- package/src/source/raster_dem_tile_worker_source.js +62 -0
- package/src/source/raster_tile_source.js +169 -0
- package/src/source/rtl_text_plugin.js +143 -0
- package/src/source/source.js +137 -0
- package/src/source/source_cache.js +953 -0
- package/src/source/source_state.js +159 -0
- package/src/source/tile.js +458 -0
- package/src/source/tile_bounds.js +38 -0
- package/src/source/tile_cache.js +212 -0
- package/src/source/tile_id.js +199 -0
- package/src/source/vector_tile_source.js +259 -0
- package/src/source/vector_tile_worker_source.js +216 -0
- package/src/source/video_source.js +203 -0
- package/src/source/worker.js +240 -0
- package/src/source/worker_source.js +107 -0
- package/src/source/worker_tile.js +224 -0
- package/src/style/create_style_layer.js +36 -0
- package/src/style/evaluation_parameters.js +62 -0
- package/src/style/format_section_override.js +56 -0
- package/src/style/light.js +130 -0
- package/src/style/load_glyph_range.js +38 -0
- package/src/style/load_sprite.js +67 -0
- package/src/style/parse_glyph_pbf.js +44 -0
- package/src/style/pauseable_placement.js +132 -0
- package/src/style/properties.js +753 -0
- package/src/style/query_utils.js +43 -0
- package/src/style/style.js +1374 -0
- package/src/style/style_glyph.js +17 -0
- package/src/style/style_image.js +137 -0
- package/src/style/style_layer/background_style_layer.js +21 -0
- package/src/style/style_layer/background_style_layer_properties.js +40 -0
- package/src/style/style_layer/circle_style_layer.js +98 -0
- package/src/style/style_layer/circle_style_layer_properties.js +63 -0
- package/src/style/style_layer/custom_style_layer.js +223 -0
- package/src/style/style_layer/fill_extrusion_style_layer.js +224 -0
- package/src/style/style_layer/fill_extrusion_style_layer_properties.js +50 -0
- package/src/style/style_layer/fill_style_layer.js +67 -0
- package/src/style/style_layer/fill_style_layer_properties.js +55 -0
- package/src/style/style_layer/heatmap_style_layer.js +73 -0
- package/src/style/style_layer/heatmap_style_layer_properties.js +44 -0
- package/src/style/style_layer/hillshade_style_layer.js +25 -0
- package/src/style/style_layer/hillshade_style_layer_properties.js +46 -0
- package/src/style/style_layer/layer_properties.js.ejs +69 -0
- package/src/style/style_layer/line_style_layer.js +150 -0
- package/src/style/style_layer/line_style_layer_properties.js +71 -0
- package/src/style/style_layer/raster_style_layer.js +21 -0
- package/src/style/style_layer/raster_style_layer_properties.js +50 -0
- package/src/style/style_layer/symbol_style_layer.js +190 -0
- package/src/style/style_layer/symbol_style_layer_properties.js +153 -0
- package/src/style/style_layer/typed_style_layer.js +17 -0
- package/src/style/style_layer.js +283 -0
- package/src/style/style_layer_index.js +80 -0
- package/src/style/validate_style.js +42 -0
- package/src/style/zoom_history.js +44 -0
- package/src/style-spec/.eslintrc +5 -0
- package/src/style-spec/CHANGELOG.md +468 -0
- package/src/style-spec/README.md +59 -0
- package/src/style-spec/bin/gl-style-composite +9 -0
- package/src/style-spec/bin/gl-style-format +22 -0
- package/src/style-spec/bin/gl-style-migrate +9 -0
- package/src/style-spec/bin/gl-style-validate +50 -0
- package/src/style-spec/composite.js +50 -0
- package/src/style-spec/declass.js +42 -0
- package/src/style-spec/deref.js +52 -0
- package/src/style-spec/diff.js +393 -0
- package/src/style-spec/dist/.gitkeep +0 -0
- package/src/style-spec/dist/index.es.js +15032 -0
- package/src/style-spec/dist/index.es.js.map +1 -0
- package/src/style-spec/dist/index.js +15058 -0
- package/src/style-spec/dist/index.js.map +1 -0
- package/src/style-spec/empty.js +29 -0
- package/src/style-spec/error/parsing_error.js +16 -0
- package/src/style-spec/error/validation_error.js +18 -0
- package/src/style-spec/expression/compound_expression.js +162 -0
- package/src/style-spec/expression/definitions/assertion.js +130 -0
- package/src/style-spec/expression/definitions/at.js +70 -0
- package/src/style-spec/expression/definitions/case.js +85 -0
- package/src/style-spec/expression/definitions/coalesce.js +93 -0
- package/src/style-spec/expression/definitions/coercion.js +133 -0
- package/src/style-spec/expression/definitions/collator.js +78 -0
- package/src/style-spec/expression/definitions/comparison.js +184 -0
- package/src/style-spec/expression/definitions/format.js +144 -0
- package/src/style-spec/expression/definitions/image.js +52 -0
- package/src/style-spec/expression/definitions/in.js +72 -0
- package/src/style-spec/expression/definitions/index.js +565 -0
- package/src/style-spec/expression/definitions/index_of.js +89 -0
- package/src/style-spec/expression/definitions/interpolate.js +267 -0
- package/src/style-spec/expression/definitions/length.js +61 -0
- package/src/style-spec/expression/definitions/let.js +72 -0
- package/src/style-spec/expression/definitions/literal.js +77 -0
- package/src/style-spec/expression/definitions/match.js +158 -0
- package/src/style-spec/expression/definitions/number_format.js +142 -0
- package/src/style-spec/expression/definitions/slice.js +86 -0
- package/src/style-spec/expression/definitions/step.js +120 -0
- package/src/style-spec/expression/definitions/var.js +46 -0
- package/src/style-spec/expression/definitions/within.js +342 -0
- package/src/style-spec/expression/evaluation_context.js +59 -0
- package/src/style-spec/expression/expression.js +27 -0
- package/src/style-spec/expression/index.js +392 -0
- package/src/style-spec/expression/is_constant.js +59 -0
- package/src/style-spec/expression/parsing_context.js +233 -0
- package/src/style-spec/expression/parsing_error.js +13 -0
- package/src/style-spec/expression/runtime_error.js +17 -0
- package/src/style-spec/expression/scope.js +36 -0
- package/src/style-spec/expression/stops.js +39 -0
- package/src/style-spec/expression/types/collator.js +61 -0
- package/src/style-spec/expression/types/formatted.js +73 -0
- package/src/style-spec/expression/types/resolved_image.js +29 -0
- package/src/style-spec/expression/types.js +126 -0
- package/src/style-spec/expression/values.js +123 -0
- package/src/style-spec/feature_filter/README.md +55 -0
- package/src/style-spec/feature_filter/convert.js +208 -0
- package/src/style-spec/feature_filter/index.js +175 -0
- package/src/style-spec/format.js +51 -0
- package/src/style-spec/function/convert.js +270 -0
- package/src/style-spec/function/index.js +262 -0
- package/src/style-spec/group_by_layout.js +75 -0
- package/src/style-spec/migrate/expressions.js +39 -0
- package/src/style-spec/migrate/v8.js +203 -0
- package/src/style-spec/migrate/v9.js +26 -0
- package/src/style-spec/migrate.js +36 -0
- package/src/style-spec/package.json +41 -0
- package/src/style-spec/read_style.js +14 -0
- package/src/style-spec/reference/latest.js +3 -0
- package/src/style-spec/reference/v8.json +5914 -0
- package/src/style-spec/rollup.config.js +65 -0
- package/src/style-spec/style-spec.js +124 -0
- package/src/style-spec/types.js +432 -0
- package/src/style-spec/util/color.js +95 -0
- package/src/style-spec/util/color_spaces.js +139 -0
- package/src/style-spec/util/deep_equal.js +28 -0
- package/src/style-spec/util/extend.js +10 -0
- package/src/style-spec/util/get_type.js +17 -0
- package/src/style-spec/util/interpolate.js +22 -0
- package/src/style-spec/util/properties.js +15 -0
- package/src/style-spec/util/ref_properties.js +2 -0
- package/src/style-spec/util/result.js +19 -0
- package/src/style-spec/util/unbundle_jsonlint.js +24 -0
- package/src/style-spec/validate/latest.js +11 -0
- package/src/style-spec/validate/validate.js +75 -0
- package/src/style-spec/validate/validate_array.js +52 -0
- package/src/style-spec/validate/validate_boolean.js +15 -0
- package/src/style-spec/validate/validate_color.js +20 -0
- package/src/style-spec/validate/validate_constants.js +13 -0
- package/src/style-spec/validate/validate_enum.js +21 -0
- package/src/style-spec/validate/validate_expression.js +43 -0
- package/src/style-spec/validate/validate_filter.js +117 -0
- package/src/style-spec/validate/validate_formatted.js +11 -0
- package/src/style-spec/validate/validate_function.js +207 -0
- package/src/style-spec/validate/validate_glyphs_url.js +21 -0
- package/src/style-spec/validate/validate_image.js +11 -0
- package/src/style-spec/validate/validate_layer.js +134 -0
- package/src/style-spec/validate/validate_layout_property.js +6 -0
- package/src/style-spec/validate/validate_light.js +47 -0
- package/src/style-spec/validate/validate_number.js +29 -0
- package/src/style-spec/validate/validate_object.js +61 -0
- package/src/style-spec/validate/validate_paint_property.js +6 -0
- package/src/style-spec/validate/validate_property.js +64 -0
- package/src/style-spec/validate/validate_source.js +111 -0
- package/src/style-spec/validate/validate_string.js +15 -0
- package/src/style-spec/validate_mapbox_api_supported.js +171 -0
- package/src/style-spec/validate_style.js +39 -0
- package/src/style-spec/validate_style.min.js +78 -0
- package/src/style-spec/visit.js +77 -0
- package/src/symbol/anchor.js +26 -0
- package/src/symbol/check_max_angle.js +81 -0
- package/src/symbol/clip_line.js +71 -0
- package/src/symbol/collision_feature.js +109 -0
- package/src/symbol/collision_index.js +373 -0
- package/src/symbol/cross_tile_symbol_index.js +301 -0
- package/src/symbol/get_anchors.js +167 -0
- package/src/symbol/grid_index.js +335 -0
- package/src/symbol/mergelines.js +82 -0
- package/src/symbol/one_em.js +4 -0
- package/src/symbol/opacity_state.js +27 -0
- package/src/symbol/path_interpolator.js +61 -0
- package/src/symbol/placement.js +1124 -0
- package/src/symbol/projection.js +451 -0
- package/src/symbol/quads.js +334 -0
- package/src/symbol/shaping.js +816 -0
- package/src/symbol/symbol_layout.js +796 -0
- package/src/symbol/symbol_size.js +113 -0
- package/src/symbol/transform_text.js +29 -0
- package/src/types/callback.js +17 -0
- package/src/types/cancelable.js +3 -0
- package/src/types/tilejson.js +17 -0
- package/src/types/transferable.js +3 -0
- package/src/types/window.js +172 -0
- package/src/ui/anchor.js +32 -0
- package/src/ui/camera.js +1277 -0
- package/src/ui/control/attribution_control.js +212 -0
- package/src/ui/control/fullscreen_control.js +147 -0
- package/src/ui/control/geolocate_control.js +707 -0
- package/src/ui/control/logo_control.js +92 -0
- package/src/ui/control/navigation_control.js +257 -0
- package/src/ui/control/scale_control.js +142 -0
- package/src/ui/default_locale.js +22 -0
- package/src/ui/events.js +1301 -0
- package/src/ui/handler/box_zoom.js +170 -0
- package/src/ui/handler/click_zoom.js +52 -0
- package/src/ui/handler/handler_util.js +12 -0
- package/src/ui/handler/keyboard.js +208 -0
- package/src/ui/handler/map_event.js +156 -0
- package/src/ui/handler/mouse.js +171 -0
- package/src/ui/handler/scroll_zoom.js +350 -0
- package/src/ui/handler/shim/dblclick_zoom.js +62 -0
- package/src/ui/handler/shim/drag_pan.js +88 -0
- package/src/ui/handler/shim/drag_rotate.js +67 -0
- package/src/ui/handler/shim/touch_zoom_rotate.js +108 -0
- package/src/ui/handler/tap_drag_zoom.js +103 -0
- package/src/ui/handler/tap_recognizer.js +133 -0
- package/src/ui/handler/tap_zoom.js +93 -0
- package/src/ui/handler/touch_pan.js +101 -0
- package/src/ui/handler/touch_zoom_rotate.js +305 -0
- package/src/ui/handler_inertia.js +158 -0
- package/src/ui/handler_manager.js +531 -0
- package/src/ui/hash.js +148 -0
- package/src/ui/map.js +2874 -0
- package/src/ui/marker.js +672 -0
- package/src/ui/popup.js +640 -0
- package/src/util/actor.js +212 -0
- package/src/util/ajax.js +388 -0
- package/src/util/browser/web_worker.js +10 -0
- package/src/util/browser/window.js +6 -0
- package/src/util/browser.js +70 -0
- package/src/util/classify_rings.js +52 -0
- package/src/util/color_ramp.js +61 -0
- package/src/util/config.js +30 -0
- package/src/util/debug.js +28 -0
- package/src/util/dictionary_coder.js +30 -0
- package/src/util/dispatcher.js +70 -0
- package/src/util/dom.js +142 -0
- package/src/util/evented.js +174 -0
- package/src/util/find_pole_of_inaccessibility.js +129 -0
- package/src/util/global_worker_pool.js +35 -0
- package/src/util/image.js +142 -0
- package/src/util/intersection_tests.js +208 -0
- package/src/util/is_char_in_unicode_block.js +311 -0
- package/src/util/mapbox.js +491 -0
- package/src/util/offscreen_canvas_supported.js +14 -0
- package/src/util/performance.js +112 -0
- package/src/util/primitives.js +145 -0
- package/src/util/resolve_tokens.js +16 -0
- package/src/util/script_detection.js +328 -0
- package/src/util/sku_token.js +42 -0
- package/src/util/smart_wrap.js +55 -0
- package/src/util/struct_array.js +243 -0
- package/src/util/struct_array.js.ejs +112 -0
- package/src/util/struct_array_layout.js.ejs +98 -0
- package/src/util/task_queue.js +68 -0
- package/src/util/throttle.js +27 -0
- package/src/util/throttled_invoker.js +46 -0
- package/src/util/tile_request_cache.js +172 -0
- package/src/util/util.js +524 -0
- package/src/util/vectortile_to_geojson.js +50 -0
- package/src/util/verticalize_punctuation.js +114 -0
- package/src/util/web_worker.js +91 -0
- package/src/util/web_worker_transfer.js +266 -0
- package/src/util/webp_supported.js +69 -0
- package/src/util/window.js +102 -0
- package/src/util/worker_pool.js +57 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import replace from 'rollup-plugin-replace';
|
|
3
|
+
import buble from 'rollup-plugin-buble';
|
|
4
|
+
import resolve from 'rollup-plugin-node-resolve';
|
|
5
|
+
import commonjs from 'rollup-plugin-commonjs';
|
|
6
|
+
import unassert from 'rollup-plugin-unassert';
|
|
7
|
+
import json from 'rollup-plugin-json';
|
|
8
|
+
import {flow} from '../../build/rollup_plugins';
|
|
9
|
+
|
|
10
|
+
// Build es modules?
|
|
11
|
+
const esm = 'esm' in process.env;
|
|
12
|
+
|
|
13
|
+
const transforms = {
|
|
14
|
+
dangerousForOf: true,
|
|
15
|
+
modules: esm ? false : undefined
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const ROOT_DIR = __dirname;
|
|
19
|
+
|
|
20
|
+
const config = [{
|
|
21
|
+
input: `${__dirname}/style-spec.js`,
|
|
22
|
+
output: {
|
|
23
|
+
name: 'mapboxGlStyleSpecification',
|
|
24
|
+
file: `${__dirname}/dist/${esm ? 'index.es.js' : 'index.js'}`,
|
|
25
|
+
format: esm ? 'esm' : 'umd',
|
|
26
|
+
sourcemap: true
|
|
27
|
+
},
|
|
28
|
+
plugins: [
|
|
29
|
+
{
|
|
30
|
+
name: 'dep-checker',
|
|
31
|
+
resolveId(source, importer) {
|
|
32
|
+
// Some users reference modules within style-spec package directly, instead of the bundle
|
|
33
|
+
// This means that files within the style-spec package should NOT import files from the parent mapbox-gl-js tree.
|
|
34
|
+
// This check will cause the build to fail on CI allowing these issues to be caught.
|
|
35
|
+
if (importer && !importer.includes('node_modules')) {
|
|
36
|
+
const resolvedPath = path.join(importer, source);
|
|
37
|
+
const fromRoot = path.relative(ROOT_DIR, resolvedPath);
|
|
38
|
+
if (fromRoot.length > 2 && fromRoot.slice(0, 2) === '..') {
|
|
39
|
+
throw new Error(`Module ${importer} imports ${source} from outside the style-spec package root directory.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
// https://github.com/zaach/jison/issues/351
|
|
47
|
+
replace({
|
|
48
|
+
include: /\/jsonlint-lines-primitives\/lib\/jsonlint.js/,
|
|
49
|
+
delimiters: ['', ''],
|
|
50
|
+
values: {
|
|
51
|
+
'_token_stack:': ''
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
flow(),
|
|
55
|
+
json(),
|
|
56
|
+
buble({transforms, objectAssign: "Object.assign"}),
|
|
57
|
+
unassert(),
|
|
58
|
+
resolve({
|
|
59
|
+
browser: true,
|
|
60
|
+
preferBuiltins: false
|
|
61
|
+
}),
|
|
62
|
+
commonjs()
|
|
63
|
+
]
|
|
64
|
+
}];
|
|
65
|
+
export default config;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
type ExpressionType = 'data-driven' | 'cross-faded' | 'cross-faded-data-driven' | 'color-ramp' | 'data-constant' | 'constant';
|
|
4
|
+
type ExpressionParameters = Array<'zoom' | 'feature' | 'feature-state' | 'heatmap-density' | 'line-progress'>;
|
|
5
|
+
|
|
6
|
+
type ExpressionSpecification = {
|
|
7
|
+
interpolated: boolean,
|
|
8
|
+
parameters: ExpressionParameters
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type StylePropertySpecification = {
|
|
12
|
+
type: 'number',
|
|
13
|
+
'property-type': ExpressionType,
|
|
14
|
+
expression?: ExpressionSpecification,
|
|
15
|
+
transition: boolean,
|
|
16
|
+
default?: number
|
|
17
|
+
} | {
|
|
18
|
+
type: 'string',
|
|
19
|
+
'property-type': ExpressionType,
|
|
20
|
+
expression?: ExpressionSpecification,
|
|
21
|
+
transition: boolean,
|
|
22
|
+
default?: string,
|
|
23
|
+
tokens?: boolean
|
|
24
|
+
} | {
|
|
25
|
+
type: 'boolean',
|
|
26
|
+
'property-type': ExpressionType,
|
|
27
|
+
expression?: ExpressionSpecification,
|
|
28
|
+
transition: boolean,
|
|
29
|
+
default?: boolean
|
|
30
|
+
} | {
|
|
31
|
+
type: 'enum',
|
|
32
|
+
'property-type': ExpressionType,
|
|
33
|
+
expression?: ExpressionSpecification,
|
|
34
|
+
values: {[_: string]: {}},
|
|
35
|
+
transition: boolean,
|
|
36
|
+
default?: string
|
|
37
|
+
} | {
|
|
38
|
+
type: 'color',
|
|
39
|
+
'property-type': ExpressionType,
|
|
40
|
+
expression?: ExpressionSpecification,
|
|
41
|
+
transition: boolean,
|
|
42
|
+
default?: string,
|
|
43
|
+
overridable: boolean
|
|
44
|
+
} | {
|
|
45
|
+
type: 'array',
|
|
46
|
+
value: 'number',
|
|
47
|
+
'property-type': ExpressionType,
|
|
48
|
+
expression?: ExpressionSpecification,
|
|
49
|
+
length?: number,
|
|
50
|
+
transition: boolean,
|
|
51
|
+
default?: Array<number>
|
|
52
|
+
} | {
|
|
53
|
+
type: 'array',
|
|
54
|
+
value: 'string',
|
|
55
|
+
'property-type': ExpressionType,
|
|
56
|
+
expression?: ExpressionSpecification,
|
|
57
|
+
length?: number,
|
|
58
|
+
transition: boolean,
|
|
59
|
+
default?: Array<string>
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
import v8 from './reference/v8.json';
|
|
63
|
+
import latest from './reference/latest';
|
|
64
|
+
import format from './format';
|
|
65
|
+
import migrate from './migrate';
|
|
66
|
+
import composite from './composite';
|
|
67
|
+
import derefLayers from './deref';
|
|
68
|
+
import diff from './diff';
|
|
69
|
+
import ValidationError from './error/validation_error';
|
|
70
|
+
import ParsingError from './error/parsing_error';
|
|
71
|
+
import {StyleExpression, isExpression, createExpression, createPropertyExpression, normalizePropertyExpression, ZoomConstantExpression, ZoomDependentExpression, StylePropertyFunction} from './expression';
|
|
72
|
+
import featureFilter, {isExpressionFilter} from './feature_filter';
|
|
73
|
+
|
|
74
|
+
import convertFilter from './feature_filter/convert';
|
|
75
|
+
import Color from './util/color';
|
|
76
|
+
import {createFunction, isFunction} from './function';
|
|
77
|
+
import convertFunction from './function/convert';
|
|
78
|
+
import {eachSource, eachLayer, eachProperty} from './visit';
|
|
79
|
+
|
|
80
|
+
import validate from './validate_style';
|
|
81
|
+
import validateMapboxApiSupported from './validate_mapbox_api_supported';
|
|
82
|
+
|
|
83
|
+
const expression = {
|
|
84
|
+
StyleExpression,
|
|
85
|
+
isExpression,
|
|
86
|
+
isExpressionFilter,
|
|
87
|
+
createExpression,
|
|
88
|
+
createPropertyExpression,
|
|
89
|
+
normalizePropertyExpression,
|
|
90
|
+
ZoomConstantExpression,
|
|
91
|
+
ZoomDependentExpression,
|
|
92
|
+
StylePropertyFunction
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const styleFunction = {
|
|
96
|
+
convertFunction,
|
|
97
|
+
createFunction,
|
|
98
|
+
isFunction
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const visit = {eachSource, eachLayer, eachProperty};
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
v8,
|
|
105
|
+
latest,
|
|
106
|
+
format,
|
|
107
|
+
migrate,
|
|
108
|
+
composite,
|
|
109
|
+
derefLayers,
|
|
110
|
+
diff,
|
|
111
|
+
ValidationError,
|
|
112
|
+
ParsingError,
|
|
113
|
+
expression,
|
|
114
|
+
featureFilter,
|
|
115
|
+
convertFilter,
|
|
116
|
+
Color,
|
|
117
|
+
styleFunction as function,
|
|
118
|
+
validate,
|
|
119
|
+
validateMapboxApiSupported,
|
|
120
|
+
visit
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
validate.parsed = validate;
|
|
124
|
+
validate.latest = validate;
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
// Generated code; do not edit. Edit build/generate-flow-typed-style-spec.js instead.
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
export type ColorSpecification = string;
|
|
6
|
+
|
|
7
|
+
export type FormattedSpecification = string;
|
|
8
|
+
|
|
9
|
+
export type ResolvedImageSpecification = string;
|
|
10
|
+
|
|
11
|
+
export type PromoteIdSpecification = {[_: string]: string} | string;
|
|
12
|
+
|
|
13
|
+
export type FilterSpecification =
|
|
14
|
+
| ['has', string]
|
|
15
|
+
| ['!has', string]
|
|
16
|
+
| ['==', string, string | number | boolean]
|
|
17
|
+
| ['!=', string, string | number | boolean]
|
|
18
|
+
| ['>', string, string | number | boolean]
|
|
19
|
+
| ['>=', string, string | number | boolean]
|
|
20
|
+
| ['<', string, string | number | boolean]
|
|
21
|
+
| ['<=', string, string | number | boolean]
|
|
22
|
+
| Array<string | FilterSpecification>; // Can't type in, !in, all, any, none -- https://github.com/facebook/flow/issues/2443
|
|
23
|
+
|
|
24
|
+
export type TransitionSpecification = {
|
|
25
|
+
duration?: number,
|
|
26
|
+
delay?: number
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Note: doesn't capture interpolatable vs. non-interpolatable types.
|
|
30
|
+
|
|
31
|
+
export type CameraFunctionSpecification<T> =
|
|
32
|
+
| {| type: 'exponential', stops: Array<[number, T]> |}
|
|
33
|
+
| {| type: 'interval', stops: Array<[number, T]> |};
|
|
34
|
+
|
|
35
|
+
export type SourceFunctionSpecification<T> =
|
|
36
|
+
| {| type: 'exponential', stops: Array<[number, T]>, property: string, default?: T |}
|
|
37
|
+
| {| type: 'interval', stops: Array<[number, T]>, property: string, default?: T |}
|
|
38
|
+
| {| type: 'categorical', stops: Array<[string | number | boolean, T]>, property: string, default?: T |}
|
|
39
|
+
| {| type: 'identity', property: string, default?: T |};
|
|
40
|
+
|
|
41
|
+
export type CompositeFunctionSpecification<T> =
|
|
42
|
+
| {| type: 'exponential', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T |}
|
|
43
|
+
| {| type: 'interval', stops: Array<[{zoom: number, value: number}, T]>, property: string, default?: T |}
|
|
44
|
+
| {| type: 'categorical', stops: Array<[{zoom: number, value: string | number | boolean}, T]>, property: string, default?: T |};
|
|
45
|
+
|
|
46
|
+
export type ExpressionSpecification = Array<mixed>;
|
|
47
|
+
|
|
48
|
+
export type PropertyValueSpecification<T> =
|
|
49
|
+
| T
|
|
50
|
+
| CameraFunctionSpecification<T>
|
|
51
|
+
| ExpressionSpecification;
|
|
52
|
+
|
|
53
|
+
export type DataDrivenPropertyValueSpecification<T> =
|
|
54
|
+
| T
|
|
55
|
+
| CameraFunctionSpecification<T>
|
|
56
|
+
| SourceFunctionSpecification<T>
|
|
57
|
+
| CompositeFunctionSpecification<T>
|
|
58
|
+
| ExpressionSpecification;
|
|
59
|
+
|
|
60
|
+
export type StyleSpecification = {|
|
|
61
|
+
"version": 8,
|
|
62
|
+
"name"?: string,
|
|
63
|
+
"metadata"?: mixed,
|
|
64
|
+
"center"?: Array<number>,
|
|
65
|
+
"zoom"?: number,
|
|
66
|
+
"bearing"?: number,
|
|
67
|
+
"pitch"?: number,
|
|
68
|
+
"light"?: LightSpecification,
|
|
69
|
+
"sources": {[_: string]: SourceSpecification},
|
|
70
|
+
"sprite"?: string,
|
|
71
|
+
"glyphs"?: string,
|
|
72
|
+
"transition"?: TransitionSpecification,
|
|
73
|
+
"layers": Array<LayerSpecification>
|
|
74
|
+
|}
|
|
75
|
+
|
|
76
|
+
export type LightSpecification = {|
|
|
77
|
+
"anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
78
|
+
"position"?: PropertyValueSpecification<[number, number, number]>,
|
|
79
|
+
"color"?: PropertyValueSpecification<ColorSpecification>,
|
|
80
|
+
"intensity"?: PropertyValueSpecification<number>
|
|
81
|
+
|}
|
|
82
|
+
|
|
83
|
+
export type VectorSourceSpecification = {
|
|
84
|
+
"type": "vector",
|
|
85
|
+
"url"?: string,
|
|
86
|
+
"tiles"?: Array<string>,
|
|
87
|
+
"bounds"?: [number, number, number, number],
|
|
88
|
+
"scheme"?: "xyz" | "tms",
|
|
89
|
+
"minzoom"?: number,
|
|
90
|
+
"maxzoom"?: number,
|
|
91
|
+
"attribution"?: string,
|
|
92
|
+
"promoteId"?: PromoteIdSpecification,
|
|
93
|
+
"volatile"?: boolean
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type RasterSourceSpecification = {
|
|
97
|
+
"type": "raster",
|
|
98
|
+
"url"?: string,
|
|
99
|
+
"tiles"?: Array<string>,
|
|
100
|
+
"bounds"?: [number, number, number, number],
|
|
101
|
+
"minzoom"?: number,
|
|
102
|
+
"maxzoom"?: number,
|
|
103
|
+
"tileSize"?: number,
|
|
104
|
+
"scheme"?: "xyz" | "tms",
|
|
105
|
+
"attribution"?: string,
|
|
106
|
+
"volatile"?: boolean
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type RasterDEMSourceSpecification = {
|
|
110
|
+
"type": "raster-dem",
|
|
111
|
+
"url"?: string,
|
|
112
|
+
"tiles"?: Array<string>,
|
|
113
|
+
"bounds"?: [number, number, number, number],
|
|
114
|
+
"minzoom"?: number,
|
|
115
|
+
"maxzoom"?: number,
|
|
116
|
+
"tileSize"?: number,
|
|
117
|
+
"attribution"?: string,
|
|
118
|
+
"encoding"?: "terrarium" | "mapbox",
|
|
119
|
+
"volatile"?: boolean
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type GeoJSONSourceSpecification = {|
|
|
123
|
+
"type": "geojson",
|
|
124
|
+
"data"?: mixed,
|
|
125
|
+
"maxzoom"?: number,
|
|
126
|
+
"attribution"?: string,
|
|
127
|
+
"buffer"?: number,
|
|
128
|
+
"filter"?: mixed,
|
|
129
|
+
"tolerance"?: number,
|
|
130
|
+
"cluster"?: boolean,
|
|
131
|
+
"clusterRadius"?: number,
|
|
132
|
+
"clusterMaxZoom"?: number,
|
|
133
|
+
"clusterMinPoints"?: number,
|
|
134
|
+
"clusterProperties"?: mixed,
|
|
135
|
+
"lineMetrics"?: boolean,
|
|
136
|
+
"generateId"?: boolean,
|
|
137
|
+
"promoteId"?: PromoteIdSpecification
|
|
138
|
+
|}
|
|
139
|
+
|
|
140
|
+
export type VideoSourceSpecification = {|
|
|
141
|
+
"type": "video",
|
|
142
|
+
"urls": Array<string>,
|
|
143
|
+
"coordinates": [[number, number], [number, number], [number, number], [number, number]]
|
|
144
|
+
|}
|
|
145
|
+
|
|
146
|
+
export type ImageSourceSpecification = {|
|
|
147
|
+
"type": "image",
|
|
148
|
+
"url": string,
|
|
149
|
+
"coordinates": [[number, number], [number, number], [number, number], [number, number]]
|
|
150
|
+
|}
|
|
151
|
+
|
|
152
|
+
export type SourceSpecification =
|
|
153
|
+
| VectorSourceSpecification
|
|
154
|
+
| RasterSourceSpecification
|
|
155
|
+
| RasterDEMSourceSpecification
|
|
156
|
+
| GeoJSONSourceSpecification
|
|
157
|
+
| VideoSourceSpecification
|
|
158
|
+
| ImageSourceSpecification
|
|
159
|
+
|
|
160
|
+
export type FillLayerSpecification = {|
|
|
161
|
+
"id": string,
|
|
162
|
+
"type": "fill",
|
|
163
|
+
"metadata"?: mixed,
|
|
164
|
+
"source": string,
|
|
165
|
+
"source-layer"?: string,
|
|
166
|
+
"minzoom"?: number,
|
|
167
|
+
"maxzoom"?: number,
|
|
168
|
+
"filter"?: FilterSpecification,
|
|
169
|
+
"layout"?: {|
|
|
170
|
+
"fill-sort-key"?: DataDrivenPropertyValueSpecification<number>,
|
|
171
|
+
"visibility"?: "visible" | "none"
|
|
172
|
+
|},
|
|
173
|
+
"paint"?: {|
|
|
174
|
+
"fill-antialias"?: PropertyValueSpecification<boolean>,
|
|
175
|
+
"fill-opacity"?: DataDrivenPropertyValueSpecification<number>,
|
|
176
|
+
"fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
177
|
+
"fill-outline-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
178
|
+
"fill-translate"?: PropertyValueSpecification<[number, number]>,
|
|
179
|
+
"fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
180
|
+
"fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>
|
|
181
|
+
|}
|
|
182
|
+
|}
|
|
183
|
+
|
|
184
|
+
export type LineLayerSpecification = {|
|
|
185
|
+
"id": string,
|
|
186
|
+
"type": "line",
|
|
187
|
+
"metadata"?: mixed,
|
|
188
|
+
"source": string,
|
|
189
|
+
"source-layer"?: string,
|
|
190
|
+
"minzoom"?: number,
|
|
191
|
+
"maxzoom"?: number,
|
|
192
|
+
"filter"?: FilterSpecification,
|
|
193
|
+
"layout"?: {|
|
|
194
|
+
"line-cap"?: PropertyValueSpecification<"butt" | "round" | "square">,
|
|
195
|
+
"line-join"?: DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter">,
|
|
196
|
+
"line-miter-limit"?: PropertyValueSpecification<number>,
|
|
197
|
+
"line-round-limit"?: PropertyValueSpecification<number>,
|
|
198
|
+
"line-sort-key"?: DataDrivenPropertyValueSpecification<number>,
|
|
199
|
+
"visibility"?: "visible" | "none"
|
|
200
|
+
|},
|
|
201
|
+
"paint"?: {|
|
|
202
|
+
"line-opacity"?: DataDrivenPropertyValueSpecification<number>,
|
|
203
|
+
"line-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
204
|
+
"line-translate"?: PropertyValueSpecification<[number, number]>,
|
|
205
|
+
"line-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
206
|
+
"line-width"?: DataDrivenPropertyValueSpecification<number>,
|
|
207
|
+
"line-gap-width"?: DataDrivenPropertyValueSpecification<number>,
|
|
208
|
+
"line-offset"?: DataDrivenPropertyValueSpecification<number>,
|
|
209
|
+
"line-blur"?: DataDrivenPropertyValueSpecification<number>,
|
|
210
|
+
"line-dasharray"?: PropertyValueSpecification<Array<number>>,
|
|
211
|
+
"line-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
|
|
212
|
+
"line-gradient"?: ExpressionSpecification
|
|
213
|
+
|}
|
|
214
|
+
|}
|
|
215
|
+
|
|
216
|
+
export type SymbolLayerSpecification = {|
|
|
217
|
+
"id": string,
|
|
218
|
+
"type": "symbol",
|
|
219
|
+
"metadata"?: mixed,
|
|
220
|
+
"source": string,
|
|
221
|
+
"source-layer"?: string,
|
|
222
|
+
"minzoom"?: number,
|
|
223
|
+
"maxzoom"?: number,
|
|
224
|
+
"filter"?: FilterSpecification,
|
|
225
|
+
"layout"?: {|
|
|
226
|
+
"symbol-placement"?: PropertyValueSpecification<"point" | "line" | "line-center">,
|
|
227
|
+
"symbol-spacing"?: PropertyValueSpecification<number>,
|
|
228
|
+
"symbol-avoid-edges"?: PropertyValueSpecification<boolean>,
|
|
229
|
+
"symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>,
|
|
230
|
+
"symbol-z-order"?: PropertyValueSpecification<"auto" | "viewport-y" | "source">,
|
|
231
|
+
"icon-allow-overlap"?: PropertyValueSpecification<boolean>,
|
|
232
|
+
"icon-ignore-placement"?: PropertyValueSpecification<boolean>,
|
|
233
|
+
"icon-optional"?: PropertyValueSpecification<boolean>,
|
|
234
|
+
"icon-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">,
|
|
235
|
+
"icon-size"?: DataDrivenPropertyValueSpecification<number>,
|
|
236
|
+
"icon-text-fit"?: PropertyValueSpecification<"none" | "width" | "height" | "both">,
|
|
237
|
+
"icon-text-fit-padding"?: PropertyValueSpecification<[number, number, number, number]>,
|
|
238
|
+
"icon-image"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
|
|
239
|
+
"icon-rotate"?: DataDrivenPropertyValueSpecification<number>,
|
|
240
|
+
"icon-padding"?: PropertyValueSpecification<number>,
|
|
241
|
+
"icon-keep-upright"?: PropertyValueSpecification<boolean>,
|
|
242
|
+
"icon-offset"?: DataDrivenPropertyValueSpecification<[number, number]>,
|
|
243
|
+
"icon-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">,
|
|
244
|
+
"icon-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">,
|
|
245
|
+
"text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">,
|
|
246
|
+
"text-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">,
|
|
247
|
+
"text-field"?: DataDrivenPropertyValueSpecification<FormattedSpecification>,
|
|
248
|
+
"text-font"?: DataDrivenPropertyValueSpecification<Array<string>>,
|
|
249
|
+
"text-size"?: DataDrivenPropertyValueSpecification<number>,
|
|
250
|
+
"text-max-width"?: DataDrivenPropertyValueSpecification<number>,
|
|
251
|
+
"text-line-height"?: PropertyValueSpecification<number>,
|
|
252
|
+
"text-letter-spacing"?: DataDrivenPropertyValueSpecification<number>,
|
|
253
|
+
"text-justify"?: DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">,
|
|
254
|
+
"text-radial-offset"?: DataDrivenPropertyValueSpecification<number>,
|
|
255
|
+
"text-variable-anchor"?: PropertyValueSpecification<Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">>,
|
|
256
|
+
"text-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">,
|
|
257
|
+
"text-max-angle"?: PropertyValueSpecification<number>,
|
|
258
|
+
"text-writing-mode"?: PropertyValueSpecification<Array<"horizontal" | "vertical">>,
|
|
259
|
+
"text-rotate"?: DataDrivenPropertyValueSpecification<number>,
|
|
260
|
+
"text-padding"?: PropertyValueSpecification<number>,
|
|
261
|
+
"text-keep-upright"?: PropertyValueSpecification<boolean>,
|
|
262
|
+
"text-transform"?: DataDrivenPropertyValueSpecification<"none" | "uppercase" | "lowercase">,
|
|
263
|
+
"text-offset"?: DataDrivenPropertyValueSpecification<[number, number]>,
|
|
264
|
+
"text-allow-overlap"?: PropertyValueSpecification<boolean>,
|
|
265
|
+
"text-ignore-placement"?: PropertyValueSpecification<boolean>,
|
|
266
|
+
"text-optional"?: PropertyValueSpecification<boolean>,
|
|
267
|
+
"visibility"?: "visible" | "none"
|
|
268
|
+
|},
|
|
269
|
+
"paint"?: {|
|
|
270
|
+
"icon-opacity"?: DataDrivenPropertyValueSpecification<number>,
|
|
271
|
+
"icon-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
272
|
+
"icon-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
273
|
+
"icon-halo-width"?: DataDrivenPropertyValueSpecification<number>,
|
|
274
|
+
"icon-halo-blur"?: DataDrivenPropertyValueSpecification<number>,
|
|
275
|
+
"icon-translate"?: PropertyValueSpecification<[number, number]>,
|
|
276
|
+
"icon-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
277
|
+
"text-opacity"?: DataDrivenPropertyValueSpecification<number>,
|
|
278
|
+
"text-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
279
|
+
"text-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
280
|
+
"text-halo-width"?: DataDrivenPropertyValueSpecification<number>,
|
|
281
|
+
"text-halo-blur"?: DataDrivenPropertyValueSpecification<number>,
|
|
282
|
+
"text-translate"?: PropertyValueSpecification<[number, number]>,
|
|
283
|
+
"text-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">
|
|
284
|
+
|}
|
|
285
|
+
|}
|
|
286
|
+
|
|
287
|
+
export type CircleLayerSpecification = {|
|
|
288
|
+
"id": string,
|
|
289
|
+
"type": "circle",
|
|
290
|
+
"metadata"?: mixed,
|
|
291
|
+
"source": string,
|
|
292
|
+
"source-layer"?: string,
|
|
293
|
+
"minzoom"?: number,
|
|
294
|
+
"maxzoom"?: number,
|
|
295
|
+
"filter"?: FilterSpecification,
|
|
296
|
+
"layout"?: {|
|
|
297
|
+
"circle-sort-key"?: DataDrivenPropertyValueSpecification<number>,
|
|
298
|
+
"visibility"?: "visible" | "none"
|
|
299
|
+
|},
|
|
300
|
+
"paint"?: {|
|
|
301
|
+
"circle-radius"?: DataDrivenPropertyValueSpecification<number>,
|
|
302
|
+
"circle-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
303
|
+
"circle-blur"?: DataDrivenPropertyValueSpecification<number>,
|
|
304
|
+
"circle-opacity"?: DataDrivenPropertyValueSpecification<number>,
|
|
305
|
+
"circle-translate"?: PropertyValueSpecification<[number, number]>,
|
|
306
|
+
"circle-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
307
|
+
"circle-pitch-scale"?: PropertyValueSpecification<"map" | "viewport">,
|
|
308
|
+
"circle-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport">,
|
|
309
|
+
"circle-stroke-width"?: DataDrivenPropertyValueSpecification<number>,
|
|
310
|
+
"circle-stroke-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
311
|
+
"circle-stroke-opacity"?: DataDrivenPropertyValueSpecification<number>
|
|
312
|
+
|}
|
|
313
|
+
|}
|
|
314
|
+
|
|
315
|
+
export type HeatmapLayerSpecification = {|
|
|
316
|
+
"id": string,
|
|
317
|
+
"type": "heatmap",
|
|
318
|
+
"metadata"?: mixed,
|
|
319
|
+
"source": string,
|
|
320
|
+
"source-layer"?: string,
|
|
321
|
+
"minzoom"?: number,
|
|
322
|
+
"maxzoom"?: number,
|
|
323
|
+
"filter"?: FilterSpecification,
|
|
324
|
+
"layout"?: {|
|
|
325
|
+
"visibility"?: "visible" | "none"
|
|
326
|
+
|},
|
|
327
|
+
"paint"?: {|
|
|
328
|
+
"heatmap-radius"?: DataDrivenPropertyValueSpecification<number>,
|
|
329
|
+
"heatmap-weight"?: DataDrivenPropertyValueSpecification<number>,
|
|
330
|
+
"heatmap-intensity"?: PropertyValueSpecification<number>,
|
|
331
|
+
"heatmap-color"?: ExpressionSpecification,
|
|
332
|
+
"heatmap-opacity"?: PropertyValueSpecification<number>
|
|
333
|
+
|}
|
|
334
|
+
|}
|
|
335
|
+
|
|
336
|
+
export type FillExtrusionLayerSpecification = {|
|
|
337
|
+
"id": string,
|
|
338
|
+
"type": "fill-extrusion",
|
|
339
|
+
"metadata"?: mixed,
|
|
340
|
+
"source": string,
|
|
341
|
+
"source-layer"?: string,
|
|
342
|
+
"minzoom"?: number,
|
|
343
|
+
"maxzoom"?: number,
|
|
344
|
+
"filter"?: FilterSpecification,
|
|
345
|
+
"layout"?: {|
|
|
346
|
+
"visibility"?: "visible" | "none"
|
|
347
|
+
|},
|
|
348
|
+
"paint"?: {|
|
|
349
|
+
"fill-extrusion-opacity"?: PropertyValueSpecification<number>,
|
|
350
|
+
"fill-extrusion-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>,
|
|
351
|
+
"fill-extrusion-translate"?: PropertyValueSpecification<[number, number]>,
|
|
352
|
+
"fill-extrusion-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
353
|
+
"fill-extrusion-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>,
|
|
354
|
+
"fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>,
|
|
355
|
+
"fill-extrusion-base"?: DataDrivenPropertyValueSpecification<number>,
|
|
356
|
+
"fill-extrusion-vertical-gradient"?: PropertyValueSpecification<boolean>
|
|
357
|
+
|}
|
|
358
|
+
|}
|
|
359
|
+
|
|
360
|
+
export type RasterLayerSpecification = {|
|
|
361
|
+
"id": string,
|
|
362
|
+
"type": "raster",
|
|
363
|
+
"metadata"?: mixed,
|
|
364
|
+
"source": string,
|
|
365
|
+
"source-layer"?: string,
|
|
366
|
+
"minzoom"?: number,
|
|
367
|
+
"maxzoom"?: number,
|
|
368
|
+
"filter"?: FilterSpecification,
|
|
369
|
+
"layout"?: {|
|
|
370
|
+
"visibility"?: "visible" | "none"
|
|
371
|
+
|},
|
|
372
|
+
"paint"?: {|
|
|
373
|
+
"raster-opacity"?: PropertyValueSpecification<number>,
|
|
374
|
+
"raster-hue-rotate"?: PropertyValueSpecification<number>,
|
|
375
|
+
"raster-brightness-min"?: PropertyValueSpecification<number>,
|
|
376
|
+
"raster-brightness-max"?: PropertyValueSpecification<number>,
|
|
377
|
+
"raster-saturation"?: PropertyValueSpecification<number>,
|
|
378
|
+
"raster-contrast"?: PropertyValueSpecification<number>,
|
|
379
|
+
"raster-resampling"?: PropertyValueSpecification<"linear" | "nearest">,
|
|
380
|
+
"raster-fade-duration"?: PropertyValueSpecification<number>
|
|
381
|
+
|}
|
|
382
|
+
|}
|
|
383
|
+
|
|
384
|
+
export type HillshadeLayerSpecification = {|
|
|
385
|
+
"id": string,
|
|
386
|
+
"type": "hillshade",
|
|
387
|
+
"metadata"?: mixed,
|
|
388
|
+
"source": string,
|
|
389
|
+
"source-layer"?: string,
|
|
390
|
+
"minzoom"?: number,
|
|
391
|
+
"maxzoom"?: number,
|
|
392
|
+
"filter"?: FilterSpecification,
|
|
393
|
+
"layout"?: {|
|
|
394
|
+
"visibility"?: "visible" | "none"
|
|
395
|
+
|},
|
|
396
|
+
"paint"?: {|
|
|
397
|
+
"hillshade-illumination-direction"?: PropertyValueSpecification<number>,
|
|
398
|
+
"hillshade-illumination-anchor"?: PropertyValueSpecification<"map" | "viewport">,
|
|
399
|
+
"hillshade-exaggeration"?: PropertyValueSpecification<number>,
|
|
400
|
+
"hillshade-shadow-color"?: PropertyValueSpecification<ColorSpecification>,
|
|
401
|
+
"hillshade-highlight-color"?: PropertyValueSpecification<ColorSpecification>,
|
|
402
|
+
"hillshade-accent-color"?: PropertyValueSpecification<ColorSpecification>
|
|
403
|
+
|}
|
|
404
|
+
|}
|
|
405
|
+
|
|
406
|
+
export type BackgroundLayerSpecification = {|
|
|
407
|
+
"id": string,
|
|
408
|
+
"type": "background",
|
|
409
|
+
"metadata"?: mixed,
|
|
410
|
+
"minzoom"?: number,
|
|
411
|
+
"maxzoom"?: number,
|
|
412
|
+
"layout"?: {|
|
|
413
|
+
"visibility"?: "visible" | "none"
|
|
414
|
+
|},
|
|
415
|
+
"paint"?: {|
|
|
416
|
+
"background-color"?: PropertyValueSpecification<ColorSpecification>,
|
|
417
|
+
"background-pattern"?: PropertyValueSpecification<ResolvedImageSpecification>,
|
|
418
|
+
"background-opacity"?: PropertyValueSpecification<number>
|
|
419
|
+
|}
|
|
420
|
+
|}
|
|
421
|
+
|
|
422
|
+
export type LayerSpecification =
|
|
423
|
+
| FillLayerSpecification
|
|
424
|
+
| LineLayerSpecification
|
|
425
|
+
| SymbolLayerSpecification
|
|
426
|
+
| CircleLayerSpecification
|
|
427
|
+
| HeatmapLayerSpecification
|
|
428
|
+
| FillExtrusionLayerSpecification
|
|
429
|
+
| RasterLayerSpecification
|
|
430
|
+
| HillshadeLayerSpecification
|
|
431
|
+
| BackgroundLayerSpecification;
|
|
432
|
+
|