maplibre-gl 3.2.2 → 3.3.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/build/generate-struct-arrays.ts +3 -1
- package/build/generate-style-code.ts +7 -8
- package/dist/maplibre-gl-csp-worker.js +1 -1
- package/dist/maplibre-gl-csp-worker.js.map +1 -1
- package/dist/maplibre-gl-csp.js +1 -1
- package/dist/maplibre-gl-csp.js.map +1 -1
- package/dist/maplibre-gl-dev.js +424 -168
- package/dist/maplibre-gl-dev.js.map +1 -1
- package/dist/maplibre-gl.d.ts +44 -7
- package/dist/maplibre-gl.js +3 -3
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +10 -10
- package/src/data/array_types.g.ts +78 -14
- package/src/data/bucket/symbol_attributes.ts +7 -1
- package/src/data/bucket/symbol_bucket.ts +4 -1
- package/src/render/draw_symbol.ts +8 -9
- package/src/style/properties.ts +4 -0
- package/src/style/style_layer/background_style_layer_properties.g.ts +1 -6
- package/src/style/style_layer/circle_style_layer_properties.g.ts +1 -6
- package/src/style/style_layer/fill_extrusion_style_layer_properties.g.ts +1 -6
- package/src/style/style_layer/fill_style_layer_properties.g.ts +1 -6
- package/src/style/style_layer/heatmap_style_layer_properties.g.ts +1 -6
- package/src/style/style_layer/hillshade_style_layer_properties.g.ts +1 -6
- package/src/style/style_layer/line_style_layer_properties.g.ts +1 -6
- package/src/style/style_layer/raster_style_layer_properties.g.ts +1 -6
- package/src/style/style_layer/symbol_style_layer_properties.g.ts +4 -6
- package/src/style/style_layer/variable_text_anchor.test.ts +117 -0
- package/src/style/style_layer/variable_text_anchor.ts +163 -0
- package/src/symbol/placement.ts +52 -40
- package/src/symbol/symbol_layout.ts +42 -116
|
@@ -35,7 +35,8 @@ import {
|
|
|
35
35
|
placement,
|
|
36
36
|
symbolInstance,
|
|
37
37
|
glyphOffset,
|
|
38
|
-
lineVertex
|
|
38
|
+
lineVertex,
|
|
39
|
+
textAnchorOffset
|
|
39
40
|
} from '../src/data/bucket/symbol_attributes';
|
|
40
41
|
|
|
41
42
|
const typeAbbreviations = {
|
|
@@ -164,6 +165,7 @@ createStructArrayType('placed_symbol', placement, true);
|
|
|
164
165
|
createStructArrayType('symbol_instance', symbolInstance, true);
|
|
165
166
|
createStructArrayType('glyph_offset', glyphOffset, true);
|
|
166
167
|
createStructArrayType('symbol_line_vertex', lineVertex, true);
|
|
168
|
+
createStructArrayType('text_anchor_offset', textAnchorOffset, true);
|
|
167
169
|
|
|
168
170
|
// feature index array
|
|
169
171
|
createStructArrayType('feature_index', createLayout([
|
|
@@ -29,6 +29,8 @@ function nativeType(property) {
|
|
|
29
29
|
return 'Color';
|
|
30
30
|
case 'padding':
|
|
31
31
|
return 'Padding';
|
|
32
|
+
case 'variableAnchorOffsetCollection':
|
|
33
|
+
return 'VariableAnchorOffsetCollection';
|
|
32
34
|
case 'sprite':
|
|
33
35
|
return 'Sprite';
|
|
34
36
|
case 'formatted':
|
|
@@ -41,7 +43,7 @@ function nativeType(property) {
|
|
|
41
43
|
} else {
|
|
42
44
|
return `Array<${nativeType({type: property.value, values: property.values})}>`;
|
|
43
45
|
}
|
|
44
|
-
default: throw new Error(`unknown type for ${property.name}`);
|
|
46
|
+
default: throw new Error(`unknown type "${property.type}" for "${property.name}"`);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -93,6 +95,8 @@ function runtimeType(property) {
|
|
|
93
95
|
return 'ColorType';
|
|
94
96
|
case 'padding':
|
|
95
97
|
return 'PaddingType';
|
|
98
|
+
case 'variableAnchorOffsetCollection':
|
|
99
|
+
return 'VariableAnchorOffsetCollectionType';
|
|
96
100
|
case 'sprite':
|
|
97
101
|
return 'SpriteType';
|
|
98
102
|
case 'formatted':
|
|
@@ -105,7 +109,7 @@ function runtimeType(property) {
|
|
|
105
109
|
} else {
|
|
106
110
|
return `array(${runtimeType({type: property.value})})`;
|
|
107
111
|
}
|
|
108
|
-
default: throw new Error(`unknown type for ${property.name}`);
|
|
112
|
+
default: throw new Error(`unknown type "${property.type}" for "${property.name}"`);
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
|
|
@@ -182,12 +186,7 @@ import {
|
|
|
182
186
|
CrossFaded
|
|
183
187
|
} from '../properties';
|
|
184
188
|
|
|
185
|
-
import type {Color} from '@maplibre/maplibre-gl-style-spec';
|
|
186
|
-
import type {Padding} from '@maplibre/maplibre-gl-style-spec';
|
|
187
|
-
|
|
188
|
-
import type {Formatted} from '@maplibre/maplibre-gl-style-spec';
|
|
189
|
-
|
|
190
|
-
import type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';
|
|
189
|
+
import type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';
|
|
191
190
|
import {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';
|
|
192
191
|
`);
|
|
193
192
|
|