From c95ffe381bbf4c3b7a98b983fe5fe37ef1d6e4de Mon Sep 17 00:00:00 2001 From: Antoine Abt Date: Thu, 6 Feb 2014 15:27:43 +0100 Subject: [PATCH] Render style for Point inside GeometryCollection. --- examples/modify-features.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/modify-features.js b/examples/modify-features.js index 0a508d4dea..21b4727c0c 100644 --- a/examples/modify-features.js +++ b/examples/modify-features.js @@ -26,7 +26,7 @@ var raster = new ol.layer.Tile({ var image = new ol.style.Circle({ radius: 5, fill: null, - stroke: new ol.style.Stroke({color: 'red', width: 1}) + stroke: new ol.style.Stroke({color: 'orange', width: 2}) }); var styleFunction = function(feature) { @@ -49,7 +49,7 @@ var styleFunction = function(feature) { return [new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'green', - width: 1 + width: 3 }) })]; case 'MultiPolygon': @@ -66,11 +66,12 @@ var styleFunction = function(feature) { return [new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'red', - width: 2 + width: 3 }), fill: new ol.style.Fill({ color: 'rgba(255, 0, 0, 0.1)' - }) + }), + image: image })]; } }; @@ -188,8 +189,6 @@ var overlayStyle = (function() { ]; styles[ol.geom.GeometryType.MULTI_POLYGON] = styles[ol.geom.GeometryType.POLYGON]; - styles[ol.geom.GeometryType.GEOMETRY_COLLECTION] = - styles[ol.geom.GeometryType.POLYGON]; styles[ol.geom.GeometryType.LINE_STRING] = [ new ol.style.Style({ @@ -226,6 +225,10 @@ var overlayStyle = (function() { styles[ol.geom.GeometryType.MULTI_POINT] = styles[ol.geom.GeometryType.POINT]; + styles[ol.geom.GeometryType.GEOMETRY_COLLECTION] = + styles[ol.geom.GeometryType.POLYGON].concat( + styles[ol.geom.GeometryType.POINT]); + return function(feature, resolution) { return styles[feature.getGeometry().getType()]; };