diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 1654ddcb60..624b3ee767 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -1548,7 +1548,7 @@ declare namespace mapboxgl { 'line-offset-transition'?: Transition; 'line-blur'?: number | StyleFunction | Expression; 'line-blur-transition'?: Transition; - 'line-dasharray'?: number[]; + 'line-dasharray'?: number[] | Expression; 'line-dasharray-transition'?: Transition; 'line-pattern'?: string | Expression; 'line-pattern-transition'?: Transition; @@ -1579,12 +1579,12 @@ declare namespace mapboxgl { 'text-pitch-alignment'?: 'map' | 'viewport' | 'auto'; 'text-rotation-alignment'?: 'map' | 'viewport' | 'auto'; 'text-field'?: string | StyleFunction | Expression; - 'text-font'?: string | string[]; + 'text-font'?: string | string[] | Expression; 'text-size'?: number | StyleFunction | Expression; 'text-max-width'?: number | Expression; 'text-line-height'?: number | Expression; 'text-letter-spacing'?: number | Expression; - 'text-justify'?: 'left' | 'center' | 'right'; + 'text-justify'?: 'left' | 'center' | 'right' | Expression; 'text-anchor'?: Anchor | StyleFunction | Expression; 'text-max-angle'?: number | Expression; 'text-rotate'?: number | StyleFunction | Expression; diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index fda8083d88..ed5509ed70 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -170,7 +170,28 @@ map.on('load', function() { }, "paint": { "line-color": "#888", - "line-width": 8 + "line-width": 8, + "line-dasharray": [ + "step", + [ + "zoom" + ], + [ + "literal", + [ + 1, + 0 + ] + ], + 15, + [ + "literal", + [ + 1.75, + 1 + ] + ] + ] } }); @@ -399,7 +420,75 @@ var mapStyle = { "layout": { "text-transform": "uppercase", "text-field": "{name_en}", - "text-font": ["DIN Offc Pro Bold", "Arial Unicode MS Bold"], + "text-font": [ + "step", + [ + "zoom" + ], + [ + "literal", + [ + "DIN Offc Pro Regular", + "Arial Unicode MS Regular" + ] + ], + 8, + [ + "step", + [ + "get", + "symbolrank" + ], + [ + "literal", + [ + "DIN Offc Pro Medium", + "Arial Unicode MS Regular" + ] + ], + 11, + [ + "literal", + [ + "DIN Offc Pro Regular", + "Arial Unicode MS Regular" + ] + ] + ] + ], + "text-justify": [ + "step", + [ + "zoom" + ], + [ + "match", + [ + "get", + "text_anchor" + ], + [ + "bottom", + "top" + ], + "center", + [ + "left", + "bottom-left", + "top-left" + ], + "left", + [ + "right", + "bottom-right", + "top-right" + ], + "right", + "center" + ], + 8, + "center" + ], "text-letter-spacing": 0.15, "text-max-width": 7, "text-size": {"stops": [[4, 10], [6, 14]]}