Don't rely on ol.geom.Type in GeoJSON example

This commit is contained in:
Tom Payne
2013-11-12 17:50:03 +01:00
parent 8a6242be88
commit 67522815eb
+4 -4
View File
@@ -15,11 +15,11 @@ goog.require('ol.style.DefaultStyleFunction');
var image = ol.shape.renderCircle(5, null, {color: 'red', width: 1}); var image = ol.shape.renderCircle(5, null, {color: 'red', width: 1});
var styleFunction = function(feature) { var styleFunction = function(feature) {
switch (feature.getGeometry().getType()) { switch (feature.getGeometry().getType()) {
case ol.geom.Type.POINT: case 'Point':
return { return {
image: image image: image
}; };
case ol.geom.Type.POLYGON: case 'Polygon':
return { return {
stroke: { stroke: {
color: 'blue', color: 'blue',
@@ -29,14 +29,14 @@ var styleFunction = function(feature) {
color: 'rgba(0, 0, 255, 0.1)' color: 'rgba(0, 0, 255, 0.1)'
} }
}; };
case ol.geom.Type.MULTI_LINE_STRING: case 'MultiLineString':
return { return {
stroke: { stroke: {
color: 'green', color: 'green',
width: 1 width: 1
} }
}; };
case ol.geom.Type.MULTI_POLYGON: case 'MultiPolygon':
return { return {
stroke: { stroke: {
color: 'yellow', color: 'yellow',