Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var options = {
style:function(feature){
if(!feature.properties){
return;
}
var out = {};
if(feature.properties.stroke){
out.color = feature.properties.stroke;
}
if(feature.properties["fill-opacty"]){
out.opacity = feature.properties["stroke-opacity"];
}
if(feature.properties["fill-opacty"] === 0){
out.stroke = false;
}else if (feature.properties["stroke-width"]){
out.weight = feature.properties["stroke-width"];
}
if(feature.properties.fill){
out.fillColor = feature.properties.fill;
}
if(feature.properties["fill-opacty"] === 0){
out.fill = false;
}else if(feature.properties["fill-opacty"]){
out.fillOpacity = feature.properties["fill-opacty"];
}
return out;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment