Closed mcif2 closed 3 months ago
The Styles property is for tile layers only. To apply a style for vector layers you can set style using Style property and assigning a StyleOptions object: Style="@(new StyleOptions() { Stroke = new StyleOptions.StrokeOptions { Color = "red", Width = 3 }})"
. A full example is in GeoJsonDemo.razor
or using the FlatStyle property with a Dictionary of styles (documented in openlayers API). You find an example in VectorLayersDemo,.razor.
Another option would be to implement a call back method for dynamic styles but this works only in WASM blazor scenarios.
Thank you.
Hello. I have an issue when representing VectorGeoJSON layers. All the layers display with the same style I have tried setting a value for the Styles property without any success. This is the syntax I am using for the Styles property upon layer creation in the C# code
I think the Styles string I am using might not be correct. This is because no matter what I type there, it will always display the same: blue border surrounding and white background.
What would be the format for that string?
I have not seen using this property being used for vectorGeoJSON layers in your application, hence the question.
In case this is not the right way to set the layer style, what would be the correct way to customize layer style?
Thanks in advance.
Best regards