Merge pull request #1514 from twpayne/vector-api-circle

[vector-api] Add ol.geom.Circle
This commit is contained in:
Tom Payne
2014-01-14 03:46:48 -08:00
13 changed files with 601 additions and 13 deletions
+12
View File
@@ -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
+4
View File
@@ -1,3 +1,7 @@
// FIXME use an ol.geom.Circle to display a circle with accuracy
// FIXME this circle will need to compensate for the pointResolution of the
// FIXME EPSG:3857 projection
goog.require('ol.Geolocation');
goog.require('ol.Map');
goog.require('ol.Overlay');