Created
June 13, 2019 14:54
-
-
Save crazycapivara/5efd362173604e25b985ce1cf68f2dad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getStyle(feature, resolution) { | |
var color = "green"; | |
const name = feature.get("name"); | |
if (name.startsWith("A ")) color = "blue"; | |
else if (name.startsWith("L ")) color = "red"; | |
return new ol.style.Style({ | |
stroke: new ol.style.Stroke({ | |
color: color, | |
width: 2 | |
}) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment