Skip to content

Instantly share code, notes, and snippets.

@calvinmetcalf
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calvinmetcalf/8844266 to your computer and use it in GitHub Desktop.
Save calvinmetcalf/8844266 to your computer and use it in GitHub Desktop.
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