diff --git a/examples/geojson.js b/examples/geojson.js index 19a9572977..13d7c0f70d 100644 --- a/examples/geojson.js +++ b/examples/geojson.js @@ -2,6 +2,7 @@ goog.require('ol.Feature'); goog.require('ol.Map'); goog.require('ol.RendererHint'); goog.require('ol.View2D'); +goog.require('ol.geom.Circle'); goog.require('ol.layer.Tile'); goog.require('ol.layer.Vector'); goog.require('ol.source.GeoJSON'); @@ -71,6 +72,15 @@ var styles = { color: 'magenta' }) }) + })], + 'Circle': [new ol.style.Style({ + stroke: new ol.style.Stroke({ + color: 'red', + width: 2 + }), + fill: new ol.style.Fill({ + color: 'rgba(255,0,0,0.2)' + }) })] }; @@ -164,6 +174,8 @@ var vectorSource = new ol.source.GeoJSON( } })); +vectorSource.addFeature(new ol.Feature(new ol.geom.Circle([5e6, 7e6], 1e6))); + var vectorLayer = new ol.layer.Vector({ source: vectorSource, styleFunction: styleFunction