@mapwhit/tilerenderer 0.47.2 → 0.49.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.
Files changed (43) hide show
  1. package/build/min/package.json +1 -1
  2. package/package.json +3 -2
  3. package/src/data/array_types.js +169 -0
  4. package/src/data/bucket/symbol_attributes.js +18 -0
  5. package/src/data/bucket/symbol_bucket.js +116 -73
  6. package/src/data/program_configuration.js +18 -10
  7. package/src/geo/transform.js +17 -7
  8. package/src/index.js +1 -1
  9. package/src/render/glyph_atlas.js +3 -6
  10. package/src/render/image_atlas.js +3 -6
  11. package/src/render/image_manager.js +41 -41
  12. package/src/source/rtl_text_plugin.js +1 -0
  13. package/src/source/source_cache.js +1 -1
  14. package/src/source/tile.js +6 -5
  15. package/src/source/worker.js +1 -10
  16. package/src/style/style.js +4 -19
  17. package/src/style/style_layer/symbol_style_layer_properties.js +7 -1
  18. package/src/style-spec/expression/compound_expression.js +30 -16
  19. package/src/style-spec/expression/definitions/assertion.js +52 -5
  20. package/src/style-spec/expression/definitions/coercion.js +13 -0
  21. package/src/style-spec/expression/definitions/comparison.js +193 -0
  22. package/src/style-spec/expression/definitions/formatted.js +123 -0
  23. package/src/style-spec/expression/definitions/index.js +11 -62
  24. package/src/style-spec/expression/definitions/interpolate.js +17 -7
  25. package/src/style-spec/expression/definitions/literal.js +5 -0
  26. package/src/style-spec/expression/parsing_context.js +6 -7
  27. package/src/style-spec/expression/types.js +12 -1
  28. package/src/style-spec/feature_filter/convert.js +197 -0
  29. package/src/style-spec/feature_filter/index.js +5 -2
  30. package/src/style-spec/function/convert.js +78 -100
  31. package/src/style-spec/reference/v8.json +160 -52
  32. package/src/symbol/collision_index.js +0 -1
  33. package/src/symbol/cross_tile_symbol_index.js +12 -7
  34. package/src/symbol/get_anchors.js +11 -22
  35. package/src/symbol/mergelines.js +4 -1
  36. package/src/symbol/placement.js +58 -54
  37. package/src/symbol/quads.js +7 -6
  38. package/src/symbol/shaping.js +185 -40
  39. package/src/symbol/symbol_layout.js +40 -37
  40. package/src/symbol/transform_text.js +12 -1
  41. package/src/ui/map.js +8 -25
  42. package/src/style-spec/expression/definitions/array.js +0 -82
  43. package/src/style-spec/expression/definitions/equals.js +0 -93
@@ -70,12 +70,12 @@
70
70
  },
71
71
  "sprite": {
72
72
  "type": "string",
73
- "doc": "A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties.",
73
+ "doc": "A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
74
74
  "example": "mapbox://sprites/mapbox/bright-v8"
75
75
  },
76
76
  "glyphs": {
77
77
  "type": "string",
78
- "doc": "A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property.",
78
+ "doc": "A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
79
79
  "example": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
80
80
  },
81
81
  "transition": {
@@ -144,12 +144,25 @@
144
144
  "length": 4,
145
145
  "default": [
146
146
  -180,
147
- -85.0511,
147
+ -85.051129,
148
148
  180,
149
- 85.0511
149
+ 85.051129
150
150
  ],
151
151
  "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
152
152
  },
153
+ "scheme": {
154
+ "type": "enum",
155
+ "values": {
156
+ "xyz": {
157
+ "doc": "Slippy map tilenames scheme."
158
+ },
159
+ "tms": {
160
+ "doc": "OSGeo spec scheme."
161
+ }
162
+ },
163
+ "default": "xyz",
164
+ "doc": "Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."
165
+ },
153
166
  "minzoom": {
154
167
  "type": "number",
155
168
  "default": 0,
@@ -195,9 +208,9 @@
195
208
  "length": 4,
196
209
  "default": [
197
210
  -180,
198
- -85.0511,
211
+ -85.051129,
199
212
  180,
200
- 85.0511
213
+ 85.051129
201
214
  ],
202
215
  "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
203
216
  },
@@ -265,9 +278,9 @@
265
278
  "length": 4,
266
279
  "default": [
267
280
  -180,
268
- -85.0511,
281
+ -85.051129,
269
282
  180,
270
- 85.0511
283
+ 85.051129
271
284
  ],
272
285
  "doc": "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
273
286
  },
@@ -559,7 +572,7 @@
559
572
  },
560
573
  "filter": {
561
574
  "type": "filter",
562
- "doc": "A expression specifying conditions on source features. Only features that match the filter are displayed."
575
+ "doc": "A expression specifying conditions on source features. Only features that match the filter are displayed. The `feature-state` expression is not supported in filter expressions."
563
576
  },
564
577
  "layout": {
565
578
  "type": "layout",
@@ -933,6 +946,32 @@
933
946
  },
934
947
  "property-type": "data-constant"
935
948
  },
949
+ "symbol-z-order": {
950
+ "type": "enum",
951
+ "values": {
952
+ "viewport-y": {
953
+ "doc": "Symbols will be sorted by their y-position relative to the viewport."
954
+ },
955
+ "source": {
956
+ "doc": "Symbols will be rendered in the same order as the source data with no sorting applied."
957
+ }
958
+ },
959
+ "default": "viewport-y",
960
+ "doc": "Controls the order in which overlapping symbols in the same layer are rendered",
961
+ "sdk-support": {
962
+ "basic functionality": {
963
+ "js": "0.49.0"
964
+ },
965
+ "data-driven styling": {}
966
+ },
967
+ "expression": {
968
+ "interpolated": false,
969
+ "parameters": [
970
+ "zoom"
971
+ ]
972
+ },
973
+ "property-type": "data-constant"
974
+ },
936
975
  "icon-allow-overlap": {
937
976
  "type": "boolean",
938
977
  "default": false,
@@ -1488,10 +1527,10 @@
1488
1527
  "property-type": "data-constant"
1489
1528
  },
1490
1529
  "text-field": {
1491
- "type": "string",
1530
+ "type": "formatted",
1492
1531
  "default": "",
1493
1532
  "tokens": true,
1494
- "doc": "Value to use for a text label.",
1533
+ "doc": "Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.",
1495
1534
  "sdk-support": {
1496
1535
  "basic functionality": {
1497
1536
  "js": "0.10.0",
@@ -2383,6 +2422,24 @@
2383
2422
  }
2384
2423
  }
2385
2424
  },
2425
+ "interpolate-hcl": {
2426
+ "doc": "Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.",
2427
+ "group": "Ramps, scales, curves",
2428
+ "sdk-support": {
2429
+ "basic functionality": {
2430
+ "js": "0.49.0"
2431
+ }
2432
+ }
2433
+ },
2434
+ "interpolate-lab": {
2435
+ "doc": "Produces continuous, smooth results by interpolating between pairs of input and output values (\"stops\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.",
2436
+ "group": "Ramps, scales, curves",
2437
+ "sdk-support": {
2438
+ "basic functionality": {
2439
+ "js": "0.49.0"
2440
+ }
2441
+ }
2442
+ },
2386
2443
  "ln2": {
2387
2444
  "doc": "Returns mathematical constant ln(2).",
2388
2445
  "group": "Math",
@@ -2488,6 +2545,15 @@
2488
2545
  }
2489
2546
  }
2490
2547
  },
2548
+ "format": {
2549
+ "doc": "Returns `formatted` text containing annotations for use in mixed-format `text-field` entries. If set, the `text-font` argument overrides the font specified by the root layout properties. If set, the `font-scale` argument specifies a scaling factor relative to the `text-size` specified in the root layout properties.",
2550
+ "group": "Types",
2551
+ "sdk-support": {
2552
+ "basic functionality": {
2553
+ "js": "0.48.0"
2554
+ }
2555
+ }
2556
+ },
2491
2557
  "to-string": {
2492
2558
  "doc": "Converts the input value to a string. If the input is `null`, the result is `\"\"`. If the input is a boolean, the result is `\"true\"` or `\"false\"`. If the input is a number, it is converted to a string as specified by the [\"NumberToString\" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `\"rgba(r,g,b,a)\"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.",
2493
2559
  "group": "Types",
@@ -2946,7 +3012,7 @@
2946
3012
  }
2947
3013
  },
2948
3014
  "==": {
2949
- "doc": "Returns `true` if the input values are equal, `false` otherwise. Equality is strictly typed: values of different types are always considered not equal. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
3015
+ "doc": "Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
2950
3016
  "group": "Decision",
2951
3017
  "sdk-support": {
2952
3018
  "basic functionality": {
@@ -2958,7 +3024,7 @@
2958
3024
  }
2959
3025
  },
2960
3026
  "!=": {
2961
- "doc": "Returns `true` if the input values are not equal, `false` otherwise. Equality is strictly typed: values of different types are always considered not equal. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
3027
+ "doc": "Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
2962
3028
  "group": "Decision",
2963
3029
  "sdk-support": {
2964
3030
  "basic functionality": {
@@ -2970,7 +3036,7 @@
2970
3036
  }
2971
3037
  },
2972
3038
  ">": {
2973
- "doc": "Returns `true` if the first input is strictly greater than the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
3039
+ "doc": "Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
2974
3040
  "group": "Decision",
2975
3041
  "sdk-support": {
2976
3042
  "basic functionality": {
@@ -2982,7 +3048,7 @@
2982
3048
  }
2983
3049
  },
2984
3050
  "<": {
2985
- "doc": "Returns `true` if the first input is strictly less than the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
3051
+ "doc": "Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
2986
3052
  "group": "Decision",
2987
3053
  "sdk-support": {
2988
3054
  "basic functionality": {
@@ -2994,7 +3060,7 @@
2994
3060
  }
2995
3061
  },
2996
3062
  ">=": {
2997
- "doc": "Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
3063
+ "doc": "Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
2998
3064
  "group": "Decision",
2999
3065
  "sdk-support": {
3000
3066
  "basic functionality": {
@@ -3006,7 +3072,7 @@
3006
3072
  }
3007
3073
  },
3008
3074
  "<=": {
3009
- "doc": "Returns `true` if the first input is less than or equal to the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
3075
+ "doc": "Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
3010
3076
  "group": "Decision",
3011
3077
  "sdk-support": {
3012
3078
  "basic functionality": {
@@ -3082,7 +3148,7 @@
3082
3148
  }
3083
3149
  },
3084
3150
  "concat": {
3085
- "doc": "Returns a string consisting of the concatenation of the inputs.",
3151
+ "doc": "Returns a `string` consisting of the concatenation of the inputs. If any inputs are `formatted`, returns a `formatted` with default formatting options for all unformatted inputs.",
3086
3152
  "group": "String",
3087
3153
  "sdk-support": {
3088
3154
  "basic functionality": {
@@ -3270,7 +3336,8 @@
3270
3336
  "interpolated": true,
3271
3337
  "parameters": [
3272
3338
  "zoom",
3273
- "feature"
3339
+ "feature",
3340
+ "feature-state"
3274
3341
  ]
3275
3342
  },
3276
3343
  "property-type": "data-driven"
@@ -3303,7 +3370,8 @@
3303
3370
  "interpolated": true,
3304
3371
  "parameters": [
3305
3372
  "zoom",
3306
- "feature"
3373
+ "feature",
3374
+ "feature-state"
3307
3375
  ]
3308
3376
  },
3309
3377
  "property-type": "data-driven"
@@ -3338,7 +3406,8 @@
3338
3406
  "interpolated": true,
3339
3407
  "parameters": [
3340
3408
  "zoom",
3341
- "feature"
3409
+ "feature",
3410
+ "feature-state"
3342
3411
  ]
3343
3412
  },
3344
3413
  "property-type": "data-driven"
@@ -3415,7 +3484,10 @@
3415
3484
  "macos": "0.1.0"
3416
3485
  },
3417
3486
  "data-driven styling": {
3418
- "js": "0.46.0"
3487
+ "js": "0.49.0",
3488
+ "android": "6.5.0",
3489
+ "macos": "0.11.0",
3490
+ "ios": "4.4.0"
3419
3491
  }
3420
3492
  },
3421
3493
  "expression": {
@@ -3480,7 +3552,8 @@
3480
3552
  "interpolated": true,
3481
3553
  "parameters": [
3482
3554
  "zoom",
3483
- "feature"
3555
+ "feature",
3556
+ "feature-state"
3484
3557
  ]
3485
3558
  },
3486
3559
  "property-type": "data-driven"
@@ -3556,7 +3629,12 @@
3556
3629
  "ios": "3.6.0",
3557
3630
  "macos": "0.5.0"
3558
3631
  },
3559
- "data-driven styling": {}
3632
+ "data-driven styling": {
3633
+ "js": "0.49.0",
3634
+ "android": "6.5.0",
3635
+ "macos": "0.11.0",
3636
+ "ios": "4.4.0"
3637
+ }
3560
3638
  },
3561
3639
  "expression": {
3562
3640
  "interpolated": false,
@@ -3592,7 +3670,8 @@
3592
3670
  "interpolated": true,
3593
3671
  "parameters": [
3594
3672
  "zoom",
3595
- "feature"
3673
+ "feature",
3674
+ "feature-state"
3596
3675
  ]
3597
3676
  },
3598
3677
  "property-type": "data-driven"
@@ -3625,7 +3704,8 @@
3625
3704
  "interpolated": true,
3626
3705
  "parameters": [
3627
3706
  "zoom",
3628
- "feature"
3707
+ "feature",
3708
+ "feature-state"
3629
3709
  ]
3630
3710
  },
3631
3711
  "property-type": "data-driven"
@@ -3673,7 +3753,8 @@
3673
3753
  "interpolated": true,
3674
3754
  "parameters": [
3675
3755
  "zoom",
3676
- "feature"
3756
+ "feature",
3757
+ "feature-state"
3677
3758
  ]
3678
3759
  },
3679
3760
  "property-type": "data-driven"
@@ -3706,7 +3787,8 @@
3706
3787
  "interpolated": true,
3707
3788
  "parameters": [
3708
3789
  "zoom",
3709
- "feature"
3790
+ "feature",
3791
+ "feature-state"
3710
3792
  ]
3711
3793
  },
3712
3794
  "property-type": "data-driven"
@@ -3793,7 +3875,8 @@
3793
3875
  "interpolated": true,
3794
3876
  "parameters": [
3795
3877
  "zoom",
3796
- "feature"
3878
+ "feature",
3879
+ "feature-state"
3797
3880
  ]
3798
3881
  },
3799
3882
  "property-type": "data-driven"
@@ -3823,7 +3906,8 @@
3823
3906
  "interpolated": true,
3824
3907
  "parameters": [
3825
3908
  "zoom",
3826
- "feature"
3909
+ "feature",
3910
+ "feature-state"
3827
3911
  ]
3828
3912
  },
3829
3913
  "property-type": "data-driven"
@@ -3852,7 +3936,8 @@
3852
3936
  "interpolated": true,
3853
3937
  "parameters": [
3854
3938
  "zoom",
3855
- "feature"
3939
+ "feature",
3940
+ "feature-state"
3856
3941
  ]
3857
3942
  },
3858
3943
  "property-type": "data-driven"
@@ -3882,7 +3967,8 @@
3882
3967
  "interpolated": true,
3883
3968
  "parameters": [
3884
3969
  "zoom",
3885
- "feature"
3970
+ "feature",
3971
+ "feature-state"
3886
3972
  ]
3887
3973
  },
3888
3974
  "property-type": "data-driven"
@@ -3928,7 +4014,10 @@
3928
4014
  "macos": "0.1.0"
3929
4015
  },
3930
4016
  "data-driven styling": {
3931
- "js": "0.46.0"
4017
+ "js": "0.49.0",
4018
+ "android": "6.5.0",
4019
+ "macos": "0.11.0",
4020
+ "ios": "4.4.0"
3932
4021
  }
3933
4022
  },
3934
4023
  "expression": {
@@ -3999,7 +4088,8 @@
3999
4088
  "interpolated": true,
4000
4089
  "parameters": [
4001
4090
  "zoom",
4002
- "feature"
4091
+ "feature",
4092
+ "feature-state"
4003
4093
  ]
4004
4094
  },
4005
4095
  "property-type": "data-driven"
@@ -4027,7 +4117,8 @@
4027
4117
  "interpolated": true,
4028
4118
  "parameters": [
4029
4119
  "zoom",
4030
- "feature"
4120
+ "feature",
4121
+ "feature-state"
4031
4122
  ]
4032
4123
  },
4033
4124
  "property-type": "data-driven"
@@ -4055,7 +4146,8 @@
4055
4146
  "interpolated": true,
4056
4147
  "parameters": [
4057
4148
  "zoom",
4058
- "feature"
4149
+ "feature",
4150
+ "feature-state"
4059
4151
  ]
4060
4152
  },
4061
4153
  "property-type": "data-driven"
@@ -4085,7 +4177,8 @@
4085
4177
  "interpolated": true,
4086
4178
  "parameters": [
4087
4179
  "zoom",
4088
- "feature"
4180
+ "feature",
4181
+ "feature-state"
4089
4182
  ]
4090
4183
  },
4091
4184
  "property-type": "data-driven"
@@ -4233,7 +4326,8 @@
4233
4326
  "interpolated": true,
4234
4327
  "parameters": [
4235
4328
  "zoom",
4236
- "feature"
4329
+ "feature",
4330
+ "feature-state"
4237
4331
  ]
4238
4332
  },
4239
4333
  "property-type": "data-driven"
@@ -4261,7 +4355,8 @@
4261
4355
  "interpolated": true,
4262
4356
  "parameters": [
4263
4357
  "zoom",
4264
- "feature"
4358
+ "feature",
4359
+ "feature-state"
4265
4360
  ]
4266
4361
  },
4267
4362
  "property-type": "data-driven"
@@ -4291,7 +4386,8 @@
4291
4386
  "interpolated": true,
4292
4387
  "parameters": [
4293
4388
  "zoom",
4294
- "feature"
4389
+ "feature",
4390
+ "feature-state"
4295
4391
  ]
4296
4392
  },
4297
4393
  "property-type": "data-driven"
@@ -4323,7 +4419,8 @@
4323
4419
  "interpolated": true,
4324
4420
  "parameters": [
4325
4421
  "zoom",
4326
- "feature"
4422
+ "feature",
4423
+ "feature-state"
4327
4424
  ]
4328
4425
  },
4329
4426
  "property-type": "data-driven"
@@ -4352,7 +4449,8 @@
4352
4449
  "interpolated": true,
4353
4450
  "parameters": [
4354
4451
  "zoom",
4355
- "feature"
4452
+ "feature",
4453
+ "feature-state"
4356
4454
  ]
4357
4455
  },
4358
4456
  "property-type": "data-driven"
@@ -4476,7 +4574,8 @@
4476
4574
  "interpolated": true,
4477
4575
  "parameters": [
4478
4576
  "zoom",
4479
- "feature"
4577
+ "feature",
4578
+ "feature-state"
4480
4579
  ]
4481
4580
  },
4482
4581
  "property-type": "data-driven"
@@ -4507,7 +4606,8 @@
4507
4606
  "interpolated": true,
4508
4607
  "parameters": [
4509
4608
  "zoom",
4510
- "feature"
4609
+ "feature",
4610
+ "feature-state"
4511
4611
  ]
4512
4612
  },
4513
4613
  "property-type": "data-driven"
@@ -4538,7 +4638,8 @@
4538
4638
  "interpolated": true,
4539
4639
  "parameters": [
4540
4640
  "zoom",
4541
- "feature"
4641
+ "feature",
4642
+ "feature-state"
4542
4643
  ]
4543
4644
  },
4544
4645
  "property-type": "data-driven"
@@ -4571,7 +4672,8 @@
4571
4672
  "interpolated": true,
4572
4673
  "parameters": [
4573
4674
  "zoom",
4574
- "feature"
4675
+ "feature",
4676
+ "feature-state"
4575
4677
  ]
4576
4678
  },
4577
4679
  "property-type": "data-driven"
@@ -4604,7 +4706,8 @@
4604
4706
  "interpolated": true,
4605
4707
  "parameters": [
4606
4708
  "zoom",
4607
- "feature"
4709
+ "feature",
4710
+ "feature-state"
4608
4711
  ]
4609
4712
  },
4610
4713
  "property-type": "data-driven"
@@ -4701,7 +4804,8 @@
4701
4804
  "interpolated": true,
4702
4805
  "parameters": [
4703
4806
  "zoom",
4704
- "feature"
4807
+ "feature",
4808
+ "feature-state"
4705
4809
  ]
4706
4810
  },
4707
4811
  "property-type": "data-driven"
@@ -4732,7 +4836,8 @@
4732
4836
  "interpolated": true,
4733
4837
  "parameters": [
4734
4838
  "zoom",
4735
- "feature"
4839
+ "feature",
4840
+ "feature-state"
4736
4841
  ]
4737
4842
  },
4738
4843
  "property-type": "data-driven"
@@ -4763,7 +4868,8 @@
4763
4868
  "interpolated": true,
4764
4869
  "parameters": [
4765
4870
  "zoom",
4766
- "feature"
4871
+ "feature",
4872
+ "feature-state"
4767
4873
  ]
4768
4874
  },
4769
4875
  "property-type": "data-driven"
@@ -4796,7 +4902,8 @@
4796
4902
  "interpolated": true,
4797
4903
  "parameters": [
4798
4904
  "zoom",
4799
- "feature"
4905
+ "feature",
4906
+ "feature-state"
4800
4907
  ]
4801
4908
  },
4802
4909
  "property-type": "data-driven"
@@ -4829,7 +4936,8 @@
4829
4936
  "interpolated": true,
4830
4937
  "parameters": [
4831
4938
  "zoom",
4832
- "feature"
4939
+ "feature",
4940
+ "feature-state"
4833
4941
  ]
4834
4942
  },
4835
4943
  "property-type": "data-driven"
@@ -99,7 +99,6 @@ class CollisionIndex {
99
99
  allowOverlap,
100
100
  scale,
101
101
  textPixelRatio,
102
- key,
103
102
  symbol,
104
103
  lineVertexArray,
105
104
  glyphOffsetArray,
@@ -1,5 +1,7 @@
1
1
  const EXTENT = require('../data/extent');
2
2
 
3
+ const { SymbolInstanceArray } = require('../data/array_types');
4
+
3
5
  /*
4
6
  The CrossTileSymbolIndex generally works on the assumption that
5
7
  a conceptual "unique symbol" can be identified by the text of
@@ -23,7 +25,8 @@ class TileLayerIndex {
23
25
  this.indexedSymbolInstances = {};
24
26
  this.bucketInstanceId = bucketInstanceId;
25
27
 
26
- for (const symbolInstance of symbolInstances) {
28
+ for (let i = 0; i < symbolInstances.length; i++) {
29
+ const symbolInstance = symbolInstances.get(i);
27
30
  const key = symbolInstance.key;
28
31
  if (!this.indexedSymbolInstances[key]) {
29
32
  this.indexedSymbolInstances[key] = [];
@@ -46,10 +49,9 @@ class TileLayerIndex {
46
49
  getScaledCoordinates(symbolInstance, childTileID) {
47
50
  const zDifference = childTileID.canonical.z - this.tileID.canonical.z;
48
51
  const scale = roundingFactor / 2 ** zDifference;
49
- const anchor = symbolInstance.anchor;
50
52
  return {
51
- x: Math.floor((childTileID.canonical.x * EXTENT + anchor.x) * scale),
52
- y: Math.floor((childTileID.canonical.y * EXTENT + anchor.y) * scale)
53
+ x: Math.floor((childTileID.canonical.x * EXTENT + symbolInstance.anchorX) * scale),
54
+ y: Math.floor((childTileID.canonical.y * EXTENT + symbolInstance.anchorY) * scale)
53
55
  };
54
56
  }
55
57
 
@@ -57,7 +59,8 @@ class TileLayerIndex {
57
59
  const tolerance =
58
60
  this.tileID.canonical.z < newTileID.canonical.z ? 1 : 2 ** (this.tileID.canonical.z - newTileID.canonical.z);
59
61
 
60
- for (const symbolInstance of symbolInstances) {
62
+ for (let i = 0; i < symbolInstances.length; i++) {
63
+ const symbolInstance = symbolInstances.get(i);
61
64
  if (symbolInstance.crossTileID) {
62
65
  // already has a match, skip
63
66
  continue;
@@ -143,7 +146,8 @@ class CrossTileSymbolLayerIndex {
143
146
  this.removeBucketCrossTileIDs(tileID.overscaledZ, this.indexes[tileID.overscaledZ][tileID.key]);
144
147
  }
145
148
 
146
- for (const symbolInstance of bucket.symbolInstances) {
149
+ for (let i = 0; i < bucket.symbolInstances.length; i++) {
150
+ const symbolInstance = bucket.symbolInstances.get(i);
147
151
  symbolInstance.crossTileID = 0;
148
152
  }
149
153
 
@@ -170,7 +174,8 @@ class CrossTileSymbolLayerIndex {
170
174
  }
171
175
  }
172
176
 
173
- for (const symbolInstance of bucket.symbolInstances) {
177
+ for (let i = 0; i < bucket.symbolInstances.length; i++) {
178
+ const symbolInstance = bucket.symbolInstances.get(i);
174
179
  if (!symbolInstance.crossTileID) {
175
180
  // symbol did not match any known symbol, assign a new id
176
181
  symbolInstance.crossTileID = crossTileIDs.generate();