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
|
@@ -3,7 +3,7 @@ import Color from '../style-spec/util/color';
|
|
|
3
3
|
import {supportsPropertyExpression} from '../style-spec/util/properties';
|
|
4
4
|
import {register} from '../util/web_worker_transfer';
|
|
5
5
|
import {PossiblyEvaluatedPropertyValue} from '../style/properties';
|
|
6
|
-
import {StructArrayLayout1f4, StructArrayLayout2f8, StructArrayLayout4f16, PatternLayoutArray} from './array_types';
|
|
6
|
+
import {StructArrayLayout1f4, StructArrayLayout2f8, StructArrayLayout4f16, PatternLayoutArray} from './array_types.g';
|
|
7
7
|
import {clamp} from '../util/util';
|
|
8
8
|
import patternAttributes from './bucket/pattern_attributes';
|
|
9
9
|
import EvaluationParameters from '../style/evaluation_parameters';
|
|
@@ -31,9 +31,9 @@ import type {FormattedSection} from '../style-spec/expression/types/formatted';
|
|
|
31
31
|
import type {VectorTileLayer} from '@mapbox/vector-tile';
|
|
32
32
|
|
|
33
33
|
export type BinderUniform = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
name: string;
|
|
35
|
+
property: string;
|
|
36
|
+
binding: Uniform<any>;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
function packColor(color: Color): [number, number] {
|
|
@@ -72,33 +72,33 @@ function packColor(color: Color): [number, number] {
|
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
74
|
interface AttributeBinder {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
populatePaintArray(
|
|
76
|
+
length: number,
|
|
77
|
+
feature: Feature,
|
|
78
|
+
imagePositions: {[_: string]: ImagePosition},
|
|
79
|
+
canonical?: CanonicalTileID,
|
|
80
|
+
formattedSection?: FormattedSection
|
|
81
|
+
): void;
|
|
82
|
+
updatePaintArray(
|
|
83
|
+
start: number,
|
|
84
|
+
length: number,
|
|
85
|
+
feature: Feature,
|
|
86
|
+
featureState: FeatureState,
|
|
87
|
+
imagePositions: {[_: string]: ImagePosition}
|
|
88
|
+
): void;
|
|
89
|
+
upload(a: Context): void;
|
|
90
|
+
destroy(): void;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
interface UniformBinder {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
uniformNames: Array<string>;
|
|
95
|
+
setUniform(
|
|
96
|
+
uniform: Uniform<any>,
|
|
97
|
+
globals: GlobalProperties,
|
|
98
|
+
currentValue: PossiblyEvaluatedPropertyValue<any>,
|
|
99
|
+
uniformName: string
|
|
100
|
+
): void;
|
|
101
|
+
getBinding(context: Context, location: WebGLUniformLocation, name: string): Partial<Uniform<any>>;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
class ConstantBinder implements UniformBinder {
|
|
@@ -113,9 +113,9 @@ class ConstantBinder implements UniformBinder {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
setUniform(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
uniform: Uniform<any>,
|
|
117
|
+
globals: GlobalProperties,
|
|
118
|
+
currentValue: PossiblyEvaluatedPropertyValue<unknown>
|
|
119
119
|
): void {
|
|
120
120
|
uniform.set(currentValue.constantOr(this.value));
|
|
121
121
|
}
|
|
@@ -129,7 +129,7 @@ class ConstantBinder implements UniformBinder {
|
|
|
129
129
|
|
|
130
130
|
class CrossFadedConstantBinder implements UniformBinder {
|
|
131
131
|
uniformNames: Array<string>;
|
|
132
|
-
patternFrom: Array<number
|
|
132
|
+
patternFrom: Array<number>;
|
|
133
133
|
patternTo: Array<number>;
|
|
134
134
|
pixelRatioFrom: number;
|
|
135
135
|
pixelRatioTo: number;
|
|
@@ -152,9 +152,9 @@ class CrossFadedConstantBinder implements UniformBinder {
|
|
|
152
152
|
setUniform(uniform: Uniform<any>, globals: GlobalProperties, currentValue: PossiblyEvaluatedPropertyValue<unknown>, uniformName: string) {
|
|
153
153
|
const pos =
|
|
154
154
|
uniformName === 'u_pattern_to' ? this.patternTo :
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
uniformName === 'u_pattern_from' ? this.patternFrom :
|
|
156
|
+
uniformName === 'u_pixel_ratio_to' ? this.pixelRatioTo :
|
|
157
|
+
uniformName === 'u_pixel_ratio_from' ? this.pixelRatioFrom : null;
|
|
158
158
|
if (pos) uniform.set(pos);
|
|
159
159
|
}
|
|
160
160
|
|
|
@@ -175,7 +175,7 @@ class SourceExpressionBinder implements AttributeBinder {
|
|
|
175
175
|
paintVertexBuffer: VertexBuffer;
|
|
176
176
|
|
|
177
177
|
constructor(expression: SourceExpression, names: Array<string>, type: string, PaintVertexArray: {
|
|
178
|
-
|
|
178
|
+
new (...args: any): StructArray;
|
|
179
179
|
}) {
|
|
180
180
|
this.expression = expression;
|
|
181
181
|
this.type = type;
|
|
@@ -245,7 +245,7 @@ class CompositeExpressionBinder implements AttributeBinder, UniformBinder {
|
|
|
245
245
|
paintVertexBuffer: VertexBuffer;
|
|
246
246
|
|
|
247
247
|
constructor(expression: CompositeExpression, names: Array<string>, type: string, useIntegerZoom: boolean, zoom: number, PaintVertexArray: {
|
|
248
|
-
|
|
248
|
+
new (...args: any): StructArray;
|
|
249
249
|
}) {
|
|
250
250
|
this.expression = expression;
|
|
251
251
|
this.uniformNames = names.map(name => `u_${name}_t`);
|
|
@@ -332,7 +332,7 @@ class CrossFadedCompositeBinder implements AttributeBinder {
|
|
|
332
332
|
paintVertexAttributes: Array<StructArrayMember>;
|
|
333
333
|
|
|
334
334
|
constructor(expression: CompositeExpression, type: string, useIntegerZoom: boolean, zoom: number, PaintVertexArray: {
|
|
335
|
-
|
|
335
|
+
new (...args: any): StructArray;
|
|
336
336
|
}, layerId: string) {
|
|
337
337
|
this.expression = expression;
|
|
338
338
|
this.type = type;
|
|
@@ -485,11 +485,11 @@ export default class ProgramConfiguration {
|
|
|
485
485
|
}
|
|
486
486
|
|
|
487
487
|
updatePaintArrays(
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
488
|
+
featureStates: FeatureStates,
|
|
489
|
+
featureMap: FeaturePositionMap,
|
|
490
|
+
vtLayer: VectorTileLayer,
|
|
491
|
+
layer: TypedStyleLayer,
|
|
492
|
+
imagePositions: {[_: string]: ImagePosition}
|
|
493
493
|
): boolean {
|
|
494
494
|
let dirty: boolean = false;
|
|
495
495
|
for (const id in featureStates) {
|
|
@@ -576,10 +576,10 @@ export default class ProgramConfiguration {
|
|
|
576
576
|
}
|
|
577
577
|
|
|
578
578
|
setUniforms(
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
579
|
+
context: Context,
|
|
580
|
+
binderUniforms: Array<BinderUniform>,
|
|
581
|
+
properties: any,
|
|
582
|
+
globals: GlobalProperties
|
|
583
583
|
) {
|
|
584
584
|
// Uniform state bindings are owned by the Program, but we set them
|
|
585
585
|
// from within the ProgramConfiguraton's binder members.
|
package/src/data/segment.ts
CHANGED
|
@@ -6,12 +6,12 @@ import type VertexArrayObject from '../render/vertex_array_object';
|
|
|
6
6
|
import type {StructArray} from '../util/struct_array';
|
|
7
7
|
|
|
8
8
|
export type Segment = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
sortKey?: number;
|
|
10
|
+
vertexOffset: number;
|
|
11
|
+
primitiveOffset: number;
|
|
12
|
+
vertexLength: number;
|
|
13
|
+
primitiveLength: number;
|
|
14
|
+
vaos: {[_: string]: VertexArrayObject};
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
class SegmentVector {
|
|
@@ -23,10 +23,10 @@ class SegmentVector {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
prepareSegment(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
numVertices: number,
|
|
27
|
+
layoutVertexArray: StructArray,
|
|
28
|
+
indexArray: StructArray,
|
|
29
|
+
sortKey?: number
|
|
30
30
|
): Segment {
|
|
31
31
|
let segment: Segment = this.segments[this.segments.length - 1];
|
|
32
32
|
if (numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) warnOnce(`Max vertices per segment is ${SegmentVector.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${numVertices}`);
|
|
@@ -56,10 +56,10 @@ class SegmentVector {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
static simpleSegment(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
vertexOffset: number,
|
|
60
|
+
primitiveOffset: number,
|
|
61
|
+
vertexLength: number,
|
|
62
|
+
primitiveLength: number
|
|
63
63
|
): SegmentVector {
|
|
64
64
|
return new SegmentVector([{
|
|
65
65
|
vertexOffset,
|
package/src/geo/edge_insets.ts
CHANGED
|
@@ -116,8 +116,8 @@ class EdgeInsets {
|
|
|
116
116
|
*/
|
|
117
117
|
export type PaddingOptions = {
|
|
118
118
|
/**
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
* @property {number} top Padding in pixels from the top of the map canvas.
|
|
120
|
+
*/
|
|
121
121
|
top: number;
|
|
122
122
|
/**
|
|
123
123
|
* @property {number} bottom Padding in pixels from the bottom of the map canvas.
|
package/src/geo/lng_lat.ts
CHANGED
|
@@ -161,11 +161,11 @@ class LngLat {
|
|
|
161
161
|
* var v3 = {lon: -122.420679, lat: 37.772537};
|
|
162
162
|
*/
|
|
163
163
|
export type LngLatLike = LngLat | {
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
lng: number;
|
|
165
|
+
lat: number;
|
|
166
166
|
} | {
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
lon: number;
|
|
168
|
+
lat: number;
|
|
169
169
|
} | [number, number];
|
|
170
170
|
|
|
171
171
|
export default LngLat;
|
|
@@ -126,51 +126,51 @@ class LngLatBounds {
|
|
|
126
126
|
getSouthWest(): LngLat { return this._sw; }
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
* Returns the northeast corner of the bounding box.
|
|
130
|
+
*
|
|
131
|
+
* @returns {LngLat} The northeast corner of the bounding box.
|
|
132
132
|
*/
|
|
133
133
|
getNorthEast(): LngLat { return this._ne; }
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
* Returns the northwest corner of the bounding box.
|
|
137
|
+
*
|
|
138
|
+
* @returns {LngLat} The northwest corner of the bounding box.
|
|
139
139
|
*/
|
|
140
140
|
getNorthWest(): LngLat { return new LngLat(this.getWest(), this.getNorth()); }
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
* Returns the southeast corner of the bounding box.
|
|
144
|
+
*
|
|
145
|
+
* @returns {LngLat} The southeast corner of the bounding box.
|
|
146
146
|
*/
|
|
147
147
|
getSouthEast(): LngLat { return new LngLat(this.getEast(), this.getSouth()); }
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
* Returns the west edge of the bounding box.
|
|
151
|
+
*
|
|
152
|
+
* @returns {number} The west edge of the bounding box.
|
|
153
153
|
*/
|
|
154
154
|
getWest(): number { return this._sw.lng; }
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
* Returns the south edge of the bounding box.
|
|
158
|
+
*
|
|
159
|
+
* @returns {number} The south edge of the bounding box.
|
|
160
160
|
*/
|
|
161
161
|
getSouth(): number { return this._sw.lat; }
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
* Returns the east edge of the bounding box.
|
|
165
|
+
*
|
|
166
|
+
* @returns {number} The east edge of the bounding box.
|
|
167
167
|
*/
|
|
168
168
|
getEast(): number { return this._ne.lng; }
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
* Returns the north edge of the bounding box.
|
|
172
|
+
*
|
|
173
|
+
* @returns {number} The north edge of the bounding box.
|
|
174
174
|
*/
|
|
175
175
|
getNorth(): number { return this._ne.lat; }
|
|
176
176
|
|
|
@@ -210,20 +210,20 @@ class LngLatBounds {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
213
|
+
* Check if the point is within the bounding box.
|
|
214
|
+
*
|
|
215
|
+
* @param {LngLatLike} lnglat geographic point to check against.
|
|
216
|
+
* @returns {boolean} True if the point is within the bounding box.
|
|
217
|
+
* @example
|
|
218
|
+
* var llb = new maplibregl.LngLatBounds(
|
|
219
|
+
* new maplibregl.LngLat(-73.9876, 40.7661),
|
|
220
|
+
* new maplibregl.LngLat(-73.9397, 40.8002)
|
|
221
|
+
* );
|
|
222
|
+
*
|
|
223
|
+
* var ll = new maplibregl.LngLat(-73.9567, 40.7789);
|
|
224
|
+
*
|
|
225
|
+
* console.log(llb.contains(ll)); // = true
|
|
226
|
+
*/
|
|
227
227
|
contains(lnglat: LngLatLike) {
|
|
228
228
|
const {lng, lat} = LngLat.convert(lnglat);
|
|
229
229
|
|
|
@@ -99,9 +99,9 @@ class MercatorCoordinate {
|
|
|
99
99
|
const lngLat = LngLat.convert(lngLatLike);
|
|
100
100
|
|
|
101
101
|
return new MercatorCoordinate(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
mercatorXfromLng(lngLat.lng),
|
|
103
|
+
mercatorYfromLat(lngLat.lat),
|
|
104
|
+
mercatorZfromAltitude(altitude, lngLat.lat));
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/**
|
|
@@ -114,8 +114,8 @@ class MercatorCoordinate {
|
|
|
114
114
|
*/
|
|
115
115
|
toLngLat() {
|
|
116
116
|
return new LngLat(
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
lngFromMercatorX(this.x),
|
|
118
|
+
latFromMercatorY(this.y));
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/**
|
|
@@ -2,7 +2,7 @@ import Point from '@mapbox/point-geometry';
|
|
|
2
2
|
import Transform from './transform';
|
|
3
3
|
import LngLat from './lng_lat';
|
|
4
4
|
import {OverscaledTileID, CanonicalTileID} from '../source/tile_id';
|
|
5
|
-
import {fixedLngLat, fixedCoord} from '../../test/
|
|
5
|
+
import {fixedLngLat, fixedCoord} from '../../test/unit/lib/fixed';
|
|
6
6
|
|
|
7
7
|
describe('transform', () => {
|
|
8
8
|
test('creates a transform', () => {
|
package/src/geo/transform.ts
CHANGED
|
@@ -262,8 +262,8 @@ class Transform {
|
|
|
262
262
|
* @returns {number} zoom level An integer zoom level at which all tiles will be visible.
|
|
263
263
|
*/
|
|
264
264
|
coveringZoomLevel(options: {
|
|
265
|
-
|
|
266
|
-
|
|
265
|
+
roundZoom?: boolean;
|
|
266
|
+
tileSize: number;
|
|
267
267
|
}) {
|
|
268
268
|
const z = (options.roundZoom ? Math.round : Math.floor)(
|
|
269
269
|
this.zoom + this.scaleZoom(this.tileSize / options.tileSize)
|
|
@@ -315,14 +315,14 @@ class Transform {
|
|
|
315
315
|
* @private
|
|
316
316
|
*/
|
|
317
317
|
coveringTiles(
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
318
|
+
options: {
|
|
319
|
+
tileSize: number;
|
|
320
|
+
minzoom?: number;
|
|
321
|
+
maxzoom?: number;
|
|
322
|
+
roundZoom?: boolean;
|
|
323
|
+
reparseOverscaled?: boolean;
|
|
324
|
+
renderWorldCopies?: boolean;
|
|
325
|
+
}
|
|
326
326
|
): Array<OverscaledTileID> {
|
|
327
327
|
let z = this.coveringZoomLevel(options);
|
|
328
328
|
const actualZ = z;
|
|
@@ -436,8 +436,8 @@ class Transform {
|
|
|
436
436
|
project(lnglat: LngLat) {
|
|
437
437
|
const lat = clamp(lnglat.lat, -this.maxValidLatitude, this.maxValidLatitude);
|
|
438
438
|
return new Point(
|
|
439
|
-
|
|
440
|
-
|
|
439
|
+
mercatorXfromLng(lnglat.lng) * this.worldSize,
|
|
440
|
+
mercatorYfromLat(lat) * this.worldSize);
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
unproject(point: Point): LngLat {
|
|
@@ -451,8 +451,8 @@ class Transform {
|
|
|
451
451
|
const b = this.pointCoordinate(this.centerPoint);
|
|
452
452
|
const loc = this.locationCoordinate(lnglat);
|
|
453
453
|
const newCenter = new MercatorCoordinate(
|
|
454
|
-
|
|
455
|
-
|
|
454
|
+
loc.x - (a.x - b.x),
|
|
455
|
+
loc.y - (a.y - b.y));
|
|
456
456
|
this.center = this.coordinateLocation(newCenter);
|
|
457
457
|
if (this._renderWorldCopies) {
|
|
458
458
|
this.center = this.center.wrap();
|
package/src/gl/context.ts
CHANGED
package/src/gl/types.ts
CHANGED
|
@@ -15,9 +15,9 @@ export type DepthRangeType = [number, number];
|
|
|
15
15
|
export type DepthFuncType = CompareFuncType;
|
|
16
16
|
|
|
17
17
|
export type StencilFuncType = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
func: CompareFuncType;
|
|
19
|
+
ref: number;
|
|
20
|
+
mask: number;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export type StencilOpConstant = WebGLRenderingContext['KEEP'] | WebGLRenderingContext['ZERO'] | WebGLRenderingContext['REPLACE'] | WebGLRenderingContext['INCR'] | WebGLRenderingContext['INCR_WRAP'] | WebGLRenderingContext['DECR'] | WebGLRenderingContext['DECR_WRAP'] | WebGLRenderingContext['INVERT'];
|
|
@@ -29,29 +29,29 @@ export type TextureUnitType = number;
|
|
|
29
29
|
export type ViewportType = [number, number, number, number];
|
|
30
30
|
|
|
31
31
|
export type StencilTestGL = {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
func: WebGLRenderingContext['NEVER'];
|
|
33
|
+
mask: 0;
|
|
34
34
|
} | {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
func: WebGLRenderingContext['LESS'];
|
|
36
|
+
mask: number;
|
|
37
37
|
} | {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
func: WebGLRenderingContext['EQUAL'];
|
|
39
|
+
mask: number;
|
|
40
40
|
} | {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
func: WebGLRenderingContext['LEQUAL'];
|
|
42
|
+
mask: number;
|
|
43
43
|
} | {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
func: WebGLRenderingContext['GREATER'];
|
|
45
|
+
mask: number;
|
|
46
46
|
} | {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
func: WebGLRenderingContext['NOTEQUAL'];
|
|
48
|
+
mask: number;
|
|
49
49
|
} | {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
func: WebGLRenderingContext['GEQUAL'];
|
|
51
|
+
mask: number;
|
|
52
52
|
} | {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
func: WebGLRenderingContext['ALWAYS'];
|
|
54
|
+
mask: 0;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
export type CullFaceModeType = WebGLRenderingContext['FRONT'] | WebGLRenderingContext['BACK'] | WebGLRenderingContext['FRONT_AND_BACK'];
|
package/src/gl/value.ts
CHANGED
|
@@ -17,12 +17,12 @@ import type {
|
|
|
17
17
|
} from './types';
|
|
18
18
|
|
|
19
19
|
export interface IValue<T> {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
current: T;
|
|
21
|
+
default: T;
|
|
22
|
+
dirty: boolean;
|
|
23
|
+
get(): T;
|
|
24
|
+
setDefault(): void;
|
|
25
|
+
set(value: T): void;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
class BaseValue<T> implements IValue<T> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import VertexBuffer from './vertex_buffer';
|
|
2
|
-
import {StructArrayLayout3i6} from '../data/array_types';
|
|
2
|
+
import {StructArrayLayout3i6} from '../data/array_types.g';
|
|
3
3
|
import Context from '../gl/context';
|
|
4
4
|
import gl from 'gl';
|
|
5
5
|
import {StructArrayMember} from '../util/struct_array';
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference path="./types/glsl.d.ts" />
|
|
2
1
|
import assert from 'assert';
|
|
3
2
|
import {supported} from '@mapbox/mapbox-gl-supported';
|
|
4
3
|
|
|
@@ -24,8 +23,16 @@ import WorkerPool from './util/worker_pool';
|
|
|
24
23
|
import {prewarm, clearPrewarmedResources} from './util/global_worker_pool';
|
|
25
24
|
import {clearTileCache} from './util/tile_request_cache';
|
|
26
25
|
import {PerformanceUtils} from './util/performance';
|
|
26
|
+
import {AJAXError} from './util/ajax';
|
|
27
27
|
import type {RequestParameters, ResponseCallback} from './util/ajax';
|
|
28
28
|
import type {Cancelable} from './types/cancelable';
|
|
29
|
+
import GeoJSONSource from './source/geojson_source';
|
|
30
|
+
import CanvasSource from './source/canvas_source';
|
|
31
|
+
import ImageSource from './source/image_source';
|
|
32
|
+
import RasterDEMTileSource from './source/raster_dem_tile_source';
|
|
33
|
+
import RasterTileSource from './source/raster_tile_source';
|
|
34
|
+
import VectorTileSource from './source/vector_tile_source';
|
|
35
|
+
import VideoSource from './source/video_source';
|
|
29
36
|
|
|
30
37
|
const exported = {
|
|
31
38
|
supported,
|
|
@@ -45,7 +52,15 @@ const exported = {
|
|
|
45
52
|
Point,
|
|
46
53
|
MercatorCoordinate,
|
|
47
54
|
Evented,
|
|
55
|
+
AJAXError,
|
|
48
56
|
config,
|
|
57
|
+
CanvasSource,
|
|
58
|
+
GeoJSONSource,
|
|
59
|
+
ImageSource,
|
|
60
|
+
RasterDEMTileSource,
|
|
61
|
+
RasterTileSource,
|
|
62
|
+
VectorTileSource,
|
|
63
|
+
VideoSource,
|
|
49
64
|
/**
|
|
50
65
|
* Initializes resources like WebWorkers that can be shared across maps to lower load
|
|
51
66
|
* times in some situations. `maplibregl.workerUrl` and `maplibregl.workerCount`, if being
|
|
@@ -223,14 +238,14 @@ Debug.extend(exported, {isSafari, getPerformanceMetrics: PerformanceUtils.getPer
|
|
|
223
238
|
*/
|
|
224
239
|
|
|
225
240
|
/**
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
241
|
+
* Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.
|
|
242
|
+
* The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.
|
|
243
|
+
* If the status is `loaded` and the plugin is requested again, an error will be thrown.
|
|
244
|
+
*
|
|
245
|
+
* @function getRTLTextPluginStatus
|
|
246
|
+
* @example
|
|
247
|
+
* const pluginStatus = maplibregl.getRTLTextPluginStatus();
|
|
248
|
+
*/
|
|
234
249
|
|
|
235
250
|
export default exported;
|
|
236
251
|
// canary assert: used to confirm that asserts have been removed from production build
|
|
@@ -19,17 +19,17 @@ import type {CircleUniformsType} from './program/circle_program';
|
|
|
19
19
|
export default drawCircles;
|
|
20
20
|
|
|
21
21
|
type TileRenderState = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
programConfiguration: ProgramConfiguration;
|
|
23
|
+
program: Program<any>;
|
|
24
|
+
layoutVertexBuffer: VertexBuffer;
|
|
25
|
+
indexBuffer: IndexBuffer;
|
|
26
|
+
uniformValues: UniformValues<CircleUniformsType>;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
type SegmentsTileRenderState = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
segments: SegmentVector;
|
|
31
|
+
sortKey: number;
|
|
32
|
+
state: TileRenderState;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
function drawCircles(painter: Painter, sourceCache: SourceCache, layer: CircleStyleLayer, coords: Array<OverscaledTileID>) {
|
|
@@ -8,7 +8,7 @@ import StencilMode from '../gl/stencil_mode';
|
|
|
8
8
|
import CullFaceMode from '../gl/cull_face_mode';
|
|
9
9
|
import {collisionUniformValues, collisionCircleUniformValues} from './program/collision_program';
|
|
10
10
|
|
|
11
|
-
import {QuadTriangleArray, CollisionCircleLayoutArray} from '../data/array_types';
|
|
11
|
+
import {QuadTriangleArray, CollisionCircleLayoutArray} from '../data/array_types.g';
|
|
12
12
|
import {collisionCircleLayout} from '../data/bucket/symbol_attributes';
|
|
13
13
|
import SegmentVector from '../data/segment';
|
|
14
14
|
import {mat4} from 'gl-matrix';
|
|
@@ -18,10 +18,10 @@ import IndexBuffer from '../gl/index_buffer';
|
|
|
18
18
|
export default drawCollisionDebug;
|
|
19
19
|
|
|
20
20
|
type TileBatch = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
circleArray: Array<number>;
|
|
22
|
+
circleOffset: number;
|
|
23
|
+
transform: mat4;
|
|
24
|
+
invTransform: mat4;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
let quadTriangles: QuadTriangleArray;
|