Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineLayerProperties lineDasharray not working #148

Open
JanikoNaber opened this issue Aug 19, 2022 · 3 comments · May be fixed by #481
Open

LineLayerProperties lineDasharray not working #148

JanikoNaber opened this issue Aug 19, 2022 · 3 comments · May be fixed by #481
Labels
bug Something isn't working
Milestone

Comments

@JanikoNaber
Copy link

Hi all,
I'm trying to add two lines with a line-dasharray property as a new source.

_mapController.addSource(
      "off-piste-section",
      GeojsonSourceProperties(
        data:
          {  "type": "FeatureCollection",
          "crs": { "type": "name", "properties": { "name": "off-piste-section" } },
          "features": [
          { "type": "Feature", "properties": { "id": "off-piste-section-line1"},  
            "geometry": { "type": "LineString", 
            "coordinates": [ [-151.2484, 61.2705, 0 ], [0, 0, 0 ]] } },
          { "type": "Feature", "properties": { "id": "off-piste-section-line2" }, 
            "geometry": { "type": "LineString", 
            "coordinates": [ [180.2484, 60.2705, 0 ], [0, 0, 0 ]], } },        
          ]
        },
      )
    ).then((value) {
      _mapController.addLayer(
        "off-piste-section",
        "off-piste-section-line",
        LineLayerProperties(
          lineWidth: 6,
          lineColor: "#de0202",
          lineOpacity: 0.9,
          lineCap: "round",
          lineJoin: "round",  
          lineDasharray: [5, 2]
        ));
    });

Adding the source works fine and also all other attributes are working. Except the lineDasharry attribute.
The following error is given by the console:
Error setting property: line-dasharray value must be an array of numbers

Adding the same layer in the style.json, works fine.

    {
      "id": "off-piste-section-line",
      "type": "line",
      "source": "off-piste-section",
      "paint": {
        "line-dasharray": [5, 2],
        "line-width": 6,
        "line-opacity": 0.9,
        "line-color": "rgba(222, 2, 2, 1)"
      }
    }

Looks like an error in the flutter binding. Maybe just a small issue.

@Nonnis-M
Copy link

I faced the same error... any news?

@m0nac0
Copy link
Collaborator

m0nac0 commented Mar 19, 2023

On what platforms do you see this issue?

@JulianBissekkou JulianBissekkou added the bug Something isn't working label Jun 29, 2023
@gabbopalma
Copy link
Contributor

Hi, you can see the "fix" for this on this issue. Just use expression instead of a List.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
6 participants