Add more styling to GeoJSON example
This commit is contained in:
@@ -11,6 +11,16 @@ goog.require('ol.style.DefaultStyleFunction');
|
|||||||
|
|
||||||
var styleFunction = function(feature) {
|
var styleFunction = function(feature) {
|
||||||
switch (feature.getGeometry().getType()) {
|
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:
|
case ol.geom.GeometryType.MULTI_LINE_STRING:
|
||||||
return {
|
return {
|
||||||
stroke: {
|
stroke: {
|
||||||
@@ -23,6 +33,9 @@ var styleFunction = function(feature) {
|
|||||||
stroke: {
|
stroke: {
|
||||||
color: 'yellow',
|
color: 'yellow',
|
||||||
width: 1
|
width: 1
|
||||||
|
},
|
||||||
|
fill: {
|
||||||
|
color: 'rgba(255, 255, 0, 0.1)'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user