flutter-maplibre-gl
flutter-maplibre-gl copied to clipboard
LineLayerProperties lineDasharray not working
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.
I faced the same error... any news?
On what platforms do you see this issue?