@@ -33,7 +33,7 @@ export const viewStyleNames = [
3333export function setStyleDefaultFont ( font ) { labelFont = [ font ] }
3434
3535export function initializeViewStyles ( sourceName , heatmap = false ) {
36- console . log ( 'Initializing view styles for source ' + sourceName )
36+ // console.log('Initializing view styles for source ' + sourceName)
3737 removeStyleLayers ( sourceName )
3838 viewStyleNames . forEach ( styleName => {
3939 map . addLayer ( setSource ( styles ( ) [ styleName ] , sourceName ) )
@@ -403,12 +403,12 @@ function textLayerStyles(mode) {
403403 ] ,
404404 'text-size' : labelSize ,
405405 'text-font' : labelFont ,
406- 'text-letter-spacing' : [ 'get' , 'label-letter-spacing' ] ,
406+ 'text-letter-spacing' : [ 'coalesce' , [ ' get', 'label-letter-spacing' ] , 0 ] ,
407407 'text-anchor' : 'top' , // text under point
408408 // TODO: set this to 0 for polygons, needs 'geometry-type' implementation: https://github.com/maplibre/maplibre-style-spec/discussions/536
409409 'text-offset' : labelOffset ,
410410 'text-justify' : [ 'get' , 'label-justify' ] ,
411- 'text-max-width' : [ 'get' , 'label-max-width' ] ,
411+ 'text-max-width' : [ 'coalesce' , [ ' get', 'label-max-width' ] , 10 ] ,
412412 'text-line-height' : 1.6 , // no dynamic value possible
413413 // TODO: sort keys on text are ascending, on symbols descending???
414414 'symbol-sort-key' : [ '-' , 1000 , sortKey ]
@@ -491,8 +491,8 @@ export function styles () {
491491 minZoomFilter ] ,
492492 paint : {
493493 'fill-extrusion-color' : styleProp ( [ 'fill-extrusion-color' , 'user_fill-extrusion-color' , 'fill' , 'user_fill' ] , featureColor ) ,
494- 'fill-extrusion-height' : [ 'to-number' , styleProp ( [ 'fill-extrusion-height' , 'user_fill-extrusion-height' ] ) ] ,
495- 'fill-extrusion-base' : [ 'to-number' , styleProp ( [ 'fill-extrusion-base' , 'user_fill-extrusion-base' ] ) ] ,
494+ 'fill-extrusion-height' : [ 'to-number' , styleProp ( [ 'fill-extrusion-height' , 'user_fill-extrusion-height' ] , 0 ) ] ,
495+ 'fill-extrusion-base' : [ 'to-number' , styleProp ( [ 'fill-extrusion-base' , 'user_fill-extrusion-base' ] , 0 ) ] ,
496496 // opacity does not support data expressions, it's a constant per layer
497497 'fill-extrusion-opacity' : 0.9
498498 }
@@ -551,7 +551,7 @@ export function styles () {
551551 layout : {
552552 'line-join' : 'round' ,
553553 'line-cap' : 'round' ,
554- 'line-sort-key' : [ 'to-number' , [ 'get' , 'sort-key' ] ]
554+ 'line-sort-key' : sortKey
555555 } ,
556556 paint : {
557557 'line-color' : lineColor ,
0 commit comments