@mapwhit/tilerenderer 0.47.2 → 0.48.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/min/package.json +1 -1
- package/package.json +1 -1
- package/src/data/bucket/symbol_bucket.js +25 -11
- package/src/data/program_configuration.js +18 -10
- package/src/geo/transform.js +4 -2
- package/src/index.js +1 -1
- package/src/source/rtl_text_plugin.js +1 -0
- package/src/source/source_cache.js +1 -1
- package/src/source/tile.js +6 -5
- package/src/source/worker.js +1 -10
- package/src/style/style.js +4 -19
- package/src/style/style_layer/symbol_style_layer_properties.js +1 -1
- package/src/style-spec/expression/compound_expression.js +30 -16
- package/src/style-spec/expression/definitions/coercion.js +13 -0
- package/src/style-spec/expression/definitions/comparison.js +193 -0
- package/src/style-spec/expression/definitions/formatted.js +123 -0
- package/src/style-spec/expression/definitions/index.js +10 -60
- package/src/style-spec/expression/definitions/interpolate.js +17 -7
- package/src/style-spec/expression/definitions/literal.js +5 -0
- package/src/style-spec/expression/parsing_context.js +4 -0
- package/src/style-spec/expression/types.js +12 -1
- package/src/style-spec/feature_filter/index.js +1 -1
- package/src/style-spec/reference/v8.json +118 -47
- package/src/symbol/get_anchors.js +11 -22
- package/src/symbol/mergelines.js +4 -1
- package/src/symbol/placement.js +8 -2
- package/src/symbol/quads.js +7 -6
- package/src/symbol/shaping.js +185 -40
- package/src/symbol/symbol_layout.js +9 -6
- package/src/symbol/transform_text.js +12 -1
- package/src/ui/map.js +8 -25
- package/src/style-spec/expression/definitions/equals.js +0 -93
|
@@ -144,12 +144,25 @@
|
|
|
144
144
|
"length": 4,
|
|
145
145
|
"default": [
|
|
146
146
|
-180,
|
|
147
|
-
-85.
|
|
147
|
+
-85.051129,
|
|
148
148
|
180,
|
|
149
|
-
85.
|
|
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.
|
|
211
|
+
-85.051129,
|
|
199
212
|
180,
|
|
200
|
-
85.
|
|
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.
|
|
281
|
+
-85.051129,
|
|
269
282
|
180,
|
|
270
|
-
85.
|
|
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",
|
|
@@ -1488,10 +1501,10 @@
|
|
|
1488
1501
|
"property-type": "data-constant"
|
|
1489
1502
|
},
|
|
1490
1503
|
"text-field": {
|
|
1491
|
-
"type": "
|
|
1504
|
+
"type": "formatted",
|
|
1492
1505
|
"default": "",
|
|
1493
1506
|
"tokens": true,
|
|
1494
|
-
"doc": "Value to use for a text label.",
|
|
1507
|
+
"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
1508
|
"sdk-support": {
|
|
1496
1509
|
"basic functionality": {
|
|
1497
1510
|
"js": "0.10.0",
|
|
@@ -2383,6 +2396,24 @@
|
|
|
2383
2396
|
}
|
|
2384
2397
|
}
|
|
2385
2398
|
},
|
|
2399
|
+
"interpolate-hcl": {
|
|
2400
|
+
"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.",
|
|
2401
|
+
"group": "Ramps, scales, curves",
|
|
2402
|
+
"sdk-support": {
|
|
2403
|
+
"basic functionality": {
|
|
2404
|
+
"js": "0.49.0"
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
},
|
|
2408
|
+
"interpolate-lab": {
|
|
2409
|
+
"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.",
|
|
2410
|
+
"group": "Ramps, scales, curves",
|
|
2411
|
+
"sdk-support": {
|
|
2412
|
+
"basic functionality": {
|
|
2413
|
+
"js": "0.49.0"
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
},
|
|
2386
2417
|
"ln2": {
|
|
2387
2418
|
"doc": "Returns mathematical constant ln(2).",
|
|
2388
2419
|
"group": "Math",
|
|
@@ -2488,6 +2519,15 @@
|
|
|
2488
2519
|
}
|
|
2489
2520
|
}
|
|
2490
2521
|
},
|
|
2522
|
+
"format": {
|
|
2523
|
+
"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.",
|
|
2524
|
+
"group": "Types",
|
|
2525
|
+
"sdk-support": {
|
|
2526
|
+
"basic functionality": {
|
|
2527
|
+
"js": "0.48.0"
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
},
|
|
2491
2531
|
"to-string": {
|
|
2492
2532
|
"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
2533
|
"group": "Types",
|
|
@@ -2946,7 +2986,7 @@
|
|
|
2946
2986
|
}
|
|
2947
2987
|
},
|
|
2948
2988
|
"==": {
|
|
2949
|
-
"doc": "Returns `true` if the input values are equal, `false` otherwise.
|
|
2989
|
+
"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
2990
|
"group": "Decision",
|
|
2951
2991
|
"sdk-support": {
|
|
2952
2992
|
"basic functionality": {
|
|
@@ -2958,7 +2998,7 @@
|
|
|
2958
2998
|
}
|
|
2959
2999
|
},
|
|
2960
3000
|
"!=": {
|
|
2961
|
-
"doc": "Returns `true` if the input values are not equal, `false` otherwise.
|
|
3001
|
+
"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
3002
|
"group": "Decision",
|
|
2963
3003
|
"sdk-support": {
|
|
2964
3004
|
"basic functionality": {
|
|
@@ -2970,7 +3010,7 @@
|
|
|
2970
3010
|
}
|
|
2971
3011
|
},
|
|
2972
3012
|
">": {
|
|
2973
|
-
"doc": "Returns `true` if the first input is strictly greater than the second, `false` otherwise. The
|
|
3013
|
+
"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
3014
|
"group": "Decision",
|
|
2975
3015
|
"sdk-support": {
|
|
2976
3016
|
"basic functionality": {
|
|
@@ -2982,7 +3022,7 @@
|
|
|
2982
3022
|
}
|
|
2983
3023
|
},
|
|
2984
3024
|
"<": {
|
|
2985
|
-
"doc": "Returns `true` if the first input is strictly less than the second, `false` otherwise. The
|
|
3025
|
+
"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
3026
|
"group": "Decision",
|
|
2987
3027
|
"sdk-support": {
|
|
2988
3028
|
"basic functionality": {
|
|
@@ -2994,7 +3034,7 @@
|
|
|
2994
3034
|
}
|
|
2995
3035
|
},
|
|
2996
3036
|
">=": {
|
|
2997
|
-
"doc": "Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The
|
|
3037
|
+
"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
3038
|
"group": "Decision",
|
|
2999
3039
|
"sdk-support": {
|
|
3000
3040
|
"basic functionality": {
|
|
@@ -3006,7 +3046,7 @@
|
|
|
3006
3046
|
}
|
|
3007
3047
|
},
|
|
3008
3048
|
"<=": {
|
|
3009
|
-
"doc": "Returns `true` if the first input is less than or equal to the second, `false` otherwise. The
|
|
3049
|
+
"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
3050
|
"group": "Decision",
|
|
3011
3051
|
"sdk-support": {
|
|
3012
3052
|
"basic functionality": {
|
|
@@ -3082,7 +3122,7 @@
|
|
|
3082
3122
|
}
|
|
3083
3123
|
},
|
|
3084
3124
|
"concat": {
|
|
3085
|
-
"doc": "Returns a string consisting of the concatenation of the inputs.",
|
|
3125
|
+
"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
3126
|
"group": "String",
|
|
3087
3127
|
"sdk-support": {
|
|
3088
3128
|
"basic functionality": {
|
|
@@ -3270,7 +3310,8 @@
|
|
|
3270
3310
|
"interpolated": true,
|
|
3271
3311
|
"parameters": [
|
|
3272
3312
|
"zoom",
|
|
3273
|
-
"feature"
|
|
3313
|
+
"feature",
|
|
3314
|
+
"feature-state"
|
|
3274
3315
|
]
|
|
3275
3316
|
},
|
|
3276
3317
|
"property-type": "data-driven"
|
|
@@ -3303,7 +3344,8 @@
|
|
|
3303
3344
|
"interpolated": true,
|
|
3304
3345
|
"parameters": [
|
|
3305
3346
|
"zoom",
|
|
3306
|
-
"feature"
|
|
3347
|
+
"feature",
|
|
3348
|
+
"feature-state"
|
|
3307
3349
|
]
|
|
3308
3350
|
},
|
|
3309
3351
|
"property-type": "data-driven"
|
|
@@ -3338,7 +3380,8 @@
|
|
|
3338
3380
|
"interpolated": true,
|
|
3339
3381
|
"parameters": [
|
|
3340
3382
|
"zoom",
|
|
3341
|
-
"feature"
|
|
3383
|
+
"feature",
|
|
3384
|
+
"feature-state"
|
|
3342
3385
|
]
|
|
3343
3386
|
},
|
|
3344
3387
|
"property-type": "data-driven"
|
|
@@ -3480,7 +3523,8 @@
|
|
|
3480
3523
|
"interpolated": true,
|
|
3481
3524
|
"parameters": [
|
|
3482
3525
|
"zoom",
|
|
3483
|
-
"feature"
|
|
3526
|
+
"feature",
|
|
3527
|
+
"feature-state"
|
|
3484
3528
|
]
|
|
3485
3529
|
},
|
|
3486
3530
|
"property-type": "data-driven"
|
|
@@ -3592,7 +3636,8 @@
|
|
|
3592
3636
|
"interpolated": true,
|
|
3593
3637
|
"parameters": [
|
|
3594
3638
|
"zoom",
|
|
3595
|
-
"feature"
|
|
3639
|
+
"feature",
|
|
3640
|
+
"feature-state"
|
|
3596
3641
|
]
|
|
3597
3642
|
},
|
|
3598
3643
|
"property-type": "data-driven"
|
|
@@ -3625,7 +3670,8 @@
|
|
|
3625
3670
|
"interpolated": true,
|
|
3626
3671
|
"parameters": [
|
|
3627
3672
|
"zoom",
|
|
3628
|
-
"feature"
|
|
3673
|
+
"feature",
|
|
3674
|
+
"feature-state"
|
|
3629
3675
|
]
|
|
3630
3676
|
},
|
|
3631
3677
|
"property-type": "data-driven"
|
|
@@ -3673,7 +3719,8 @@
|
|
|
3673
3719
|
"interpolated": true,
|
|
3674
3720
|
"parameters": [
|
|
3675
3721
|
"zoom",
|
|
3676
|
-
"feature"
|
|
3722
|
+
"feature",
|
|
3723
|
+
"feature-state"
|
|
3677
3724
|
]
|
|
3678
3725
|
},
|
|
3679
3726
|
"property-type": "data-driven"
|
|
@@ -3706,7 +3753,8 @@
|
|
|
3706
3753
|
"interpolated": true,
|
|
3707
3754
|
"parameters": [
|
|
3708
3755
|
"zoom",
|
|
3709
|
-
"feature"
|
|
3756
|
+
"feature",
|
|
3757
|
+
"feature-state"
|
|
3710
3758
|
]
|
|
3711
3759
|
},
|
|
3712
3760
|
"property-type": "data-driven"
|
|
@@ -3793,7 +3841,8 @@
|
|
|
3793
3841
|
"interpolated": true,
|
|
3794
3842
|
"parameters": [
|
|
3795
3843
|
"zoom",
|
|
3796
|
-
"feature"
|
|
3844
|
+
"feature",
|
|
3845
|
+
"feature-state"
|
|
3797
3846
|
]
|
|
3798
3847
|
},
|
|
3799
3848
|
"property-type": "data-driven"
|
|
@@ -3823,7 +3872,8 @@
|
|
|
3823
3872
|
"interpolated": true,
|
|
3824
3873
|
"parameters": [
|
|
3825
3874
|
"zoom",
|
|
3826
|
-
"feature"
|
|
3875
|
+
"feature",
|
|
3876
|
+
"feature-state"
|
|
3827
3877
|
]
|
|
3828
3878
|
},
|
|
3829
3879
|
"property-type": "data-driven"
|
|
@@ -3852,7 +3902,8 @@
|
|
|
3852
3902
|
"interpolated": true,
|
|
3853
3903
|
"parameters": [
|
|
3854
3904
|
"zoom",
|
|
3855
|
-
"feature"
|
|
3905
|
+
"feature",
|
|
3906
|
+
"feature-state"
|
|
3856
3907
|
]
|
|
3857
3908
|
},
|
|
3858
3909
|
"property-type": "data-driven"
|
|
@@ -3882,7 +3933,8 @@
|
|
|
3882
3933
|
"interpolated": true,
|
|
3883
3934
|
"parameters": [
|
|
3884
3935
|
"zoom",
|
|
3885
|
-
"feature"
|
|
3936
|
+
"feature",
|
|
3937
|
+
"feature-state"
|
|
3886
3938
|
]
|
|
3887
3939
|
},
|
|
3888
3940
|
"property-type": "data-driven"
|
|
@@ -3999,7 +4051,8 @@
|
|
|
3999
4051
|
"interpolated": true,
|
|
4000
4052
|
"parameters": [
|
|
4001
4053
|
"zoom",
|
|
4002
|
-
"feature"
|
|
4054
|
+
"feature",
|
|
4055
|
+
"feature-state"
|
|
4003
4056
|
]
|
|
4004
4057
|
},
|
|
4005
4058
|
"property-type": "data-driven"
|
|
@@ -4027,7 +4080,8 @@
|
|
|
4027
4080
|
"interpolated": true,
|
|
4028
4081
|
"parameters": [
|
|
4029
4082
|
"zoom",
|
|
4030
|
-
"feature"
|
|
4083
|
+
"feature",
|
|
4084
|
+
"feature-state"
|
|
4031
4085
|
]
|
|
4032
4086
|
},
|
|
4033
4087
|
"property-type": "data-driven"
|
|
@@ -4055,7 +4109,8 @@
|
|
|
4055
4109
|
"interpolated": true,
|
|
4056
4110
|
"parameters": [
|
|
4057
4111
|
"zoom",
|
|
4058
|
-
"feature"
|
|
4112
|
+
"feature",
|
|
4113
|
+
"feature-state"
|
|
4059
4114
|
]
|
|
4060
4115
|
},
|
|
4061
4116
|
"property-type": "data-driven"
|
|
@@ -4085,7 +4140,8 @@
|
|
|
4085
4140
|
"interpolated": true,
|
|
4086
4141
|
"parameters": [
|
|
4087
4142
|
"zoom",
|
|
4088
|
-
"feature"
|
|
4143
|
+
"feature",
|
|
4144
|
+
"feature-state"
|
|
4089
4145
|
]
|
|
4090
4146
|
},
|
|
4091
4147
|
"property-type": "data-driven"
|
|
@@ -4233,7 +4289,8 @@
|
|
|
4233
4289
|
"interpolated": true,
|
|
4234
4290
|
"parameters": [
|
|
4235
4291
|
"zoom",
|
|
4236
|
-
"feature"
|
|
4292
|
+
"feature",
|
|
4293
|
+
"feature-state"
|
|
4237
4294
|
]
|
|
4238
4295
|
},
|
|
4239
4296
|
"property-type": "data-driven"
|
|
@@ -4261,7 +4318,8 @@
|
|
|
4261
4318
|
"interpolated": true,
|
|
4262
4319
|
"parameters": [
|
|
4263
4320
|
"zoom",
|
|
4264
|
-
"feature"
|
|
4321
|
+
"feature",
|
|
4322
|
+
"feature-state"
|
|
4265
4323
|
]
|
|
4266
4324
|
},
|
|
4267
4325
|
"property-type": "data-driven"
|
|
@@ -4291,7 +4349,8 @@
|
|
|
4291
4349
|
"interpolated": true,
|
|
4292
4350
|
"parameters": [
|
|
4293
4351
|
"zoom",
|
|
4294
|
-
"feature"
|
|
4352
|
+
"feature",
|
|
4353
|
+
"feature-state"
|
|
4295
4354
|
]
|
|
4296
4355
|
},
|
|
4297
4356
|
"property-type": "data-driven"
|
|
@@ -4323,7 +4382,8 @@
|
|
|
4323
4382
|
"interpolated": true,
|
|
4324
4383
|
"parameters": [
|
|
4325
4384
|
"zoom",
|
|
4326
|
-
"feature"
|
|
4385
|
+
"feature",
|
|
4386
|
+
"feature-state"
|
|
4327
4387
|
]
|
|
4328
4388
|
},
|
|
4329
4389
|
"property-type": "data-driven"
|
|
@@ -4352,7 +4412,8 @@
|
|
|
4352
4412
|
"interpolated": true,
|
|
4353
4413
|
"parameters": [
|
|
4354
4414
|
"zoom",
|
|
4355
|
-
"feature"
|
|
4415
|
+
"feature",
|
|
4416
|
+
"feature-state"
|
|
4356
4417
|
]
|
|
4357
4418
|
},
|
|
4358
4419
|
"property-type": "data-driven"
|
|
@@ -4476,7 +4537,8 @@
|
|
|
4476
4537
|
"interpolated": true,
|
|
4477
4538
|
"parameters": [
|
|
4478
4539
|
"zoom",
|
|
4479
|
-
"feature"
|
|
4540
|
+
"feature",
|
|
4541
|
+
"feature-state"
|
|
4480
4542
|
]
|
|
4481
4543
|
},
|
|
4482
4544
|
"property-type": "data-driven"
|
|
@@ -4507,7 +4569,8 @@
|
|
|
4507
4569
|
"interpolated": true,
|
|
4508
4570
|
"parameters": [
|
|
4509
4571
|
"zoom",
|
|
4510
|
-
"feature"
|
|
4572
|
+
"feature",
|
|
4573
|
+
"feature-state"
|
|
4511
4574
|
]
|
|
4512
4575
|
},
|
|
4513
4576
|
"property-type": "data-driven"
|
|
@@ -4538,7 +4601,8 @@
|
|
|
4538
4601
|
"interpolated": true,
|
|
4539
4602
|
"parameters": [
|
|
4540
4603
|
"zoom",
|
|
4541
|
-
"feature"
|
|
4604
|
+
"feature",
|
|
4605
|
+
"feature-state"
|
|
4542
4606
|
]
|
|
4543
4607
|
},
|
|
4544
4608
|
"property-type": "data-driven"
|
|
@@ -4571,7 +4635,8 @@
|
|
|
4571
4635
|
"interpolated": true,
|
|
4572
4636
|
"parameters": [
|
|
4573
4637
|
"zoom",
|
|
4574
|
-
"feature"
|
|
4638
|
+
"feature",
|
|
4639
|
+
"feature-state"
|
|
4575
4640
|
]
|
|
4576
4641
|
},
|
|
4577
4642
|
"property-type": "data-driven"
|
|
@@ -4604,7 +4669,8 @@
|
|
|
4604
4669
|
"interpolated": true,
|
|
4605
4670
|
"parameters": [
|
|
4606
4671
|
"zoom",
|
|
4607
|
-
"feature"
|
|
4672
|
+
"feature",
|
|
4673
|
+
"feature-state"
|
|
4608
4674
|
]
|
|
4609
4675
|
},
|
|
4610
4676
|
"property-type": "data-driven"
|
|
@@ -4701,7 +4767,8 @@
|
|
|
4701
4767
|
"interpolated": true,
|
|
4702
4768
|
"parameters": [
|
|
4703
4769
|
"zoom",
|
|
4704
|
-
"feature"
|
|
4770
|
+
"feature",
|
|
4771
|
+
"feature-state"
|
|
4705
4772
|
]
|
|
4706
4773
|
},
|
|
4707
4774
|
"property-type": "data-driven"
|
|
@@ -4732,7 +4799,8 @@
|
|
|
4732
4799
|
"interpolated": true,
|
|
4733
4800
|
"parameters": [
|
|
4734
4801
|
"zoom",
|
|
4735
|
-
"feature"
|
|
4802
|
+
"feature",
|
|
4803
|
+
"feature-state"
|
|
4736
4804
|
]
|
|
4737
4805
|
},
|
|
4738
4806
|
"property-type": "data-driven"
|
|
@@ -4763,7 +4831,8 @@
|
|
|
4763
4831
|
"interpolated": true,
|
|
4764
4832
|
"parameters": [
|
|
4765
4833
|
"zoom",
|
|
4766
|
-
"feature"
|
|
4834
|
+
"feature",
|
|
4835
|
+
"feature-state"
|
|
4767
4836
|
]
|
|
4768
4837
|
},
|
|
4769
4838
|
"property-type": "data-driven"
|
|
@@ -4796,7 +4865,8 @@
|
|
|
4796
4865
|
"interpolated": true,
|
|
4797
4866
|
"parameters": [
|
|
4798
4867
|
"zoom",
|
|
4799
|
-
"feature"
|
|
4868
|
+
"feature",
|
|
4869
|
+
"feature-state"
|
|
4800
4870
|
]
|
|
4801
4871
|
},
|
|
4802
4872
|
"property-type": "data-driven"
|
|
@@ -4829,7 +4899,8 @@
|
|
|
4829
4899
|
"interpolated": true,
|
|
4830
4900
|
"parameters": [
|
|
4831
4901
|
"zoom",
|
|
4832
|
-
"feature"
|
|
4902
|
+
"feature",
|
|
4903
|
+
"feature-state"
|
|
4833
4904
|
]
|
|
4834
4905
|
},
|
|
4835
4906
|
"property-type": "data-driven"
|
|
@@ -17,7 +17,7 @@ function getAngleWindowSize(shapedText, glyphSize, boxScale) {
|
|
|
17
17
|
return shapedText ? (3 / 5) * glyphSize * boxScale : 0;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function
|
|
20
|
+
function getShapedLabelLength(shapedText, shapedIcon) {
|
|
21
21
|
return Math.max(
|
|
22
22
|
shapedText ? shapedText.right - shapedText.left : 0,
|
|
23
23
|
shapedIcon ? shapedIcon.right - shapedIcon.left : 0
|
|
@@ -26,7 +26,7 @@ function getLabelLength(shapedText, shapedIcon) {
|
|
|
26
26
|
|
|
27
27
|
function getCenterAnchor(line, maxAngle, shapedText, shapedIcon, glyphSize, boxScale) {
|
|
28
28
|
const angleWindowSize = getAngleWindowSize(shapedText, glyphSize, boxScale);
|
|
29
|
-
const labelLength =
|
|
29
|
+
const labelLength = getShapedLabelLength(shapedText, shapedIcon) * boxScale;
|
|
30
30
|
|
|
31
31
|
let prevDistance = 0;
|
|
32
32
|
const centerDistance = getLineLength(line) / 2;
|
|
@@ -45,11 +45,10 @@ function getCenterAnchor(line, maxAngle, shapedText, shapedIcon, glyphSize, boxS
|
|
|
45
45
|
|
|
46
46
|
const anchor = new Anchor(x, y, b.angleTo(a), i);
|
|
47
47
|
anchor._round();
|
|
48
|
-
if (angleWindowSize
|
|
49
|
-
return;
|
|
48
|
+
if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {
|
|
49
|
+
return anchor;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
return anchor;
|
|
51
|
+
return;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
prevDistance += segmentDistance;
|
|
@@ -62,16 +61,16 @@ function getAnchors(line, spacing, maxAngle, shapedText, shapedIcon, glyphSize,
|
|
|
62
61
|
// on the line.
|
|
63
62
|
|
|
64
63
|
const angleWindowSize = getAngleWindowSize(shapedText, glyphSize, boxScale);
|
|
65
|
-
|
|
66
|
-
const labelLength =
|
|
64
|
+
const shapedLabelLength = getShapedLabelLength(shapedText, shapedIcon);
|
|
65
|
+
const labelLength = shapedLabelLength * boxScale;
|
|
67
66
|
|
|
68
67
|
// Is the line continued from outside the tile boundary?
|
|
69
68
|
const isLineContinued = line[0].x === 0 || line[0].x === tileExtent || line[0].y === 0 || line[0].y === tileExtent;
|
|
70
69
|
|
|
71
70
|
// Is the label long, relative to the spacing?
|
|
72
71
|
// If so, adjust the spacing so there is always a minimum space of `spacing / 4` between label edges.
|
|
73
|
-
if (spacing - labelLength
|
|
74
|
-
spacing = labelLength
|
|
72
|
+
if (spacing - labelLength < spacing / 4) {
|
|
73
|
+
spacing = labelLength + spacing / 4;
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
// Offset the first anchor by:
|
|
@@ -82,20 +81,10 @@ function getAnchors(line, spacing, maxAngle, shapedText, shapedIcon, glyphSize,
|
|
|
82
81
|
const fixedExtraOffset = glyphSize * 2;
|
|
83
82
|
|
|
84
83
|
const offset = !isLineContinued
|
|
85
|
-
? ((
|
|
84
|
+
? ((shapedLabelLength / 2 + fixedExtraOffset) * boxScale * overscaling) % spacing
|
|
86
85
|
: ((spacing / 2) * overscaling) % spacing;
|
|
87
86
|
|
|
88
|
-
return resample(
|
|
89
|
-
line,
|
|
90
|
-
offset,
|
|
91
|
-
spacing,
|
|
92
|
-
angleWindowSize,
|
|
93
|
-
maxAngle,
|
|
94
|
-
labelLength * boxScale,
|
|
95
|
-
isLineContinued,
|
|
96
|
-
false,
|
|
97
|
-
tileExtent
|
|
98
|
-
);
|
|
87
|
+
return resample(line, offset, spacing, angleWindowSize, maxAngle, labelLength, isLineContinued, false, tileExtent);
|
|
99
88
|
}
|
|
100
89
|
|
|
101
90
|
function resample(
|
package/src/symbol/mergelines.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const { Formatted } = require('../style-spec/expression/definitions/formatted');
|
|
2
|
+
|
|
1
3
|
module.exports = function (features) {
|
|
2
4
|
const leftIndex = new Map();
|
|
3
5
|
const rightIndex = new Map();
|
|
@@ -5,7 +7,8 @@ module.exports = function (features) {
|
|
|
5
7
|
let mergedIndex = 0;
|
|
6
8
|
|
|
7
9
|
for (let k = 0; k < features.length; k++) {
|
|
8
|
-
const { geometry, text } = features[k];
|
|
10
|
+
const { geometry, text: featureText } = features[k];
|
|
11
|
+
const text = featureText instanceof Formatted ? featureText.toString() : featureText;
|
|
9
12
|
|
|
10
13
|
if (!text) {
|
|
11
14
|
add(k);
|
package/src/symbol/placement.js
CHANGED
|
@@ -398,11 +398,17 @@ class Placement {
|
|
|
398
398
|
|
|
399
399
|
const layout = bucket.layers[0].layout;
|
|
400
400
|
const duplicateOpacityState = new JointOpacityState(null, 0, false, false, true);
|
|
401
|
+
const textAllowOverlap = layout.get('text-allow-overlap');
|
|
402
|
+
const iconAllowOverlap = layout.get('icon-allow-overlap');
|
|
403
|
+
// If allow-overlap is true, we can show symbols before placement runs on them
|
|
404
|
+
// But we have to wait for placement if we potentially depend on a paired icon/text
|
|
405
|
+
// with allow-overlap: false.
|
|
406
|
+
// See https://github.com/mapbox/mapbox-gl-js/issues/7032
|
|
401
407
|
const defaultOpacityState = new JointOpacityState(
|
|
402
408
|
null,
|
|
403
409
|
0,
|
|
404
|
-
layout.get('
|
|
405
|
-
layout.get('
|
|
410
|
+
textAllowOverlap && (iconAllowOverlap || !bucket.hasIconData() || layout.get('icon-optional')),
|
|
411
|
+
iconAllowOverlap && (textAllowOverlap || !bucket.hasTextData() || layout.get('text-optional')),
|
|
406
412
|
true
|
|
407
413
|
);
|
|
408
414
|
|
package/src/symbol/quads.js
CHANGED
|
@@ -105,7 +105,8 @@ function getGlyphQuads(anchor, shaping, layer, alongLine, feature, positions) {
|
|
|
105
105
|
|
|
106
106
|
for (let k = 0; k < positionedGlyphs.length; k++) {
|
|
107
107
|
const positionedGlyph = positionedGlyphs[k];
|
|
108
|
-
const
|
|
108
|
+
const glyphPositions = positions[positionedGlyph.fontStack];
|
|
109
|
+
const glyph = glyphPositions?.[positionedGlyph.glyph];
|
|
109
110
|
if (!glyph) continue;
|
|
110
111
|
|
|
111
112
|
const rect = glyph.rect;
|
|
@@ -115,7 +116,7 @@ function getGlyphQuads(anchor, shaping, layer, alongLine, feature, positions) {
|
|
|
115
116
|
const glyphPadding = 1.0;
|
|
116
117
|
const rectBuffer = GLYPH_PBF_BORDER + glyphPadding;
|
|
117
118
|
|
|
118
|
-
const halfAdvance = glyph.metrics.advance / 2;
|
|
119
|
+
const halfAdvance = (glyph.metrics.advance * positionedGlyph.scale) / 2;
|
|
119
120
|
|
|
120
121
|
const glyphOffset = alongLine ? [positionedGlyph.x + halfAdvance, positionedGlyph.y] : [0, 0];
|
|
121
122
|
|
|
@@ -123,10 +124,10 @@ function getGlyphQuads(anchor, shaping, layer, alongLine, feature, positions) {
|
|
|
123
124
|
? [0, 0]
|
|
124
125
|
: [positionedGlyph.x + halfAdvance + textOffset[0], positionedGlyph.y + textOffset[1]];
|
|
125
126
|
|
|
126
|
-
const x1 = glyph.metrics.left - rectBuffer - halfAdvance + builtInOffset[0];
|
|
127
|
-
const y1 = -glyph.metrics.top - rectBuffer + builtInOffset[1];
|
|
128
|
-
const x2 = x1 + rect.w;
|
|
129
|
-
const y2 = y1 + rect.h;
|
|
127
|
+
const x1 = (glyph.metrics.left - rectBuffer) * positionedGlyph.scale - halfAdvance + builtInOffset[0];
|
|
128
|
+
const y1 = (-glyph.metrics.top - rectBuffer) * positionedGlyph.scale + builtInOffset[1];
|
|
129
|
+
const x2 = x1 + rect.w * positionedGlyph.scale;
|
|
130
|
+
const y2 = y1 + rect.h * positionedGlyph.scale;
|
|
130
131
|
|
|
131
132
|
const tl = new Point(x1, y1);
|
|
132
133
|
const tr = new Point(x2, y1);
|