Add more styling to GeoJSON example

This commit is contained in:
Tom Payne
2013-11-08 23:09:23 +01:00
parent fef9ec155b
commit 8dab000db1

View File

@@ -11,6 +11,16 @@ goog.require('ol.style.DefaultStyleFunction');
var styleFunction = function(feature) {
switch (feature.getGeometry().getType()) {
case ol.geom.GeometryType.POLYGON:
return {
stroke: {
color: 'blue',
width: 3
},
fill: {
color: 'rgba(0, 0, 255, 0.1)'
}
};
case ol.geom.GeometryType.MULTI_LINE_STRING:
return {
stroke: {
@@ -23,6 +33,9 @@ var styleFunction = function(feature) {
stroke: {
color: 'yellow',
width: 1
},
fill: {
color: 'rgba(255, 255, 0, 0.1)'
}
};
default: