Add MultiPolygon to GeoJSON example

This commit is contained in:
Tom Payne
2013-11-08 16:38:22 +01:00
parent 53d1171d14
commit 311ee5222d

View File

@@ -17,6 +17,13 @@ var styleFunction = function(feature) {
width: 1
}
};
case ol.geom.GeometryType.MULTI_POLYGON:
return {
stroke: {
color: 'yellow',
width: 1
}
};
default:
return ol.style.DefaultStyleFunction(feature);
}
@@ -66,6 +73,17 @@ var geoJSONSource = new ol.source.GeoJSON(
[[-7.5e5, 1e6], [7.5e5, 1e6]]
]
}
},
{
'type': 'Feature',
'geometry': {
'type': 'MultiPolygon',
'coordinates': [
[[[-5e6, 6e6], [-5e6, 8e6], [-3e6, 8e6], [-3e6, 6e6]]],
[[[-2e6, 6e6], [-2e6, 8e6], [0e6, 8e6], [0e6, 6e6]]],
[[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [3e6, 6e6]]]
]
}
}
]
}