maplibre-gl 2.0.4 → 2.1.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/build/{banner.js → banner.ts} +1 -1
- package/build/generate-query-test-fixtures.ts +123 -0
- package/build/generate-shaders.ts +35 -0
- package/build/generate-struct-arrays.ts +7 -7
- package/build/generate-style-code.ts +8 -8
- package/build/generate-style-spec.ts +5 -4
- package/build/generate-typings.ts +16 -0
- package/build/readme.md +8 -18
- package/build/release-notes.js +9 -13
- package/build/{rollup_plugin_minify_style_spec.js → rollup_plugin_minify_style_spec.ts} +4 -3
- package/build/{rollup_plugins.js → rollup_plugins.ts} +12 -26
- package/dist/maplibre-gl-dev.js +54885 -0
- package/dist/maplibre-gl.css +1 -1
- package/dist/maplibre-gl.d.ts +1583 -1023
- package/dist/maplibre-gl.js +3 -3
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +99 -141
- package/src/css/maplibre-gl.css +36 -36
- package/src/data/{array_types.ts → array_types.g.ts} +0 -0
- package/src/data/bucket/circle_bucket.ts +1 -1
- package/src/data/bucket/fill_bucket.test.ts +1 -1
- package/src/data/bucket/fill_bucket.ts +4 -4
- package/src/data/bucket/fill_extrusion_bucket.ts +1 -1
- package/src/data/bucket/line_bucket.test.ts +1 -1
- package/src/data/bucket/line_bucket.ts +6 -6
- package/src/data/bucket/symbol_bucket.test.ts +16 -16
- package/src/data/bucket/symbol_bucket.ts +56 -56
- package/src/data/bucket.ts +43 -43
- package/src/data/dem_data.ts +12 -12
- package/src/data/evaluation_feature.ts +10 -10
- package/src/data/feature_index.ts +37 -37
- package/src/data/feature_position_map.ts +5 -5
- package/src/data/index_array_type.ts +1 -1
- package/src/data/load_geometry.test.ts +1 -1
- package/src/data/program_configuration.ts +47 -47
- package/src/data/segment.ts +14 -14
- package/src/geo/edge_insets.ts +2 -2
- package/src/geo/lng_lat.ts +4 -4
- package/src/geo/lng_lat_bounds.ts +35 -35
- package/src/geo/mercator_coordinate.ts +5 -5
- package/src/geo/transform.test.ts +1 -1
- package/src/geo/transform.ts +14 -14
- package/src/gl/context.ts +3 -3
- package/src/gl/types.ts +19 -19
- package/src/gl/value.ts +6 -6
- package/src/gl/vertex_buffer.test.ts +1 -1
- package/src/index.ts +24 -9
- package/src/render/draw_circle.ts +8 -8
- package/src/render/draw_collision_debug.ts +5 -5
- package/src/render/draw_debug.ts +1 -1
- package/src/render/draw_line.ts +4 -4
- package/src/render/draw_symbol.ts +21 -21
- package/src/render/glyph_atlas.ts +12 -12
- package/src/render/glyph_manager.test.ts +10 -21
- package/src/render/glyph_manager.ts +34 -33
- package/src/render/image_manager.ts +4 -4
- package/src/render/painter.ts +16 -14
- package/src/render/program/background_program.ts +29 -29
- package/src/render/program/circle_program.ts +11 -11
- package/src/render/program/clipping_mask_program.ts +1 -1
- package/src/render/program/collision_program.ts +9 -9
- package/src/render/program/debug_program.ts +4 -4
- package/src/render/program/fill_extrusion_program.ts +31 -31
- package/src/render/program/fill_program.ts +29 -29
- package/src/render/program/heatmap_program.ts +12 -12
- package/src/render/program/hillshade_program.ts +12 -12
- package/src/render/program/line_program.ts +41 -41
- package/src/render/program/pattern.ts +28 -28
- package/src/render/program/raster_program.ts +21 -21
- package/src/render/program/symbol_program.ts +97 -97
- package/src/render/program.ts +25 -25
- package/src/render/texture.ts +9 -9
- package/src/render/uniform_binding.ts +1 -1
- package/src/render/vertex_array_object.ts +13 -13
- package/src/shaders/_prelude.fragment.glsl.g.ts +2 -0
- package/src/shaders/_prelude.vertex.glsl.g.ts +2 -0
- package/src/shaders/background.fragment.glsl.g.ts +2 -0
- package/src/shaders/background.vertex.glsl.g.ts +2 -0
- package/src/shaders/background_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/background_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/circle.fragment.glsl.g.ts +2 -0
- package/src/shaders/circle.vertex.glsl.g.ts +2 -0
- package/src/shaders/clipping_mask.fragment.glsl.g.ts +2 -0
- package/src/shaders/clipping_mask.vertex.glsl.g.ts +2 -0
- package/src/shaders/collision_box.fragment.glsl.g.ts +2 -0
- package/src/shaders/collision_box.vertex.glsl.g.ts +2 -0
- package/src/shaders/collision_circle.fragment.glsl.g.ts +2 -0
- package/src/shaders/collision_circle.vertex.glsl.g.ts +2 -0
- package/src/shaders/debug.fragment.glsl.g.ts +2 -0
- package/src/shaders/debug.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_outline.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_outline.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_outline_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_outline_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/heatmap.fragment.glsl.g.ts +2 -0
- package/src/shaders/heatmap.vertex.glsl.g.ts +2 -0
- package/src/shaders/heatmap_texture.fragment.glsl.g.ts +2 -0
- package/src/shaders/heatmap_texture.vertex.glsl.g.ts +2 -0
- package/src/shaders/hillshade.fragment.glsl.g.ts +2 -0
- package/src/shaders/hillshade.vertex.glsl.g.ts +2 -0
- package/src/shaders/hillshade_prepare.fragment.glsl.g.ts +2 -0
- package/src/shaders/hillshade_prepare.vertex.glsl.g.ts +2 -0
- package/src/shaders/line.fragment.glsl.g.ts +2 -0
- package/src/shaders/line.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_gradient.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_gradient.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_sdf.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_sdf.vertex.glsl.g.ts +2 -0
- package/src/shaders/raster.fragment.glsl.g.ts +2 -0
- package/src/shaders/raster.vertex.glsl.g.ts +2 -0
- package/src/shaders/shaders.ts +52 -55
- package/src/shaders/symbol_icon.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_icon.vertex.glsl.g.ts +2 -0
- package/src/shaders/symbol_sdf.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_sdf.vertex.glsl.g.ts +2 -0
- package/src/shaders/symbol_text_and_icon.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_text_and_icon.vertex.glsl.g.ts +2 -0
- package/src/source/canvas_source.test.ts +11 -12
- package/src/source/canvas_source.ts +4 -4
- package/src/source/geojson_source.test.ts +2 -1
- package/src/source/geojson_source.ts +1 -1
- package/src/source/geojson_worker_source.ts +23 -23
- package/src/source/geojson_wrapper.ts +8 -8
- package/src/source/image_source.test.ts +153 -0
- package/src/source/image_source.ts +6 -6
- package/src/source/pixels_to_tile_units.ts +6 -6
- package/src/source/query_features.ts +20 -20
- package/src/source/raster_dem_tile_source.test.ts +4 -3
- package/src/source/raster_dem_tile_source.ts +1 -1
- package/src/source/raster_tile_source.test.ts +4 -3
- package/src/source/raster_tile_source.ts +1 -1
- package/src/source/rtl_text_plugin.ts +10 -10
- package/src/source/source.ts +29 -29
- package/src/source/source_cache.test.ts +33 -1
- package/src/source/source_cache.ts +7 -5
- package/src/source/source_state.ts +1 -1
- package/src/source/tile.test.ts +3 -3
- package/src/source/tile.ts +15 -15
- package/src/source/tile_cache.test.ts +6 -4
- package/src/source/tile_cache.ts +6 -6
- package/src/source/tile_id.test.ts +10 -13
- package/src/source/tile_id.ts +2 -2
- package/src/source/vector_tile_source.test.ts +17 -5
- package/src/source/vector_tile_source.ts +4 -5
- package/src/source/vector_tile_worker_source.test.ts +4 -4
- package/src/source/vector_tile_worker_source.ts +5 -5
- package/src/source/worker.test.ts +1 -1
- package/src/source/worker.ts +22 -22
- package/src/source/worker_source.ts +56 -56
- package/src/source/worker_tile.ts +4 -4
- package/src/style/evaluation_parameters.ts +3 -3
- package/src/style/format_section_override.test.ts +1 -1
- package/src/style/light.ts +10 -10
- package/src/style/load_glyph_range.test.ts +3 -5
- package/src/style/load_glyph_range.ts +6 -6
- package/src/style/load_sprite.ts +5 -4
- package/src/style/pauseable_placement.ts +1 -1
- package/src/style/properties.ts +70 -70
- package/src/style/query_utils.ts +7 -7
- package/src/style/style.test.ts +26 -15
- package/src/style/style.ts +30 -30
- package/src/style/style_glyph.ts +8 -8
- package/src/style/style_image.ts +58 -58
- package/src/style/style_layer/background_style_layer.ts +2 -2
- package/src/style/style_layer/{background_style_layer_properties.ts → background_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/circle_style_layer.ts +10 -10
- package/src/style/style_layer/{circle_style_layer_properties.ts → circle_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/custom_style_layer.ts +19 -19
- package/src/style/style_layer/fill_extrusion_style_layer.ts +11 -11
- package/src/style/style_layer/{fill_extrusion_style_layer_properties.ts → fill_extrusion_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/fill_style_layer.ts +9 -9
- package/src/style/style_layer/{fill_style_layer_properties.ts → fill_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/heatmap_style_layer.ts +2 -2
- package/src/style/style_layer/{heatmap_style_layer_properties.ts → heatmap_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/hillshade_style_layer.ts +2 -2
- package/src/style/style_layer/{hillshade_style_layer_properties.ts → hillshade_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/line_style_layer.ts +9 -9
- package/src/style/style_layer/{line_style_layer_properties.ts → line_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/raster_style_layer.ts +2 -2
- package/src/style/style_layer/{raster_style_layer_properties.ts → raster_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/symbol_style_layer.ts +26 -7
- package/src/style/style_layer/{symbol_style_layer_properties.ts → symbol_style_layer_properties.g.ts} +6 -0
- package/src/style/style_layer.ts +10 -10
- package/src/style/style_layer_index.ts +3 -3
- package/src/style/validate_style.ts +15 -15
- package/src/style-spec/CHANGELOG.md +6 -0
- package/src/style-spec/error/validation_error.ts +1 -1
- package/src/style-spec/expression/compound_expression.ts +3 -3
- package/src/style-spec/expression/definitions/format.ts +11 -11
- package/src/style-spec/expression/definitions/interpolate.ts +5 -5
- package/src/style-spec/expression/definitions/match.ts +2 -2
- package/src/style-spec/expression/definitions/number_format.ts +11 -11
- package/src/style-spec/expression/expression.ts +8 -8
- package/src/style-spec/expression/index.ts +97 -97
- package/src/style-spec/expression/parsing_context.ts +11 -11
- package/src/style-spec/expression/types/collator.ts +9 -9
- package/src/style-spec/expression/types/resolved_image.ts +2 -2
- package/src/style-spec/expression/types.ts +14 -14
- package/src/style-spec/expression/values.ts +1 -1
- package/src/style-spec/feature_filter/index.ts +66 -66
- package/src/style-spec/function/convert.ts +3 -3
- package/src/style-spec/package.json +1 -1
- package/src/style-spec/reference/v8.json +68 -2
- package/src/style-spec/style-spec.ts +44 -44
- package/src/style-spec/types.ts +2 -0
- package/src/style-spec/util/color_spaces.ts +8 -8
- package/src/style-spec/util/result.ts +4 -4
- package/src/style-spec/validate/validate_filter.ts +58 -58
- package/src/style-spec/validate/validate_source.ts +63 -63
- package/src/style-spec/visit.ts +11 -11
- package/src/symbol/collision_feature.test.ts +1 -1
- package/src/symbol/collision_feature.ts +10 -10
- package/src/symbol/collision_index.ts +43 -43
- package/src/symbol/cross_tile_symbol_index.ts +17 -17
- package/src/symbol/get_anchors.ts +16 -16
- package/src/symbol/grid_index.test.ts +42 -19
- package/src/symbol/grid_index.ts +69 -40
- package/src/symbol/placement.ts +124 -95
- package/src/symbol/projection.ts +30 -30
- package/src/symbol/quads.ts +30 -30
- package/src/symbol/shaping.ts +160 -160
- package/src/symbol/symbol_layout.ts +119 -119
- package/src/symbol/symbol_size.ts +29 -29
- package/src/symbol/symbol_style_layer.test.ts +49 -2
- package/src/types/cancelable.ts +1 -1
- package/src/types/tilejson.ts +13 -13
- package/src/ui/anchor.ts +1 -1
- package/src/ui/camera.test.ts +9 -9
- package/src/ui/camera.ts +26 -18
- package/src/ui/control/attribution_control.test.ts +51 -16
- package/src/ui/control/attribution_control.ts +35 -16
- package/src/ui/control/control.ts +40 -40
- package/src/ui/control/fullscreen_control.ts +1 -1
- package/src/ui/control/geolocate_control.test.ts +1 -1
- package/src/ui/control/geolocate_control.ts +102 -102
- package/src/ui/control/logo_control.test.ts +5 -4
- package/src/ui/control/navigation_control.ts +3 -3
- package/src/ui/control/scale_control.test.ts +2 -2
- package/src/ui/control/scale_control.ts +5 -5
- package/src/ui/events.ts +289 -200
- package/src/ui/handler/box_zoom.test.ts +1 -1
- package/src/ui/handler/box_zoom.ts +1 -1
- package/src/ui/handler/dblclick_zoom.test.ts +1 -1
- package/src/ui/handler/drag_pan.test.ts +1 -1
- package/src/ui/handler/drag_rotate.test.ts +1 -1
- package/src/ui/handler/keyboard.test.ts +1 -1
- package/src/ui/handler/keyboard.ts +51 -51
- package/src/ui/handler/map_event.test.ts +1 -1
- package/src/ui/handler/map_event.ts +1 -1
- package/src/ui/handler/mouse.ts +1 -1
- package/src/ui/handler/mouse_rotate.test.ts +1 -1
- package/src/ui/handler/scroll_zoom.test.ts +3 -2
- package/src/ui/handler/scroll_zoom.ts +9 -9
- package/src/ui/handler/shim/drag_pan.ts +4 -4
- package/src/ui/handler/shim/drag_rotate.ts +1 -1
- package/src/ui/handler/shim/touch_zoom_rotate.ts +1 -1
- package/src/ui/handler/tap_recognizer.ts +4 -4
- package/src/ui/handler/touch_pan.ts +2 -2
- package/src/ui/handler/touch_zoom_rotate.test.ts +1 -1
- package/src/ui/handler/touch_zoom_rotate.ts +1 -1
- package/src/ui/handler_inertia.ts +6 -6
- package/src/ui/handler_manager.ts +44 -44
- package/src/ui/map/isMoving.test.ts +1 -1
- package/src/ui/map/isRotating.test.ts +1 -1
- package/src/ui/map/isZooming.test.ts +1 -1
- package/src/ui/map.test.ts +87 -14
- package/src/ui/map.ts +138 -108
- package/src/ui/map_events.test.ts +1 -1
- package/src/ui/marker.test.ts +12 -12
- package/src/ui/marker.ts +37 -37
- package/src/ui/popup.test.ts +7 -7
- package/src/ui/popup.ts +9 -9
- package/src/util/actor.test.ts +41 -10
- package/src/util/actor.ts +8 -8
- package/src/util/ajax.test.ts +214 -0
- package/src/util/ajax.ts +51 -30
- package/src/util/browser.ts +1 -1
- package/src/util/classify_rings.test.ts +1 -1
- package/src/util/color_ramp.ts +5 -5
- package/src/util/config.ts +2 -2
- package/src/util/dispatcher.ts +1 -1
- package/src/util/dom.ts +2 -2
- package/src/util/evented.ts +1 -1
- package/src/util/find_pole_of_inaccessibility.ts +3 -3
- package/src/util/image.ts +5 -5
- package/src/util/performance.ts +7 -7
- package/src/util/request_manager.ts +4 -4
- package/src/util/resolve_tokens.ts +4 -4
- package/src/util/struct_array.test.ts +1 -1
- package/src/util/struct_array.ts +15 -15
- package/src/util/task_queue.ts +3 -3
- package/src/util/test/util.ts +14 -0
- package/src/util/tile_request_cache.ts +3 -3
- package/src/util/transferable_grid_index.ts +4 -4
- package/src/util/util.ts +8 -8
- package/src/util/web_worker.ts +4 -68
- package/src/util/web_worker_transfer.test.ts +3 -0
- package/src/util/web_worker_transfer.ts +21 -17
- package/src/util/worker_pool.ts +1 -1
- package/build/.eslintrc +0 -21
- package/build/glsl_to_js.js +0 -12
- package/build/post-ts-build.js +0 -43
- package/build/release-notes.md.ejs +0 -8
- package/build/test/build-tape.js +0 -17
- package/build/web_worker_replacement.js +0 -5
- package/dist/package.json +0 -1
- package/src/style-spec/validate_spec.test.ts +0 -29
- package/src/symbol/shaping.test.ts +0 -392
- package/src/types/glsl.d.ts +0 -4
package/src/style/style_image.ts
CHANGED
|
@@ -3,18 +3,18 @@ import {RGBAImage} from '../util/image';
|
|
|
3
3
|
import type Map from '../ui/map';
|
|
4
4
|
|
|
5
5
|
export type StyleImageData = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
data: RGBAImage;
|
|
7
|
+
version: number;
|
|
8
|
+
hasRenderCallback?: boolean;
|
|
9
|
+
userImage?: StyleImageInterface;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export type StyleImageMetadata = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
pixelRatio: number;
|
|
14
|
+
sdf: boolean;
|
|
15
|
+
stretchX?: Array<[number, number]>;
|
|
16
|
+
stretchY?: Array<[number, number]>;
|
|
17
|
+
content?: [number, number, number, number];
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export type StyleImage = StyleImageData & StyleImageMetadata;
|
|
@@ -73,55 +73,55 @@ export type StyleImage = StyleImageData & StyleImageMetadata;
|
|
|
73
73
|
*/
|
|
74
74
|
|
|
75
75
|
export interface StyleImageInterface {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
76
|
+
/**
|
|
77
|
+
* @property {number} width
|
|
78
|
+
*/
|
|
79
|
+
width: number;
|
|
80
|
+
/**
|
|
81
|
+
* @property {number} height
|
|
82
|
+
*/
|
|
83
|
+
height: number;
|
|
84
|
+
/**
|
|
85
|
+
* @property {Uint8Array | Uint8ClampedArray} data
|
|
86
|
+
*/
|
|
87
|
+
data: Uint8Array | Uint8ClampedArray;
|
|
88
|
+
/**
|
|
89
|
+
* This method is called once before every frame where the icon will be used.
|
|
90
|
+
* The method can optionally update the image's `data` member with a new image.
|
|
91
|
+
*
|
|
92
|
+
* If the method updates the image it must return `true` to commit the change.
|
|
93
|
+
* If the method returns `false` or nothing the image is assumed to not have changed.
|
|
94
|
+
*
|
|
95
|
+
* If updates are infrequent it maybe easier to use {@link Map#updateImage} to update
|
|
96
|
+
* the image instead of implementing this method.
|
|
97
|
+
*
|
|
98
|
+
* @function
|
|
99
|
+
* @memberof StyleImageInterface
|
|
100
|
+
* @instance
|
|
101
|
+
* @name render
|
|
102
|
+
* @return {boolean} `true` if this method updated the image. `false` if the image was not changed.
|
|
103
|
+
*/
|
|
104
|
+
render?: () => boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Optional method called when the layer has been added to the Map with {@link Map#addImage}.
|
|
107
|
+
*
|
|
108
|
+
* @function
|
|
109
|
+
* @memberof StyleImageInterface
|
|
110
|
+
* @instance
|
|
111
|
+
* @name onAdd
|
|
112
|
+
* @param {Map} map The Map this custom layer was just added to.
|
|
113
|
+
*/
|
|
114
|
+
onAdd?: (map: Map, id: string) => void;
|
|
115
|
+
/**
|
|
116
|
+
* Optional method called when the icon is removed from the map with {@link Map#removeImage}.
|
|
117
|
+
* This gives the image a chance to clean up resources and event listeners.
|
|
118
|
+
*
|
|
119
|
+
* @function
|
|
120
|
+
* @memberof StyleImageInterface
|
|
121
|
+
* @instance
|
|
122
|
+
* @name onRemove
|
|
123
|
+
*/
|
|
124
|
+
onRemove?: () => void;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
export function renderStyleImage(image: StyleImage) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import StyleLayer from '../style_layer';
|
|
2
2
|
|
|
3
|
-
import properties, {BackgroundPaintPropsPossiblyEvaluated} from './background_style_layer_properties';
|
|
3
|
+
import properties, {BackgroundPaintPropsPossiblyEvaluated} from './background_style_layer_properties.g';
|
|
4
4
|
import {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';
|
|
5
5
|
|
|
6
|
-
import type {BackgroundPaintProps} from './background_style_layer_properties';
|
|
6
|
+
import type {BackgroundPaintProps} from './background_style_layer_properties.g';
|
|
7
7
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
8
8
|
|
|
9
9
|
class BackgroundStyleLayer extends StyleLayer {
|
|
File without changes
|
|
@@ -3,14 +3,14 @@ import StyleLayer from '../style_layer';
|
|
|
3
3
|
import CircleBucket from '../../data/bucket/circle_bucket';
|
|
4
4
|
import {polygonIntersectsBufferedPoint} from '../../util/intersection_tests';
|
|
5
5
|
import {getMaximumPaintValue, translateDistance, translate} from '../query_utils';
|
|
6
|
-
import properties, {CircleLayoutPropsPossiblyEvaluated, CirclePaintPropsPossiblyEvaluated} from './circle_style_layer_properties';
|
|
6
|
+
import properties, {CircleLayoutPropsPossiblyEvaluated, CirclePaintPropsPossiblyEvaluated} from './circle_style_layer_properties.g';
|
|
7
7
|
import {Transitionable, Transitioning, Layout, PossiblyEvaluated} from '../properties';
|
|
8
8
|
import {mat4, vec4} from 'gl-matrix';
|
|
9
9
|
import Point from '@mapbox/point-geometry';
|
|
10
10
|
import type {FeatureState} from '../../style-spec/expression';
|
|
11
11
|
import type Transform from '../../geo/transform';
|
|
12
12
|
import type {Bucket, BucketParameters} from '../../data/bucket';
|
|
13
|
-
import type {CircleLayoutProps, CirclePaintProps} from './circle_style_layer_properties';
|
|
13
|
+
import type {CircleLayoutProps, CirclePaintProps} from './circle_style_layer_properties.g';
|
|
14
14
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
15
15
|
import type {VectorTileFeature} from '@mapbox/vector-tile';
|
|
16
16
|
|
|
@@ -38,14 +38,14 @@ class CircleStyleLayer extends StyleLayer {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
queryIntersectsFeature(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
queryGeometry: Array<Point>,
|
|
42
|
+
feature: VectorTileFeature,
|
|
43
|
+
featureState: FeatureState,
|
|
44
|
+
geometry: Array<Array<Point>>,
|
|
45
|
+
zoom: number,
|
|
46
|
+
transform: Transform,
|
|
47
|
+
pixelsToTileUnits: number,
|
|
48
|
+
pixelPosMatrix: mat4
|
|
49
49
|
): boolean {
|
|
50
50
|
const translatedPolygon = translate(queryGeometry,
|
|
51
51
|
this.paint.get('circle-translate'),
|
|
File without changes
|
|
@@ -75,15 +75,15 @@ export interface CustomLayerInterface {
|
|
|
75
75
|
/**
|
|
76
76
|
* @property {string} id A unique layer id.
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
id: string;
|
|
79
79
|
/**
|
|
80
80
|
* @property {string} type The layer's type. Must be `"custom"`.
|
|
81
81
|
*/
|
|
82
|
-
|
|
82
|
+
type: 'custom';
|
|
83
83
|
/**
|
|
84
84
|
* @property {string} renderingMode Either `"2d"` or `"3d"`. Defaults to `"2d"`.
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
renderingMode: '2d' | '3d';
|
|
87
87
|
/**
|
|
88
88
|
* Called during a render frame allowing the layer to draw into the GL context.
|
|
89
89
|
*
|
|
@@ -112,7 +112,7 @@ export interface CustomLayerInterface {
|
|
|
112
112
|
* lengths in mercator units would be rendered as a cube. {@link MercatorCoordinate}.fromLngLat
|
|
113
113
|
* can be used to project a `LngLat` to a mercator coordinate.
|
|
114
114
|
*/
|
|
115
|
-
|
|
115
|
+
render: CustomRenderMethod;
|
|
116
116
|
/**
|
|
117
117
|
* Optional method called during a render frame to allow a layer to prepare resources or render into a texture.
|
|
118
118
|
*
|
|
@@ -130,7 +130,7 @@ export interface CustomLayerInterface {
|
|
|
130
130
|
* lengths in mercator units would be rendered as a cube. {@link MercatorCoordinate}.fromLngLat
|
|
131
131
|
* can be used to project a `LngLat` to a mercator coordinate.
|
|
132
132
|
*/
|
|
133
|
-
|
|
133
|
+
prerender: CustomRenderMethod;
|
|
134
134
|
/**
|
|
135
135
|
* Optional method called when the layer has been added to the Map with {@link Map#addLayer}. This
|
|
136
136
|
* gives the layer a chance to initialize gl resources and register event listeners.
|
|
@@ -142,19 +142,19 @@ export interface CustomLayerInterface {
|
|
|
142
142
|
* @param {Map} map The Map this custom layer was just added to.
|
|
143
143
|
* @param {WebGLRenderingContext} gl The gl context for the map.
|
|
144
144
|
*/
|
|
145
|
-
|
|
145
|
+
onAdd(map: Map, gl: WebGLRenderingContext): void;
|
|
146
146
|
/**
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
* Optional method called when the layer has been removed from the Map with {@link Map#removeLayer}. This
|
|
148
|
+
* gives the layer a chance to clean up gl resources and event listeners.
|
|
149
|
+
*
|
|
150
|
+
* @function
|
|
151
|
+
* @memberof CustomLayerInterface
|
|
152
|
+
* @instance
|
|
153
|
+
* @name onRemove
|
|
154
|
+
* @param {Map} map The Map this custom layer was just added to.
|
|
155
|
+
* @param {WebGLRenderingContext} gl The gl context for the map.
|
|
156
|
+
*/
|
|
157
|
+
onRemove(map: Map, gl: WebGLRenderingContext): void;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
export function validateCustomStyleLayer(layerObject: CustomLayerInterface) {
|
|
@@ -213,13 +213,13 @@ class CustomStyleLayer extends StyleLayer {
|
|
|
213
213
|
if (this.implementation.onAdd) {
|
|
214
214
|
this.implementation.onAdd(map, map.painter.context.gl);
|
|
215
215
|
}
|
|
216
|
-
}
|
|
216
|
+
};
|
|
217
217
|
|
|
218
218
|
onRemove = (map: Map) => {
|
|
219
219
|
if (this.implementation.onRemove) {
|
|
220
220
|
this.implementation.onRemove(map, map.painter.context.gl);
|
|
221
221
|
}
|
|
222
|
-
}
|
|
222
|
+
};
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
export default CustomStyleLayer;
|
|
@@ -3,19 +3,19 @@ import StyleLayer from '../style_layer';
|
|
|
3
3
|
import FillExtrusionBucket from '../../data/bucket/fill_extrusion_bucket';
|
|
4
4
|
import {polygonIntersectsPolygon, polygonIntersectsMultiPolygon} from '../../util/intersection_tests';
|
|
5
5
|
import {translateDistance, translate} from '../query_utils';
|
|
6
|
-
import properties, {FillExtrusionPaintPropsPossiblyEvaluated} from './fill_extrusion_style_layer_properties';
|
|
6
|
+
import properties, {FillExtrusionPaintPropsPossiblyEvaluated} from './fill_extrusion_style_layer_properties.g';
|
|
7
7
|
import {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';
|
|
8
8
|
import {mat4, vec4} from 'gl-matrix';
|
|
9
9
|
import Point from '@mapbox/point-geometry';
|
|
10
10
|
import type {FeatureState} from '../../style-spec/expression';
|
|
11
11
|
import type {BucketParameters} from '../../data/bucket';
|
|
12
|
-
import type {FillExtrusionPaintProps} from './fill_extrusion_style_layer_properties';
|
|
12
|
+
import type {FillExtrusionPaintProps} from './fill_extrusion_style_layer_properties.g';
|
|
13
13
|
import type Transform from '../../geo/transform';
|
|
14
14
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
15
15
|
import type {VectorTileFeature} from '@mapbox/vector-tile';
|
|
16
16
|
|
|
17
17
|
export class Point3D extends Point {
|
|
18
|
-
z: number
|
|
18
|
+
z: number;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
class FillExtrusionStyleLayer extends StyleLayer {
|
|
@@ -40,14 +40,14 @@ class FillExtrusionStyleLayer extends StyleLayer {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
queryIntersectsFeature(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
queryGeometry: Array<Point>,
|
|
44
|
+
feature: VectorTileFeature,
|
|
45
|
+
featureState: FeatureState,
|
|
46
|
+
geometry: Array<Array<Point>>,
|
|
47
|
+
zoom: number,
|
|
48
|
+
transform: Transform,
|
|
49
|
+
pixelsToTileUnits: number,
|
|
50
|
+
pixelPosMatrix: mat4
|
|
51
51
|
): boolean | number {
|
|
52
52
|
|
|
53
53
|
const translatedPolygon = translate(queryGeometry,
|
|
File without changes
|
|
@@ -3,13 +3,13 @@ import StyleLayer from '../style_layer';
|
|
|
3
3
|
import FillBucket from '../../data/bucket/fill_bucket';
|
|
4
4
|
import {polygonIntersectsMultiPolygon} from '../../util/intersection_tests';
|
|
5
5
|
import {translateDistance, translate} from '../query_utils';
|
|
6
|
-
import properties, {FillLayoutPropsPossiblyEvaluated, FillPaintPropsPossiblyEvaluated} from './fill_style_layer_properties';
|
|
6
|
+
import properties, {FillLayoutPropsPossiblyEvaluated, FillPaintPropsPossiblyEvaluated} from './fill_style_layer_properties.g';
|
|
7
7
|
import {Transitionable, Transitioning, Layout, PossiblyEvaluated} from '../properties';
|
|
8
8
|
|
|
9
9
|
import type {FeatureState} from '../../style-spec/expression';
|
|
10
10
|
import type {BucketParameters} from '../../data/bucket';
|
|
11
11
|
import type Point from '@mapbox/point-geometry';
|
|
12
|
-
import type {FillLayoutProps, FillPaintProps} from './fill_style_layer_properties';
|
|
12
|
+
import type {FillLayoutProps, FillPaintProps} from './fill_style_layer_properties.g';
|
|
13
13
|
import type EvaluationParameters from '../evaluation_parameters';
|
|
14
14
|
import type Transform from '../../geo/transform';
|
|
15
15
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
@@ -45,13 +45,13 @@ class FillStyleLayer extends StyleLayer {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
queryIntersectsFeature(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
queryGeometry: Array<Point>,
|
|
49
|
+
feature: VectorTileFeature,
|
|
50
|
+
featureState: FeatureState,
|
|
51
|
+
geometry: Array<Array<Point>>,
|
|
52
|
+
zoom: number,
|
|
53
|
+
transform: Transform,
|
|
54
|
+
pixelsToTileUnits: number
|
|
55
55
|
): boolean {
|
|
56
56
|
const translatedPolygon = translate(queryGeometry,
|
|
57
57
|
this.paint.get('fill-translate'),
|
package/src/style/style_layer/{fill_style_layer_properties.ts → fill_style_layer_properties.g.ts}
RENAMED
|
File without changes
|
|
@@ -2,13 +2,13 @@ import StyleLayer from '../style_layer';
|
|
|
2
2
|
|
|
3
3
|
import HeatmapBucket from '../../data/bucket/heatmap_bucket';
|
|
4
4
|
import {RGBAImage} from '../../util/image';
|
|
5
|
-
import properties, {HeatmapPaintPropsPossiblyEvaluated} from './heatmap_style_layer_properties';
|
|
5
|
+
import properties, {HeatmapPaintPropsPossiblyEvaluated} from './heatmap_style_layer_properties.g';
|
|
6
6
|
import {renderColorRamp} from '../../util/color_ramp';
|
|
7
7
|
import {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';
|
|
8
8
|
|
|
9
9
|
import type Texture from '../../render/texture';
|
|
10
10
|
import type Framebuffer from '../../gl/framebuffer';
|
|
11
|
-
import type {HeatmapPaintProps} from './heatmap_style_layer_properties';
|
|
11
|
+
import type {HeatmapPaintProps} from './heatmap_style_layer_properties.g';
|
|
12
12
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
13
13
|
|
|
14
14
|
class HeatmapStyleLayer extends StyleLayer {
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import StyleLayer from '../style_layer';
|
|
2
2
|
|
|
3
|
-
import properties, {HillshadePaintPropsPossiblyEvaluated} from './hillshade_style_layer_properties';
|
|
3
|
+
import properties, {HillshadePaintPropsPossiblyEvaluated} from './hillshade_style_layer_properties.g';
|
|
4
4
|
import {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';
|
|
5
5
|
|
|
6
|
-
import type {HillshadePaintProps} from './hillshade_style_layer_properties';
|
|
6
|
+
import type {HillshadePaintProps} from './hillshade_style_layer_properties.g';
|
|
7
7
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
8
8
|
|
|
9
9
|
class HillshadeStyleLayer extends StyleLayer {
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ import StyleLayer from '../style_layer';
|
|
|
4
4
|
import LineBucket from '../../data/bucket/line_bucket';
|
|
5
5
|
import {polygonIntersectsBufferedMultiLine} from '../../util/intersection_tests';
|
|
6
6
|
import {getMaximumPaintValue, translateDistance, translate} from '../query_utils';
|
|
7
|
-
import properties, {LineLayoutPropsPossiblyEvaluated, LinePaintPropsPossiblyEvaluated} from './line_style_layer_properties';
|
|
7
|
+
import properties, {LineLayoutPropsPossiblyEvaluated, LinePaintPropsPossiblyEvaluated} from './line_style_layer_properties.g';
|
|
8
8
|
import {extend} from '../../util/util';
|
|
9
9
|
import EvaluationParameters from '../evaluation_parameters';
|
|
10
10
|
import {Transitionable, Transitioning, Layout, PossiblyEvaluated, DataDrivenProperty} from '../properties';
|
|
@@ -12,7 +12,7 @@ import {Transitionable, Transitioning, Layout, PossiblyEvaluated, DataDrivenProp
|
|
|
12
12
|
import Step from '../../style-spec/expression/definitions/step';
|
|
13
13
|
import type {FeatureState, ZoomConstantExpression} from '../../style-spec/expression';
|
|
14
14
|
import type {Bucket, BucketParameters} from '../../data/bucket';
|
|
15
|
-
import type {LineLayoutProps, LinePaintProps} from './line_style_layer_properties';
|
|
15
|
+
import type {LineLayoutProps, LinePaintProps} from './line_style_layer_properties.g';
|
|
16
16
|
import type Transform from '../../geo/transform';
|
|
17
17
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
18
18
|
import type {VectorTileFeature} from '@mapbox/vector-tile';
|
|
@@ -88,13 +88,13 @@ class LineStyleLayer extends StyleLayer {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
queryIntersectsFeature(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
queryGeometry: Array<Point>,
|
|
92
|
+
feature: VectorTileFeature,
|
|
93
|
+
featureState: FeatureState,
|
|
94
|
+
geometry: Array<Array<Point>>,
|
|
95
|
+
zoom: number,
|
|
96
|
+
transform: Transform,
|
|
97
|
+
pixelsToTileUnits: number
|
|
98
98
|
): boolean {
|
|
99
99
|
const translatedPolygon = translate(queryGeometry,
|
|
100
100
|
this.paint.get('line-translate'),
|
package/src/style/style_layer/{line_style_layer_properties.ts → line_style_layer_properties.g.ts}
RENAMED
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import StyleLayer from '../style_layer';
|
|
2
2
|
|
|
3
|
-
import properties, {RasterPaintPropsPossiblyEvaluated} from './raster_style_layer_properties';
|
|
3
|
+
import properties, {RasterPaintPropsPossiblyEvaluated} from './raster_style_layer_properties.g';
|
|
4
4
|
import {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';
|
|
5
5
|
|
|
6
|
-
import type {RasterPaintProps} from './raster_style_layer_properties';
|
|
6
|
+
import type {RasterPaintProps} from './raster_style_layer_properties.g';
|
|
7
7
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
8
8
|
|
|
9
9
|
class RasterStyleLayer extends StyleLayer {
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ import StyleLayer from '../style_layer';
|
|
|
3
3
|
import assert from 'assert';
|
|
4
4
|
import SymbolBucket from '../../data/bucket/symbol_bucket';
|
|
5
5
|
import resolveTokens from '../../util/resolve_tokens';
|
|
6
|
-
import properties, {SymbolLayoutPropsPossiblyEvaluated, SymbolPaintPropsPossiblyEvaluated} from './symbol_style_layer_properties';
|
|
6
|
+
import properties, {SymbolLayoutPropsPossiblyEvaluated, SymbolPaintPropsPossiblyEvaluated} from './symbol_style_layer_properties.g';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
Transitionable,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from '../../style-spec/expression';
|
|
23
23
|
|
|
24
24
|
import type {BucketParameters} from '../../data/bucket';
|
|
25
|
-
import type {SymbolLayoutProps, SymbolPaintProps} from './symbol_style_layer_properties';
|
|
25
|
+
import type {SymbolLayoutProps, SymbolPaintProps} from './symbol_style_layer_properties.g';
|
|
26
26
|
import type EvaluationParameters from '../evaluation_parameters';
|
|
27
27
|
import type {LayerSpecification} from '../../style-spec/types';
|
|
28
28
|
import type {Feature, SourceExpression, CompositeExpression} from '../../style-spec/expression';
|
|
@@ -127,13 +127,13 @@ class SymbolStyleLayer extends StyleLayer {
|
|
|
127
127
|
expression = (new ZoomConstantExpression('source', styleExpression) as SourceExpression);
|
|
128
128
|
} else {
|
|
129
129
|
expression = (new ZoomDependentExpression('composite',
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
styleExpression,
|
|
131
|
+
overriden.value.zoomStops,
|
|
132
|
+
(overriden.value as any)._interpolationType) as CompositeExpression);
|
|
133
133
|
}
|
|
134
134
|
this.paint._values[overridable] = new PossiblyEvaluatedPropertyValue(overriden.property,
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
expression,
|
|
136
|
+
overriden.parameters);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -185,4 +185,23 @@ class SymbolStyleLayer extends StyleLayer {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
export type OverlapMode = 'never' | 'always' | 'cooperative';
|
|
189
|
+
|
|
190
|
+
export function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'icon-overlap', allowOverlapProp: 'icon-allow-overlap'): OverlapMode;
|
|
191
|
+
export function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'text-overlap', allowOverlapProp: 'text-allow-overlap'): OverlapMode;
|
|
192
|
+
export function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'icon-overlap' | 'text-overlap', allowOverlapProp: 'icon-allow-overlap' | 'text-allow-overlap'): OverlapMode {
|
|
193
|
+
let result: OverlapMode = 'never';
|
|
194
|
+
const overlap = layout.get(overlapProp);
|
|
195
|
+
|
|
196
|
+
if (overlap) {
|
|
197
|
+
// if -overlap is set, use it
|
|
198
|
+
result = overlap;
|
|
199
|
+
} else if (layout.get(allowOverlapProp)) {
|
|
200
|
+
// fall back to -allow-overlap, with false='never', true='always'
|
|
201
|
+
result = 'always';
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return result;
|
|
205
|
+
}
|
|
206
|
+
|
|
188
207
|
export default SymbolStyleLayer;
|
|
@@ -32,6 +32,7 @@ export type SymbolLayoutProps = {
|
|
|
32
32
|
"symbol-sort-key": DataDrivenProperty<number>,
|
|
33
33
|
"symbol-z-order": DataConstantProperty<"auto" | "viewport-y" | "source">,
|
|
34
34
|
"icon-allow-overlap": DataConstantProperty<boolean>,
|
|
35
|
+
"icon-overlap": DataConstantProperty<"never" | "always" | "cooperative">,
|
|
35
36
|
"icon-ignore-placement": DataConstantProperty<boolean>,
|
|
36
37
|
"icon-optional": DataConstantProperty<boolean>,
|
|
37
38
|
"icon-rotation-alignment": DataConstantProperty<"map" | "viewport" | "auto">,
|
|
@@ -65,6 +66,7 @@ export type SymbolLayoutProps = {
|
|
|
65
66
|
"text-transform": DataDrivenProperty<"none" | "uppercase" | "lowercase">,
|
|
66
67
|
"text-offset": DataDrivenProperty<[number, number]>,
|
|
67
68
|
"text-allow-overlap": DataConstantProperty<boolean>,
|
|
69
|
+
"text-overlap": DataConstantProperty<"never" | "always" | "cooperative">,
|
|
68
70
|
"text-ignore-placement": DataConstantProperty<boolean>,
|
|
69
71
|
"text-optional": DataConstantProperty<boolean>,
|
|
70
72
|
};
|
|
@@ -76,6 +78,7 @@ export type SymbolLayoutPropsPossiblyEvaluated = {
|
|
|
76
78
|
"symbol-sort-key": PossiblyEvaluatedPropertyValue<number>,
|
|
77
79
|
"symbol-z-order": "auto" | "viewport-y" | "source",
|
|
78
80
|
"icon-allow-overlap": boolean,
|
|
81
|
+
"icon-overlap": "never" | "always" | "cooperative",
|
|
79
82
|
"icon-ignore-placement": boolean,
|
|
80
83
|
"icon-optional": boolean,
|
|
81
84
|
"icon-rotation-alignment": "map" | "viewport" | "auto",
|
|
@@ -109,6 +112,7 @@ export type SymbolLayoutPropsPossiblyEvaluated = {
|
|
|
109
112
|
"text-transform": PossiblyEvaluatedPropertyValue<"none" | "uppercase" | "lowercase">,
|
|
110
113
|
"text-offset": PossiblyEvaluatedPropertyValue<[number, number]>,
|
|
111
114
|
"text-allow-overlap": boolean,
|
|
115
|
+
"text-overlap": "never" | "always" | "cooperative",
|
|
112
116
|
"text-ignore-placement": boolean,
|
|
113
117
|
"text-optional": boolean,
|
|
114
118
|
};
|
|
@@ -120,6 +124,7 @@ const layout: Properties<SymbolLayoutProps> = new Properties({
|
|
|
120
124
|
"symbol-sort-key": new DataDrivenProperty(styleSpec["layout_symbol"]["symbol-sort-key"] as any as StylePropertySpecification),
|
|
121
125
|
"symbol-z-order": new DataConstantProperty(styleSpec["layout_symbol"]["symbol-z-order"] as any as StylePropertySpecification),
|
|
122
126
|
"icon-allow-overlap": new DataConstantProperty(styleSpec["layout_symbol"]["icon-allow-overlap"] as any as StylePropertySpecification),
|
|
127
|
+
"icon-overlap": new DataConstantProperty(styleSpec["layout_symbol"]["icon-overlap"] as any as StylePropertySpecification),
|
|
123
128
|
"icon-ignore-placement": new DataConstantProperty(styleSpec["layout_symbol"]["icon-ignore-placement"] as any as StylePropertySpecification),
|
|
124
129
|
"icon-optional": new DataConstantProperty(styleSpec["layout_symbol"]["icon-optional"] as any as StylePropertySpecification),
|
|
125
130
|
"icon-rotation-alignment": new DataConstantProperty(styleSpec["layout_symbol"]["icon-rotation-alignment"] as any as StylePropertySpecification),
|
|
@@ -153,6 +158,7 @@ const layout: Properties<SymbolLayoutProps> = new Properties({
|
|
|
153
158
|
"text-transform": new DataDrivenProperty(styleSpec["layout_symbol"]["text-transform"] as any as StylePropertySpecification),
|
|
154
159
|
"text-offset": new DataDrivenProperty(styleSpec["layout_symbol"]["text-offset"] as any as StylePropertySpecification),
|
|
155
160
|
"text-allow-overlap": new DataConstantProperty(styleSpec["layout_symbol"]["text-allow-overlap"] as any as StylePropertySpecification),
|
|
161
|
+
"text-overlap": new DataConstantProperty(styleSpec["layout_symbol"]["text-overlap"] as any as StylePropertySpecification),
|
|
156
162
|
"text-ignore-placement": new DataConstantProperty(styleSpec["layout_symbol"]["text-ignore-placement"] as any as StylePropertySpecification),
|
|
157
163
|
"text-optional": new DataConstantProperty(styleSpec["layout_symbol"]["text-optional"] as any as StylePropertySpecification),
|
|
158
164
|
});
|
package/src/style/style_layer.ts
CHANGED
|
@@ -58,19 +58,19 @@ abstract class StyleLayer extends Evented {
|
|
|
58
58
|
|
|
59
59
|
queryRadius?(bucket: Bucket): number;
|
|
60
60
|
queryIntersectsFeature?(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
queryGeometry: Array<Point>,
|
|
62
|
+
feature: VectorTileFeature,
|
|
63
|
+
featureState: FeatureState,
|
|
64
|
+
geometry: Array<Array<Point>>,
|
|
65
|
+
zoom: number,
|
|
66
|
+
transform: Transform,
|
|
67
|
+
pixelsToTileUnits: number,
|
|
68
|
+
pixelPosMatrix: mat4
|
|
69
69
|
): boolean | number;
|
|
70
70
|
|
|
71
71
|
constructor(layer: LayerSpecification | CustomLayerInterface, properties: Readonly<{
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
layout?: Properties<any>;
|
|
73
|
+
paint?: Properties<any>;
|
|
74
74
|
}>) {
|
|
75
75
|
super();
|
|
76
76
|
|
|
@@ -12,9 +12,9 @@ export type Family<Layer extends TypedStyleLayer> = Array<Layer>;
|
|
|
12
12
|
|
|
13
13
|
class StyleLayerIndex {
|
|
14
14
|
familiesBySource: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
[source: string]: {
|
|
16
|
+
[sourceLayer: string]: Array<Family<any>>;
|
|
17
|
+
};
|
|
18
18
|
};
|
|
19
19
|
keyCache: {[source: string]: string};
|
|
20
20
|
|