From a03bf6d44719e0ea45f30346b2c7957e92f2b7d2 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Wed, 11 Dec 2013 17:44:28 +0100 Subject: [PATCH] Add GeometryCollection to geojson example --- examples/geojson.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/examples/geojson.js b/examples/geojson.js index 70ae39bcc9..911707926a 100644 --- a/examples/geojson.js +++ b/examples/geojson.js @@ -52,6 +52,18 @@ var styles = { fill: new ol.style.Fill({ color: 'rgba(0, 0, 255, 0.1)' }) + })], + 'GeometryCollection': [new ol.style.Style({ + stroke: new ol.style.Stroke({ + color: 'magenta', + width: 2 + }), + fill: new ol.style.Fill({ + color: 'magenta' + }), + image: ol.shape.renderCircle(10, null, new ol.style.Stroke({ + color: 'magenta' + })) })] }; @@ -120,6 +132,26 @@ var vectorSource = new ol.source.GeoJSON( [[[1e6, 6e6], [1e6, 8e6], [3e6, 8e6], [3e6, 6e6]]] ] } + }, + { + 'type': 'Feature', + 'geometry': { + 'type': 'GeometryCollection', + 'geometries': [ + { + 'type': 'LineString', + 'coordinates': [[-5e6, -5e6], [0e6, -5e6]] + }, + { + 'type': 'Point', + 'coordinates': [4e6, -5e6] + }, + { + 'type': 'Polygon', + 'coordinates': [[[1e6, -6e6], [2e6, -4e6], [3e6, -6e6]]] + } + ] + } } ] }