static generateDashedStyleLayers(line, property) {
    const styleLayers = [];
    const linesLabels = line.split(',');
    linesLabels.forEach((label, index) => {
      const color = lines[label]?.color;
      if (!color) {
        // eslint-disable-next-line no-console
        console.log(
          `There is no color defined for ${label}, available labels are `,
          lines,
        );
        return;
      }
      styleLayers.push({
        id: `${line}${index}`,
        source: sourceId,
        'source-layer': sourceLayer,
        type: 'line',
        filter: ['==', line, ['get', property]],
        paint: {
          'line-color': color,
          'line-width': 4,
          'line-dasharray': [(linesLabels.length - index) * 2, index * 2],
        },
      });
    });
    return styleLayers;
  }
// Generate dashed styles for features with multiple lines in the label.
Generate dashed styles for features with multiple lines in the label.
Generate dashed styles for features with multiple lines in the label .
static generateDashedStyleLayers(line, property) {
    const styleLayers = [];
    const linesLabels = line.split(',');
    linesLabels.forEach((label, index) => {
      const color = lines[label]?.color;
      if (!color) {
        console.log(
          `There is no color defined for ${label}, available labels are `,
          lines,
        );
        return;
      }
      styleLayers.push({
        id: `${line}${index}`,
        source: sourceId,
        'source-layer': sourceLayer,
        type: 'line',
        filter: ['==', line, ['get', property]],
        paint: {
          'line-color': color,
          'line-width': 4,
          'line-dasharray': [(linesLabels.length - index) * 2, index * 2],
        },
      });
    });
    return styleLayers;
  }
static generateDashedStyleLayers ( line , property ) { const styleLayers = [ ] ; const linesLabels = line . split ( ',' ) ; linesLabels . forEach ( ( label , index ) => { const color = lines [ label ] ?. color ; if ( ! color ) { console . log ( ` ${ label } ` , lines , ) ; return ; } styleLayers . push ( { id : ` ${ line } ${ index } ` , source : sourceId , 'source-layer' : sourceLayer , type : 'line' , filter : [ '==' , line , [ 'get' , property ] ] , paint : { 'line-color' : color , 'line-width' : 4 , 'line-dasharray' : [ ( linesLabels . length - index ) * 2 , index * 2 ] , } , } ) ; } ) ; return styleLayers ; }
Generate dashed styles for features with multiple lines in the label.
Generate dashed styles for features with multiple lines in the label .
// eslint-disable-next-line no-console