From a94f02e463803cc32cb20309caf7d449b3127cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 23 Sep 2014 09:41:03 +0200 Subject: [PATCH 1/2] Revert "Function circular renamed to createCircularOnSphere" This reverts commit ac8e7e16c2bd9badd8e3bd3bd302547ec74165b6. --- examples/tissot.js | 3 +-- src/ol/geom/polygon.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/tissot.js b/examples/tissot.js index bde3061997..af92b5cb32 100644 --- a/examples/tissot.js +++ b/examples/tissot.js @@ -63,8 +63,7 @@ var radius = 800000; var x, y; for (x = -180; x < 180; x += 30) { for (y = -90; y < 90; y += 30) { - var circle4326 = ol.geom.Polygon.createCircularOnSphere( - wgs84Sphere, [x, y], radius, 64); + var circle4326 = ol.geom.Polygon.circular(wgs84Sphere, [x, y], radius, 64); var circle3857 = circle4326.clone().transform('EPSG:4326', 'EPSG:3857'); vectorLayer4326.getSource().addFeature(new ol.Feature(circle4326)); vectorLayer3857.getSource().addFeature(new ol.Feature(circle3857)); diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index 117edbc54a..22fb475fc5 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -359,8 +359,7 @@ ol.geom.Polygon.prototype.setFlatCoordinates = * @return {ol.geom.Polygon} The "circular" polygon. * @api stable */ -ol.geom.Polygon.createCircularOnSphere = - function(sphere, center, radius, opt_n) { +ol.geom.Polygon.circular = function(sphere, center, radius, opt_n) { var n = goog.isDef(opt_n) ? opt_n : 32; /** @type {Array.} */ var flatCoordinates = []; From 6b2a703b35ffce3506765dcfdc4ee018e2645183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 23 Sep 2014 09:43:13 +0200 Subject: [PATCH 2/2] Use ol.geom.Polygon.circular in ol.Geolocation --- src/ol/geolocation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index 8ccd4fb09b..d5cf49ac84 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -169,7 +169,7 @@ ol.Geolocation.prototype.positionChange_ = function(position) { this.set(ol.GeolocationProperty.POSITION, projectedPosition); this.set(ol.GeolocationProperty.SPEED, goog.isNull(coords.speed) ? undefined : coords.speed); - var geometry = ol.geom.Polygon.createCircularOnSphere( + var geometry = ol.geom.Polygon.circular( ol.sphere.WGS84, this.position_, coords.accuracy); geometry.applyTransform(this.transform_); this.set(ol.GeolocationProperty.ACCURACY_GEOMETRY, geometry);