File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -905,13 +905,13 @@ class Style {
905905 }
906906 }
907907 style . icon . source = sprites . source ;
908- style . icon . size = readVectorProperty ( layer . layout [ 'icon-size' ] ) || 1 ;
908+ style . icon . size = readVectorProperty ( layer . layout [ 'icon-size' ] ) ?? 1 ;
909909 const { color, opacity } = rgba2rgb ( readVectorProperty ( layer . paint [ 'icon-color' ] , { type : 'color' } ) ) ;
910910 // https://docs.mapbox.com/style-spec/reference/layers/#paint-symbol-icon-color
911911 if ( iconImg . sdf ) {
912912 style . icon . color = color ;
913913 }
914- style . icon . opacity = readVectorProperty ( layer . paint [ 'icon-opacity' ] ) || ( opacity !== undefined && opacity ) ;
914+ style . icon . opacity = readVectorProperty ( layer . paint [ 'icon-opacity' ] ) ?? ( opacity !== undefined && opacity ) ;
915915 } catch ( err ) {
916916 err . message = `VTlayer '${ layer . id } ': argument sprites must not be null when using layer.layout['icon-image']` ;
917917 throw err ;
You can’t perform that action at this time.
0 commit comments