@mapwhit/tilerenderer 0.52.1 → 1.1.0
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/README.md +7 -0
- package/build/min/package.json +2 -1
- package/build/min/src/shaders/_prelude.fragment.glsl.js +2 -2
- package/build/min/src/shaders/_prelude.vertex.glsl.js +2 -2
- package/build/min/src/shaders/background.fragment.glsl.js +2 -2
- package/build/min/src/shaders/background.vertex.glsl.js +1 -1
- package/build/min/src/shaders/background_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/background_pattern.vertex.glsl.js +1 -1
- package/build/min/src/shaders/circle.fragment.glsl.js +2 -2
- package/build/min/src/shaders/circle.vertex.glsl.js +2 -2
- package/build/min/src/shaders/clipping_mask.fragment.glsl.js +1 -1
- package/build/min/src/shaders/clipping_mask.vertex.glsl.js +1 -1
- package/build/min/src/shaders/collision_box.fragment.glsl.js +1 -1
- package/build/min/src/shaders/collision_box.vertex.glsl.js +1 -1
- package/build/min/src/shaders/collision_circle.fragment.glsl.js +1 -1
- package/build/min/src/shaders/collision_circle.vertex.glsl.js +1 -1
- package/build/min/src/shaders/debug.fragment.glsl.js +1 -1
- package/build/min/src/shaders/debug.vertex.glsl.js +1 -1
- package/build/min/src/shaders/fill.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_extrusion.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_extrusion.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_extrusion_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_extrusion_pattern.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_outline.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_outline.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_outline_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_outline_pattern.vertex.glsl.js +2 -2
- package/build/min/src/shaders/fill_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/fill_pattern.vertex.glsl.js +2 -2
- package/build/min/src/shaders/heatmap.fragment.glsl.js +2 -2
- package/build/min/src/shaders/heatmap.vertex.glsl.js +2 -2
- package/build/min/src/shaders/heatmap_texture.fragment.glsl.js +2 -2
- package/build/min/src/shaders/heatmap_texture.vertex.glsl.js +1 -1
- package/build/min/src/shaders/hillshade.fragment.glsl.js +2 -2
- package/build/min/src/shaders/hillshade.vertex.glsl.js +1 -1
- package/build/min/src/shaders/hillshade_prepare.fragment.glsl.js +2 -2
- package/build/min/src/shaders/hillshade_prepare.vertex.glsl.js +1 -1
- package/build/min/src/shaders/line.fragment.glsl.js +2 -2
- package/build/min/src/shaders/line.vertex.glsl.js +2 -2
- package/build/min/src/shaders/line_gradient.fragment.glsl.js +2 -2
- package/build/min/src/shaders/line_gradient.vertex.glsl.js +2 -2
- package/build/min/src/shaders/line_pattern.fragment.glsl.js +2 -2
- package/build/min/src/shaders/line_pattern.vertex.glsl.js +2 -2
- package/build/min/src/shaders/line_sdf.fragment.glsl.js +2 -2
- package/build/min/src/shaders/line_sdf.vertex.glsl.js +2 -2
- package/build/min/src/shaders/raster.fragment.glsl.js +2 -2
- package/build/min/src/shaders/raster.vertex.glsl.js +1 -1
- package/build/min/src/shaders/symbol_icon.fragment.glsl.js +2 -2
- package/build/min/src/shaders/symbol_icon.vertex.glsl.js +2 -2
- package/build/min/src/shaders/symbol_sdf.fragment.glsl.js +2 -2
- package/build/min/src/shaders/symbol_sdf.vertex.glsl.js +2 -2
- package/package.json +5 -4
- package/src/data/array_types.js +55 -117
- package/src/data/bucket/circle_attributes.js +2 -4
- package/src/data/bucket/circle_bucket.js +19 -16
- package/src/data/bucket/fill_attributes.js +2 -4
- package/src/data/bucket/fill_bucket.js +38 -27
- package/src/data/bucket/fill_extrusion_attributes.js +2 -4
- package/src/data/bucket/fill_extrusion_bucket.js +56 -37
- package/src/data/bucket/heatmap_bucket.js +2 -11
- package/src/data/bucket/line_attributes.js +2 -4
- package/src/data/bucket/line_bucket.js +208 -163
- package/src/data/bucket/pattern_attributes.js +2 -4
- package/src/data/bucket/pattern_bucket_features.js +7 -9
- package/src/data/bucket/symbol_attributes.js +12 -26
- package/src/data/bucket/symbol_bucket.js +174 -323
- package/src/data/bucket/symbol_buffers.js +62 -0
- package/src/data/bucket/symbol_collision_buffers.js +33 -0
- package/src/data/bucket.js +26 -25
- package/src/data/dem_data.js +11 -10
- package/src/data/extent.js +1 -1
- package/src/data/feature_index.js +38 -28
- package/src/data/index_array_type.js +1 -6
- package/src/data/load_geometry.js +6 -9
- package/src/data/pos_attributes.js +2 -3
- package/src/data/program_configuration.js +47 -38
- package/src/data/raster_bounds_attributes.js +2 -2
- package/src/data/segment.js +4 -7
- package/src/geo/coordinate.js +1 -1
- package/src/geo/lng_lat.js +3 -3
- package/src/geo/lng_lat_bounds.js +8 -4
- package/src/geo/transform.js +69 -30
- package/src/gl/color_mode.js +2 -2
- package/src/gl/context.js +28 -29
- package/src/gl/cull_face_mode.js +1 -1
- package/src/gl/depth_mode.js +1 -1
- package/src/gl/framebuffer.js +8 -4
- package/src/gl/index_buffer.js +2 -2
- package/src/gl/stencil_mode.js +1 -1
- package/src/gl/value.js +33 -68
- package/src/gl/vertex_buffer.js +2 -2
- package/src/index.js +49 -25
- package/src/render/draw_background.js +17 -12
- package/src/render/draw_circle.js +15 -12
- package/src/render/draw_collision_debug.js +11 -8
- package/src/render/draw_debug.js +16 -14
- package/src/render/draw_fill.js +27 -20
- package/src/render/draw_fill_extrusion.js +20 -17
- package/src/render/draw_heatmap.js +21 -16
- package/src/render/draw_hillshade.js +12 -9
- package/src/render/draw_line.js +36 -22
- package/src/render/draw_raster.js +22 -18
- package/src/render/draw_symbol.js +38 -33
- package/src/render/glyph_atlas.js +9 -8
- package/src/render/glyph_manager.js +2 -3
- package/src/render/image_atlas.js +4 -11
- package/src/render/image_manager.js +39 -28
- package/src/render/line_atlas.js +2 -2
- package/src/render/painter.js +78 -61
- package/src/render/program/background_program.js +6 -13
- package/src/render/program/circle_program.js +8 -10
- package/src/render/program/clipping_mask_program.js +3 -5
- package/src/render/program/collision_program.js +4 -6
- package/src/render/program/debug_program.js +3 -5
- package/src/render/program/fill_extrusion_program.js +9 -15
- package/src/render/program/fill_program.js +10 -21
- package/src/render/program/heatmap_program.js +9 -15
- package/src/render/program/hillshade_program.js +16 -22
- package/src/render/program/line_program.js +14 -25
- package/src/render/program/pattern.js +5 -7
- package/src/render/program/program_uniforms.js +13 -20
- package/src/render/program/raster_program.js +9 -11
- package/src/render/program/symbol_program.js +5 -7
- package/src/render/program.js +5 -6
- package/src/render/texture.js +1 -1
- package/src/render/tile_mask.js +6 -4
- package/src/render/uniform_binding.js +9 -20
- package/src/render/vertex_array_object.js +5 -3
- package/src/shaders/encode_attribute.js +2 -6
- package/src/shaders/index.js +103 -51
- package/src/source/geojson_source.js +25 -30
- package/src/source/geojson_worker_source.js +46 -74
- package/src/source/geojson_wrapper.js +13 -5
- package/src/source/image_source.js +17 -28
- package/src/source/load_tilejson.js +3 -3
- package/src/source/pixels_to_tile_units.js +3 -3
- package/src/source/query_features.js +17 -15
- package/src/source/raster_dem_tile_source.js +54 -71
- package/src/source/raster_tile_source.js +14 -15
- package/src/source/resources/glyphs.js +4 -5
- package/src/source/resources/index.js +4 -12
- package/src/source/rtl_text_plugin.js +62 -35
- package/src/source/source.js +14 -22
- package/src/source/source_cache.js +221 -179
- package/src/source/source_state.js +125 -13
- package/src/source/tile.js +67 -66
- package/src/source/tile_bounds.js +36 -29
- package/src/source/tile_cache.js +2 -2
- package/src/source/tile_id.js +30 -26
- package/src/source/vector_tile_source.js +23 -21
- package/src/source/vector_tile_worker_source.js +22 -26
- package/src/source/worker_tile.js +139 -134
- package/src/style/create_style_layer.js +11 -11
- package/src/style/evaluation_parameters.js +4 -6
- package/src/style/light.js +5 -5
- package/src/style/load_sprite.js +6 -6
- package/src/style/parse_glyph_pbf.js +21 -17
- package/src/style/pauseable_placement.js +7 -9
- package/src/style/properties.js +21 -51
- package/src/style/query_utils.js +7 -13
- package/src/style/style.js +314 -221
- package/src/style/style_layer/background_style_layer.js +3 -4
- package/src/style/style_layer/background_style_layer_properties.js +2 -2
- package/src/style/style_layer/circle_style_layer.js +25 -20
- package/src/style/style_layer/circle_style_layer_properties.js +2 -2
- package/src/style/style_layer/fill_extrusion_style_layer.js +55 -37
- package/src/style/style_layer/fill_extrusion_style_layer_properties.js +2 -2
- package/src/style/style_layer/fill_style_layer.js +11 -12
- package/src/style/style_layer/fill_style_layer_properties.js +2 -2
- package/src/style/style_layer/heatmap_style_layer.js +6 -7
- package/src/style/style_layer/heatmap_style_layer_properties.js +2 -2
- package/src/style/style_layer/hillshade_style_layer.js +4 -5
- package/src/style/style_layer/hillshade_style_layer_properties.js +2 -2
- package/src/style/style_layer/line_style_layer.js +33 -30
- package/src/style/style_layer/line_style_layer_properties.js +5 -5
- package/src/style/style_layer/raster_style_layer.js +3 -4
- package/src/style/style_layer/raster_style_layer_properties.js +2 -2
- package/src/style/style_layer/symbol_style_layer.js +20 -21
- package/src/style/style_layer/symbol_style_layer_properties.js +2 -2
- package/src/style/style_layer.js +66 -47
- package/src/style/style_layer_index.js +17 -42
- package/src/style/zoom_history.js +1 -1
- package/src/style-spec/error/parsing_error.js +1 -1
- package/src/style-spec/error/validation_error.js +5 -3
- package/src/style-spec/feature_filter/convert.js +17 -9
- package/src/style-spec/feature_filter/index.js +13 -9
- package/src/style-spec/util/eval_support.js +2 -2
- package/src/style-spec/util/ref_properties.js +1 -1
- package/src/symbol/anchor.js +2 -6
- package/src/symbol/check_max_angle.js +13 -5
- package/src/symbol/clip_line.js +2 -3
- package/src/symbol/collision_feature.js +8 -4
- package/src/symbol/collision_index.js +5 -7
- package/src/symbol/cross_tile_symbol_index.js +7 -10
- package/src/symbol/get_anchors.js +15 -8
- package/src/symbol/grid_index.js +5 -3
- package/src/symbol/mergelines.js +2 -2
- package/src/symbol/opacity_state.js +1 -5
- package/src/symbol/placement.js +28 -23
- package/src/symbol/projection.js +29 -28
- package/src/symbol/quads.js +14 -16
- package/src/symbol/shaping.js +27 -19
- package/src/symbol/symbol_layout.js +24 -28
- package/src/symbol/symbol_size.js +13 -12
- package/src/symbol/transform_text.js +4 -4
- package/src/ui/camera.js +34 -18
- package/src/ui/map.js +102 -44
- package/src/util/async.js +11 -5
- package/src/util/browser.js +1 -1
- package/src/util/callback.js +3 -9
- package/src/util/classify_rings.js +13 -8
- package/src/util/color_ramp.js +3 -3
- package/src/util/config.js +4 -4
- package/src/util/dictionary_coder.js +2 -3
- package/src/util/dom.js +7 -3
- package/src/util/find_pole_of_inaccessibility.js +29 -14
- package/src/util/group_layers.js +41 -0
- package/src/util/image.js +3 -13
- package/src/util/interpolate.js +1 -1
- package/src/util/intersection_tests.js +80 -42
- package/src/util/is_char_in_unicode_block.js +1 -1
- package/src/util/key.js +25 -0
- package/src/util/loader/image.js +1 -1
- package/src/util/object.js +33 -76
- package/src/util/script_detection.js +212 -91
- package/src/util/struct_array.js +8 -40
- package/src/util/task_queue.js +11 -7
- package/src/util/throttle.js +2 -2
- package/src/util/tile_cover.js +8 -5
- package/src/util/token.js +1 -1
- package/src/util/unique_id.js +2 -2
- package/src/util/util.js +21 -29
- package/src/util/vectortile_to_geojson.js +4 -2
- package/src/util/verticalize_punctuation.js +3 -7
- package/src/util/warn.js +4 -4
- package/src/util/web_worker.js +3 -3
- package/src/worker.js +1 -4
- package/src/source/resources/images.js +0 -68
- package/src/source/worker.js +0 -110
- package/src/source/worker_source.js +0 -14
- package/src/style-spec/deref.js +0 -51
- package/src/style-spec/group_by_layout.js +0 -46
- package/src/util/actor.js +0 -108
- package/src/util/dispatcher.js +0 -65
- package/src/util/global_worker_pool.js +0 -15
- package/src/util/transfer_registry.js +0 -168
- package/src/util/web_worker_transfer.js +0 -43
- package/src/util/worker_pool.js +0 -41
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
1
|
+
import { VectorTileFeature } from '@mapwhit/vector-tile';
|
|
2
|
+
import EvaluationParameters from '../../style/evaluation_parameters.js';
|
|
3
|
+
import { LineLayoutArray } from '../array_types.js';
|
|
4
|
+
import EXTENT from '../extent.js';
|
|
5
|
+
import { TriangleIndexArray } from '../index_array_type.js';
|
|
6
|
+
import loadGeometry from '../load_geometry.js';
|
|
7
|
+
import { ProgramConfigurationSet } from '../program_configuration.js';
|
|
8
|
+
import SegmentVector from '../segment.js';
|
|
9
|
+
import layout from './line_attributes.js';
|
|
10
|
+
import { addPatternDependencies, hasPattern } from './pattern_bucket_features.js';
|
|
11
|
+
|
|
12
|
+
const layoutAttributes = layout.members;
|
|
13
|
+
const vectorTileFeatureTypes = VectorTileFeature.types;
|
|
14
14
|
|
|
15
15
|
// NOTE ON EXTRUDE SCALE:
|
|
16
16
|
// scale the extrusion vector so that the normal length is this value.
|
|
@@ -75,7 +75,6 @@ class LineBucket {
|
|
|
75
75
|
this.globalState = options.globalState;
|
|
76
76
|
this.overscaling = options.overscaling;
|
|
77
77
|
this.layers = options.layers;
|
|
78
|
-
this.layerIds = this.layers.map(layer => layer.id);
|
|
79
78
|
this.index = options.index;
|
|
80
79
|
this.features = [];
|
|
81
80
|
this.hasPattern = false;
|
|
@@ -93,8 +92,9 @@ class LineBucket {
|
|
|
93
92
|
for (const { feature, index, sourceLayerIndex } of features) {
|
|
94
93
|
if (
|
|
95
94
|
!this.layers[0]._featureFilter(new EvaluationParameters(this.zoom, { globalState: this.globalState }), feature)
|
|
96
|
-
)
|
|
95
|
+
) {
|
|
97
96
|
continue;
|
|
97
|
+
}
|
|
98
98
|
|
|
99
99
|
const geometry = loadGeometry(feature);
|
|
100
100
|
|
|
@@ -112,7 +112,15 @@ class LineBucket {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
if (this.hasPattern) {
|
|
115
|
-
this.features.push(
|
|
115
|
+
this.features.push(
|
|
116
|
+
addPatternDependencies(
|
|
117
|
+
'line',
|
|
118
|
+
this.layers,
|
|
119
|
+
patternFeature,
|
|
120
|
+
{ zoom: this.zoom, globalState: this.globalState },
|
|
121
|
+
options
|
|
122
|
+
)
|
|
123
|
+
);
|
|
116
124
|
} else {
|
|
117
125
|
this.addFeature(patternFeature, geometry, index, {});
|
|
118
126
|
}
|
|
@@ -122,7 +130,9 @@ class LineBucket {
|
|
|
122
130
|
}
|
|
123
131
|
|
|
124
132
|
update(states, vtLayer, imagePositions) {
|
|
125
|
-
if (!this.stateDependentLayers.length)
|
|
133
|
+
if (!this.stateDependentLayers.length) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
126
136
|
this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, {
|
|
127
137
|
imagePositions,
|
|
128
138
|
globalState: this.globalState
|
|
@@ -154,7 +164,9 @@ class LineBucket {
|
|
|
154
164
|
}
|
|
155
165
|
|
|
156
166
|
destroy() {
|
|
157
|
-
if (!this.layoutVertexBuffer)
|
|
167
|
+
if (!this.layoutVertexBuffer) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
158
170
|
this.layoutVertexBuffer.destroy();
|
|
159
171
|
this.indexBuffer.destroy();
|
|
160
172
|
this.programConfigurations.destroy();
|
|
@@ -162,7 +174,7 @@ class LineBucket {
|
|
|
162
174
|
}
|
|
163
175
|
|
|
164
176
|
addFeature(feature, geometry, index, imagePositions) {
|
|
165
|
-
const layout = this.layers[0].
|
|
177
|
+
const layout = this.layers[0]._layout;
|
|
166
178
|
const join = layout.get('line-join').evaluate(feature, {});
|
|
167
179
|
const cap = layout.get('line-cap');
|
|
168
180
|
const miterLimit = layout.get('line-miter-limit');
|
|
@@ -190,28 +202,32 @@ class LineBucket {
|
|
|
190
202
|
const isPolygon = vectorTileFeatureTypes[feature.type] === 'Polygon';
|
|
191
203
|
|
|
192
204
|
// If the line has duplicate vertices at the ends, adjust start/length to remove them.
|
|
205
|
+
const firstVertex = vertices[0];
|
|
206
|
+
const lastVertex = vertices[vertices.length - 1];
|
|
193
207
|
let len = vertices.length;
|
|
194
|
-
while (len >= 2 &&
|
|
208
|
+
while (len >= 2 && lastVertex.equals(vertices[len - 2])) {
|
|
195
209
|
len--;
|
|
196
210
|
}
|
|
197
211
|
let first = 0;
|
|
198
|
-
while (first < len - 1 &&
|
|
212
|
+
while (first < len - 1 && firstVertex.equals(vertices[first + 1])) {
|
|
199
213
|
first++;
|
|
200
214
|
}
|
|
201
215
|
|
|
202
216
|
// Ignore invalid geometry.
|
|
203
|
-
if (len < (isPolygon ? 3 : 2))
|
|
217
|
+
if (len < (isPolygon ? 3 : 2)) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
204
220
|
|
|
205
221
|
if (lineDistances) {
|
|
206
222
|
lineDistances.tileTotal = calculateFullDistance(vertices, first, len);
|
|
207
223
|
}
|
|
208
224
|
|
|
209
|
-
if (join === 'bevel')
|
|
225
|
+
if (join === 'bevel') {
|
|
226
|
+
miterLimit = 1.05;
|
|
227
|
+
}
|
|
210
228
|
|
|
211
229
|
const sharpCornerOffset = SHARP_CORNER_OFFSET * (EXTENT / (512 * this.overscaling));
|
|
212
230
|
|
|
213
|
-
const firstVertex = vertices[first];
|
|
214
|
-
|
|
215
231
|
// we could be more precise, but it would only save a negligible amount of space
|
|
216
232
|
const segment = this.segments.prepareSegment(len * 10, this.layoutVertexArray, this.indexArray);
|
|
217
233
|
|
|
@@ -222,11 +238,8 @@ class LineBucket {
|
|
|
222
238
|
let startOfLine = true;
|
|
223
239
|
let currentVertex;
|
|
224
240
|
let prevVertex;
|
|
225
|
-
let nextVertex;
|
|
226
241
|
let prevNormal;
|
|
227
242
|
let nextNormal;
|
|
228
|
-
let offsetA;
|
|
229
|
-
let offsetB;
|
|
230
243
|
|
|
231
244
|
// the last three vertices added
|
|
232
245
|
this.e1 = this.e2 = this.e3 = -1;
|
|
@@ -237,17 +250,23 @@ class LineBucket {
|
|
|
237
250
|
}
|
|
238
251
|
|
|
239
252
|
for (let i = first; i < len; i++) {
|
|
240
|
-
nextVertex =
|
|
253
|
+
const nextVertex =
|
|
241
254
|
isPolygon && i === len - 1
|
|
242
255
|
? vertices[first + 1]
|
|
243
256
|
: // if the line is closed, we treat the last vertex like the first
|
|
244
257
|
vertices[i + 1]; // just the next vertex
|
|
245
258
|
|
|
246
259
|
// if two consecutive vertices exist, skip the current one
|
|
247
|
-
if (nextVertex && vertices[i].equals(nextVertex))
|
|
260
|
+
if (nextVertex && vertices[i].equals(nextVertex)) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
248
263
|
|
|
249
|
-
if (nextNormal)
|
|
250
|
-
|
|
264
|
+
if (nextNormal) {
|
|
265
|
+
prevNormal = nextNormal;
|
|
266
|
+
}
|
|
267
|
+
if (currentVertex) {
|
|
268
|
+
prevVertex = currentVertex;
|
|
269
|
+
}
|
|
251
270
|
|
|
252
271
|
currentVertex = vertices[i];
|
|
253
272
|
|
|
@@ -322,156 +341,179 @@ class LineBucket {
|
|
|
322
341
|
if (currentJoin === 'bevel') {
|
|
323
342
|
// The maximum extrude length is 128 / 63 = 2 times the width of the line
|
|
324
343
|
// so if miterLength >= 2 we need to draw a different type of bevel here.
|
|
325
|
-
if (miterLength > 2)
|
|
344
|
+
if (miterLength > 2) {
|
|
345
|
+
currentJoin = 'flipbevel';
|
|
346
|
+
}
|
|
326
347
|
|
|
327
348
|
// If the miterLength is really small and the line bevel wouldn't be visible,
|
|
328
349
|
// just draw a miter join to save a triangle.
|
|
329
|
-
if (miterLength < miterLimit)
|
|
350
|
+
if (miterLength < miterLimit) {
|
|
351
|
+
currentJoin = 'miter';
|
|
352
|
+
}
|
|
330
353
|
}
|
|
331
354
|
|
|
332
355
|
// Calculate how far along the line the currentVertex is
|
|
333
|
-
if (prevVertex)
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
joinNormal._mult(miterLength);
|
|
337
|
-
this.addCurrentVertex(currentVertex, this.distance, joinNormal, 0, 0, false, segment, lineDistances);
|
|
338
|
-
} else if (currentJoin === 'flipbevel') {
|
|
339
|
-
// miter is too big, flip the direction to make a beveled join
|
|
340
|
-
|
|
341
|
-
if (miterLength > 100) {
|
|
342
|
-
// Almost parallel lines
|
|
343
|
-
joinNormal = nextNormal.clone().mult(-1);
|
|
344
|
-
} else {
|
|
345
|
-
const direction = prevNormal.x * nextNormal.y - prevNormal.y * nextNormal.x > 0 ? -1 : 1;
|
|
346
|
-
const bevelLength = (miterLength * prevNormal.add(nextNormal).mag()) / prevNormal.sub(nextNormal).mag();
|
|
347
|
-
joinNormal._perp()._mult(bevelLength * direction);
|
|
348
|
-
}
|
|
349
|
-
this.addCurrentVertex(currentVertex, this.distance, joinNormal, 0, 0, false, segment, lineDistances);
|
|
350
|
-
this.addCurrentVertex(currentVertex, this.distance, joinNormal.mult(-1), 0, 0, false, segment, lineDistances);
|
|
351
|
-
} else if (currentJoin === 'bevel' || currentJoin === 'fakeround') {
|
|
352
|
-
const lineTurnsLeft = prevNormal.x * nextNormal.y - prevNormal.y * nextNormal.x > 0;
|
|
353
|
-
const offset = -Math.sqrt(miterLength * miterLength - 1);
|
|
354
|
-
if (lineTurnsLeft) {
|
|
355
|
-
offsetB = 0;
|
|
356
|
-
offsetA = offset;
|
|
357
|
-
} else {
|
|
358
|
-
offsetA = 0;
|
|
359
|
-
offsetB = offset;
|
|
360
|
-
}
|
|
356
|
+
if (prevVertex) {
|
|
357
|
+
this.distance += currentVertex.dist(prevVertex);
|
|
358
|
+
}
|
|
361
359
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
360
|
+
switch (currentJoin) {
|
|
361
|
+
case 'miter':
|
|
362
|
+
joinNormal._mult(miterLength);
|
|
363
|
+
this.addCurrentVertex(currentVertex, this.distance, joinNormal, 0, 0, false, segment, lineDistances);
|
|
364
|
+
break;
|
|
365
|
+
|
|
366
|
+
case 'flipbevel':
|
|
367
|
+
// miter is too big, flip the direction to make a beveled join
|
|
368
|
+
|
|
369
|
+
if (miterLength > 100) {
|
|
370
|
+
// Almost parallel lines
|
|
371
|
+
joinNormal = nextNormal.clone().mult(-1);
|
|
372
|
+
} else {
|
|
373
|
+
const direction = prevNormal.x * nextNormal.y - prevNormal.y * nextNormal.x > 0 ? -1 : 1;
|
|
374
|
+
const bevelLength = (miterLength * prevNormal.add(nextNormal).mag()) / prevNormal.sub(nextNormal).mag();
|
|
375
|
+
joinNormal._perp()._mult(bevelLength * direction);
|
|
376
|
+
}
|
|
377
|
+
this.addCurrentVertex(currentVertex, this.distance, joinNormal, 0, 0, false, segment, lineDistances);
|
|
378
|
+
this.addCurrentVertex(currentVertex, this.distance, joinNormal.mult(-1), 0, 0, false, segment, lineDistances);
|
|
379
|
+
break;
|
|
380
|
+
|
|
381
|
+
case 'bevel':
|
|
382
|
+
case 'fakeround': {
|
|
383
|
+
const lineTurnsLeft = prevNormal.x * nextNormal.y - prevNormal.y * nextNormal.x > 0;
|
|
384
|
+
const offset = -Math.sqrt(miterLength * miterLength - 1);
|
|
385
|
+
let offsetA;
|
|
386
|
+
let offsetB;
|
|
387
|
+
|
|
388
|
+
if (lineTurnsLeft) {
|
|
389
|
+
offsetB = 0;
|
|
390
|
+
offsetA = offset;
|
|
391
|
+
} else {
|
|
392
|
+
offsetA = 0;
|
|
393
|
+
offsetB = offset;
|
|
394
|
+
}
|
|
375
395
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
// Create a round join by adding multiple pie slices. The join isn't actually round, but
|
|
380
|
-
// it looks like it is at the sizes we render lines at.
|
|
381
|
-
|
|
382
|
-
// Add more triangles for sharper angles.
|
|
383
|
-
// This math is just a good enough approximation. It isn't "correct".
|
|
384
|
-
const n = Math.floor((0.5 - (cosHalfAngle - 0.5)) * 8);
|
|
385
|
-
let approxFractionalJoinNormal;
|
|
386
|
-
|
|
387
|
-
for (let m = 0; m < n; m++) {
|
|
388
|
-
approxFractionalJoinNormal = nextNormal
|
|
389
|
-
.mult((m + 1) / (n + 1))
|
|
390
|
-
._add(prevNormal)
|
|
391
|
-
._unit();
|
|
392
|
-
this.addPieSliceVertex(
|
|
396
|
+
// Close previous segment with a bevel
|
|
397
|
+
if (!startOfLine) {
|
|
398
|
+
this.addCurrentVertex(
|
|
393
399
|
currentVertex,
|
|
394
400
|
this.distance,
|
|
395
|
-
|
|
396
|
-
|
|
401
|
+
prevNormal,
|
|
402
|
+
offsetA,
|
|
403
|
+
offsetB,
|
|
404
|
+
false,
|
|
397
405
|
segment,
|
|
398
406
|
lineDistances
|
|
399
407
|
);
|
|
400
408
|
}
|
|
401
409
|
|
|
402
|
-
|
|
410
|
+
if (currentJoin === 'fakeround') {
|
|
411
|
+
// The join angle is sharp enough that a round join would be visible.
|
|
412
|
+
// Bevel joins fill the gap between segments with a single pie slice triangle.
|
|
413
|
+
// Create a round join by adding multiple pie slices. The join isn't actually round, but
|
|
414
|
+
// it looks like it is at the sizes we render lines at.
|
|
415
|
+
|
|
416
|
+
// Add more triangles for sharper angles.
|
|
417
|
+
// This math is just a good enough approximation. It isn't "correct".
|
|
418
|
+
const n = Math.floor((0.5 - (cosHalfAngle - 0.5)) * 8);
|
|
419
|
+
let approxFractionalJoinNormal;
|
|
420
|
+
|
|
421
|
+
for (let m = 0; m < n; m++) {
|
|
422
|
+
approxFractionalJoinNormal = nextNormal
|
|
423
|
+
.mult((m + 1) / (n + 1))
|
|
424
|
+
._add(prevNormal)
|
|
425
|
+
._unit();
|
|
426
|
+
this.addPieSliceVertex(
|
|
427
|
+
currentVertex,
|
|
428
|
+
this.distance,
|
|
429
|
+
approxFractionalJoinNormal,
|
|
430
|
+
lineTurnsLeft,
|
|
431
|
+
segment,
|
|
432
|
+
lineDistances
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
this.addPieSliceVertex(currentVertex, this.distance, joinNormal, lineTurnsLeft, segment, lineDistances);
|
|
437
|
+
|
|
438
|
+
for (let k = n - 1; k >= 0; k--) {
|
|
439
|
+
approxFractionalJoinNormal = prevNormal
|
|
440
|
+
.mult((k + 1) / (n + 1))
|
|
441
|
+
._add(nextNormal)
|
|
442
|
+
._unit();
|
|
443
|
+
this.addPieSliceVertex(
|
|
444
|
+
currentVertex,
|
|
445
|
+
this.distance,
|
|
446
|
+
approxFractionalJoinNormal,
|
|
447
|
+
lineTurnsLeft,
|
|
448
|
+
segment,
|
|
449
|
+
lineDistances
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
403
453
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
._add(nextNormal)
|
|
408
|
-
._unit();
|
|
409
|
-
this.addPieSliceVertex(
|
|
454
|
+
// Start next segment
|
|
455
|
+
if (nextVertex) {
|
|
456
|
+
this.addCurrentVertex(
|
|
410
457
|
currentVertex,
|
|
411
458
|
this.distance,
|
|
412
|
-
|
|
413
|
-
|
|
459
|
+
nextNormal,
|
|
460
|
+
-offsetA,
|
|
461
|
+
-offsetB,
|
|
462
|
+
false,
|
|
414
463
|
segment,
|
|
415
464
|
lineDistances
|
|
416
465
|
);
|
|
417
466
|
}
|
|
467
|
+
break;
|
|
418
468
|
}
|
|
419
469
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
currentVertex,
|
|
424
|
-
|
|
425
|
-
nextNormal,
|
|
426
|
-
-offsetA,
|
|
427
|
-
-offsetB,
|
|
428
|
-
false,
|
|
429
|
-
segment,
|
|
430
|
-
lineDistances
|
|
431
|
-
);
|
|
432
|
-
}
|
|
433
|
-
} else if (currentJoin === 'butt') {
|
|
434
|
-
if (!startOfLine) {
|
|
435
|
-
// Close previous segment with a butt
|
|
436
|
-
this.addCurrentVertex(currentVertex, this.distance, prevNormal, 0, 0, false, segment, lineDistances);
|
|
437
|
-
}
|
|
470
|
+
case 'butt':
|
|
471
|
+
if (!startOfLine) {
|
|
472
|
+
// Close previous segment with a butt
|
|
473
|
+
this.addCurrentVertex(currentVertex, this.distance, prevNormal, 0, 0, false, segment, lineDistances);
|
|
474
|
+
}
|
|
438
475
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
if (!startOfLine) {
|
|
445
|
-
// Close previous segment with a square cap
|
|
446
|
-
this.addCurrentVertex(currentVertex, this.distance, prevNormal, 1, 1, false, segment, lineDistances);
|
|
476
|
+
// Start next segment with a butt
|
|
477
|
+
if (nextVertex) {
|
|
478
|
+
this.addCurrentVertex(currentVertex, this.distance, nextNormal, 0, 0, false, segment, lineDistances);
|
|
479
|
+
}
|
|
480
|
+
break;
|
|
447
481
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
482
|
+
case 'square':
|
|
483
|
+
if (!startOfLine) {
|
|
484
|
+
// Close previous segment with a square cap
|
|
485
|
+
this.addCurrentVertex(currentVertex, this.distance, prevNormal, 1, 1, false, segment, lineDistances);
|
|
451
486
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
}
|
|
456
|
-
} else if (currentJoin === 'round') {
|
|
457
|
-
if (!startOfLine) {
|
|
458
|
-
// Close previous segment with butt
|
|
459
|
-
this.addCurrentVertex(currentVertex, this.distance, prevNormal, 0, 0, false, segment, lineDistances);
|
|
487
|
+
// The segment is done. Unset vertices to disconnect segments.
|
|
488
|
+
this.e1 = this.e2 = -1;
|
|
489
|
+
}
|
|
460
490
|
|
|
461
|
-
//
|
|
462
|
-
|
|
491
|
+
// Start next segment
|
|
492
|
+
if (nextVertex) {
|
|
493
|
+
this.addCurrentVertex(currentVertex, this.distance, nextNormal, -1, -1, false, segment, lineDistances);
|
|
494
|
+
}
|
|
495
|
+
break;
|
|
463
496
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
497
|
+
case 'round':
|
|
498
|
+
if (!startOfLine) {
|
|
499
|
+
// Close previous segment with butt
|
|
500
|
+
this.addCurrentVertex(currentVertex, this.distance, prevNormal, 0, 0, false, segment, lineDistances);
|
|
467
501
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
// Add round cap before first segment
|
|
471
|
-
this.addCurrentVertex(currentVertex, this.distance, nextNormal, -1, -1, true, segment, lineDistances);
|
|
502
|
+
// Add round cap or linejoin at end of segment
|
|
503
|
+
this.addCurrentVertex(currentVertex, this.distance, prevNormal, 1, 1, true, segment, lineDistances);
|
|
472
504
|
|
|
473
|
-
|
|
474
|
-
|
|
505
|
+
// The segment is done. Unset vertices to disconnect segments.
|
|
506
|
+
this.e1 = this.e2 = -1;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
// Start next segment with a butt
|
|
510
|
+
if (nextVertex) {
|
|
511
|
+
// Add round cap before first segment
|
|
512
|
+
this.addCurrentVertex(currentVertex, this.distance, nextNormal, -1, -1, true, segment, lineDistances);
|
|
513
|
+
|
|
514
|
+
this.addCurrentVertex(currentVertex, this.distance, nextNormal, 0, 0, false, segment, lineDistances);
|
|
515
|
+
}
|
|
516
|
+
break;
|
|
475
517
|
}
|
|
476
518
|
|
|
477
519
|
if (isSharpCorner && i < len - 1) {
|
|
@@ -528,7 +570,9 @@ class LineBucket {
|
|
|
528
570
|
}
|
|
529
571
|
|
|
530
572
|
extrude = normal.clone();
|
|
531
|
-
if (endLeft)
|
|
573
|
+
if (endLeft) {
|
|
574
|
+
extrude._sub(normal.perp()._mult(endLeft));
|
|
575
|
+
}
|
|
532
576
|
addLineVertex(layoutVertexArray, currentVertex, extrude, round, false, endLeft, distance);
|
|
533
577
|
this.e3 = segment.vertexLength++;
|
|
534
578
|
if (this.e1 >= 0 && this.e2 >= 0) {
|
|
@@ -539,7 +583,9 @@ class LineBucket {
|
|
|
539
583
|
this.e2 = this.e3;
|
|
540
584
|
|
|
541
585
|
extrude = normal.mult(-1);
|
|
542
|
-
if (endRight)
|
|
586
|
+
if (endRight) {
|
|
587
|
+
extrude._sub(normal.perp()._mult(endRight));
|
|
588
|
+
}
|
|
543
589
|
addLineVertex(layoutVertexArray, currentVertex, extrude, round, true, -endRight, distance);
|
|
544
590
|
this.e3 = segment.vertexLength++;
|
|
545
591
|
if (this.e1 >= 0 && this.e2 >= 0) {
|
|
@@ -574,7 +620,9 @@ class LineBucket {
|
|
|
574
620
|
const layoutVertexArray = this.layoutVertexArray;
|
|
575
621
|
const indexArray = this.indexArray;
|
|
576
622
|
|
|
577
|
-
if (distancesForScaling)
|
|
623
|
+
if (distancesForScaling) {
|
|
624
|
+
distance = scaleDistance(distance, distancesForScaling);
|
|
625
|
+
}
|
|
578
626
|
|
|
579
627
|
addLineVertex(layoutVertexArray, currentVertex, extrude, false, lineTurnsLeft, 0, distance);
|
|
580
628
|
this.e3 = segment.vertexLength++;
|
|
@@ -619,17 +667,14 @@ function scaleDistance(tileDistance, stats) {
|
|
|
619
667
|
* @private
|
|
620
668
|
*/
|
|
621
669
|
function calculateFullDistance(vertices, first, len) {
|
|
622
|
-
let currentVertex;
|
|
623
|
-
let nextVertex;
|
|
624
670
|
let total = 0;
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
total +=
|
|
671
|
+
let prev = vertices[first];
|
|
672
|
+
for (let i = first + 1; i < len; i++) {
|
|
673
|
+
const next = vertices[i];
|
|
674
|
+
total += prev.dist(next);
|
|
675
|
+
prev = next;
|
|
629
676
|
}
|
|
630
677
|
return total;
|
|
631
678
|
}
|
|
632
679
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
module.exports = LineBucket;
|
|
680
|
+
export default LineBucket;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { createLayout } from '../../util/struct_array.js';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default createLayout([
|
|
4
4
|
// [tl.x, tl.y, br.x, br.y]
|
|
5
5
|
{ name: 'a_pattern_from', components: 4, type: 'Uint16' },
|
|
6
6
|
{ name: 'a_pattern_to', components: 4, type: 'Uint16' }
|
|
7
7
|
]);
|
|
8
|
-
|
|
9
|
-
module.exports = layout;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function hasPattern(type, layers, options) {
|
|
1
|
+
export function hasPattern(type, layers, options) {
|
|
2
2
|
const patterns = options.patternDependencies;
|
|
3
3
|
let hasPattern = false;
|
|
4
4
|
|
|
5
5
|
for (const layer of layers) {
|
|
6
|
-
const patternProperty = layer.
|
|
6
|
+
const patternProperty = layer._paint.get(`${type}-pattern`);
|
|
7
7
|
if (!patternProperty.isConstant()) {
|
|
8
8
|
hasPattern = true;
|
|
9
9
|
}
|
|
@@ -19,16 +19,16 @@ function hasPattern(type, layers, options) {
|
|
|
19
19
|
return hasPattern;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function addPatternDependencies(type, layers, patternFeature, zoom, options) {
|
|
22
|
+
export function addPatternDependencies(type, layers, patternFeature, { zoom, globalState }, options) {
|
|
23
23
|
const patterns = options.patternDependencies;
|
|
24
24
|
for (const layer of layers) {
|
|
25
|
-
const patternProperty = layer.
|
|
25
|
+
const patternProperty = layer._paint.get(`${type}-pattern`);
|
|
26
26
|
|
|
27
27
|
const patternPropertyValue = patternProperty.value;
|
|
28
28
|
if (patternPropertyValue.kind !== 'constant') {
|
|
29
|
-
const min = patternPropertyValue.evaluate({ zoom: zoom - 1 }, patternFeature, {});
|
|
30
|
-
const mid = patternPropertyValue.evaluate({ zoom: zoom }, patternFeature, {});
|
|
31
|
-
const max = patternPropertyValue.evaluate({ zoom: zoom + 1 }, patternFeature, {});
|
|
29
|
+
const min = patternPropertyValue.evaluate({ zoom: zoom - 1, globalState }, patternFeature, {});
|
|
30
|
+
const mid = patternPropertyValue.evaluate({ zoom: zoom, globalState }, patternFeature, {});
|
|
31
|
+
const max = patternPropertyValue.evaluate({ zoom: zoom + 1, globalState }, patternFeature, {});
|
|
32
32
|
// add to patternDependencies
|
|
33
33
|
patterns[min] = true;
|
|
34
34
|
patterns[mid] = true;
|
|
@@ -40,5 +40,3 @@ function addPatternDependencies(type, layers, patternFeature, zoom, options) {
|
|
|
40
40
|
}
|
|
41
41
|
return patternFeature;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
module.exports = { hasPattern, addPatternDependencies };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { createLayout } from '../../util/struct_array.js';
|
|
2
2
|
|
|
3
|
-
const symbolLayoutAttributes = createLayout([
|
|
3
|
+
export const symbolLayoutAttributes = createLayout([
|
|
4
4
|
{ name: 'a_pos_offset', components: 4, type: 'Int16' },
|
|
5
5
|
{ name: 'a_data', components: 4, type: 'Uint16' }
|
|
6
6
|
]);
|
|
7
7
|
|
|
8
|
-
const dynamicLayoutAttributes = createLayout([{ name: 'a_projected_pos', components: 3, type: 'Float32' }], 4);
|
|
8
|
+
export const dynamicLayoutAttributes = createLayout([{ name: 'a_projected_pos', components: 3, type: 'Float32' }], 4);
|
|
9
9
|
|
|
10
|
-
const placementOpacityAttributes = createLayout([{ name: 'a_fade_opacity', components: 1, type: 'Uint32' }], 4);
|
|
10
|
+
export const placementOpacityAttributes = createLayout([{ name: 'a_fade_opacity', components: 1, type: 'Uint32' }], 4);
|
|
11
11
|
|
|
12
|
-
const collisionVertexAttributes = createLayout([{ name: 'a_placed', components: 2, type: 'Uint8' }], 4);
|
|
12
|
+
export const collisionVertexAttributes = createLayout([{ name: 'a_placed', components: 2, type: 'Uint8' }], 4);
|
|
13
13
|
|
|
14
|
-
const collisionBox = createLayout([
|
|
14
|
+
export const collisionBox = createLayout([
|
|
15
15
|
// the box is centered around the anchor point
|
|
16
16
|
{ type: 'Int16', name: 'anchorPointX' },
|
|
17
17
|
{ type: 'Int16', name: 'anchorPointY' },
|
|
@@ -36,7 +36,7 @@ const collisionBox = createLayout([
|
|
|
36
36
|
{ type: 'Int16', name: 'signedDistanceFromAnchor' }
|
|
37
37
|
]);
|
|
38
38
|
|
|
39
|
-
const collisionBoxLayout = createLayout(
|
|
39
|
+
export const collisionBoxLayout = createLayout(
|
|
40
40
|
[
|
|
41
41
|
// used to render collision boxes for debugging purposes
|
|
42
42
|
{ name: 'a_pos', components: 2, type: 'Int16' },
|
|
@@ -46,7 +46,7 @@ const collisionBoxLayout = createLayout(
|
|
|
46
46
|
4
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
const collisionCircleLayout = createLayout(
|
|
49
|
+
export const collisionCircleLayout = createLayout(
|
|
50
50
|
[
|
|
51
51
|
// used to render collision circles for debugging purposes
|
|
52
52
|
{ name: 'a_pos', components: 2, type: 'Int16' },
|
|
@@ -56,7 +56,7 @@ const collisionCircleLayout = createLayout(
|
|
|
56
56
|
4
|
|
57
57
|
);
|
|
58
58
|
|
|
59
|
-
const placement = createLayout([
|
|
59
|
+
export const placement = createLayout([
|
|
60
60
|
{ type: 'Int16', name: 'anchorX' },
|
|
61
61
|
{ type: 'Int16', name: 'anchorY' },
|
|
62
62
|
{ type: 'Uint16', name: 'glyphStartIndex' },
|
|
@@ -73,7 +73,7 @@ const placement = createLayout([
|
|
|
73
73
|
{ type: 'Uint8', name: 'hidden' }
|
|
74
74
|
]);
|
|
75
75
|
|
|
76
|
-
const symbolInstance = createLayout([
|
|
76
|
+
export const symbolInstance = createLayout([
|
|
77
77
|
{ type: 'Int16', name: 'anchorX' },
|
|
78
78
|
{ type: 'Int16', name: 'anchorY' },
|
|
79
79
|
{ type: 'Int16', name: 'horizontalPlacedTextSymbolIndex' },
|
|
@@ -90,24 +90,10 @@ const symbolInstance = createLayout([
|
|
|
90
90
|
{ type: 'Uint32', name: 'crossTileID' }
|
|
91
91
|
]);
|
|
92
92
|
|
|
93
|
-
const glyphOffset = createLayout([{ type: 'Float32', name: 'offsetX' }]);
|
|
93
|
+
export const glyphOffset = createLayout([{ type: 'Float32', name: 'offsetX' }]);
|
|
94
94
|
|
|
95
|
-
const lineVertex = createLayout([
|
|
95
|
+
export const lineVertex = createLayout([
|
|
96
96
|
{ type: 'Int16', name: 'x' },
|
|
97
97
|
{ type: 'Int16', name: 'y' },
|
|
98
98
|
{ type: 'Int16', name: 'tileUnitDistanceFromAnchor' }
|
|
99
99
|
]);
|
|
100
|
-
|
|
101
|
-
module.exports = {
|
|
102
|
-
symbolLayoutAttributes,
|
|
103
|
-
dynamicLayoutAttributes,
|
|
104
|
-
placementOpacityAttributes,
|
|
105
|
-
collisionVertexAttributes,
|
|
106
|
-
collisionBox,
|
|
107
|
-
collisionBoxLayout,
|
|
108
|
-
collisionCircleLayout,
|
|
109
|
-
placement,
|
|
110
|
-
symbolInstance,
|
|
111
|
-
glyphOffset,
|
|
112
|
-
lineVertex
|
|
113
|
-
};
|