From 40fb661864ac6825a98441664db7baba86f98a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 27 Aug 2014 14:15:52 +0200 Subject: [PATCH 1/4] Add @api to ol.Sphere --- src/ol/sphere/sphere.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ol/sphere/sphere.js b/src/ol/sphere/sphere.js index bea2088fed..a3b4799efc 100644 --- a/src/ol/sphere/sphere.js +++ b/src/ol/sphere/sphere.js @@ -17,6 +17,7 @@ goog.require('goog.math'); /** * @constructor * @param {number} radius Radius. + * @api */ ol.Sphere = function(radius) { From f452f5545a8f971e019751dca2d413cfe5f465f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 29 Aug 2014 11:37:26 +0200 Subject: [PATCH 2/4] Add @classdesc to ol.Sphere --- src/ol/sphere/sphere.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ol/sphere/sphere.js b/src/ol/sphere/sphere.js index a3b4799efc..96a7b68c2b 100644 --- a/src/ol/sphere/sphere.js +++ b/src/ol/sphere/sphere.js @@ -15,6 +15,17 @@ goog.require('goog.math'); /** + * @classdesc + * Class to create objects that can be used with {@link + * ol.geom.Polygon.circular}. + * + * For example to create a sphere whose radius is equal to the semi-major + * axis of the WGS84 ellipsoid: + * + * ```js + * var wgs84Sphere= new ol.Sphere(6378137); + * ``` + * * @constructor * @param {number} radius Radius. * @api From ad8a1f5fb61e43e24c5d238fba591baf254315b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 29 Aug 2014 11:38:33 +0200 Subject: [PATCH 3/4] Make tissot example use ol.Sphere --- examples/tissot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/tissot.js b/examples/tissot.js index 1c0b74706f..13bcbaeb17 100644 --- a/examples/tissot.js +++ b/examples/tissot.js @@ -1,12 +1,12 @@ goog.require('ol.Feature'); goog.require('ol.Map'); +goog.require('ol.Sphere'); goog.require('ol.View'); goog.require('ol.geom.Polygon'); goog.require('ol.layer.Tile'); goog.require('ol.layer.Vector'); goog.require('ol.source.TileWMS'); goog.require('ol.source.Vector'); -goog.require('ol.sphere.WGS84'); var vectorSource = new ol.source.Vector(); @@ -33,11 +33,12 @@ var map = new ol.Map({ }) }); +var wgs84Sphere = new ol.Sphere(6378137); var radius = 800000; for (var x = -180; x < 180; x += 30) { for (var y = -90; y < 90; y += 30) { - var circle = ol.geom.Polygon.circular(ol.sphere.WGS84, [x, y], radius, 64); + var circle = ol.geom.Polygon.circular(wgs84Sphere, [x, y], radius, 64); vectorSource.addFeature(new ol.Feature(circle)); } } From f7f4c7b686a239ec769cae751eeee9fd54314ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Fri, 29 Aug 2014 11:39:39 +0200 Subject: [PATCH 4/4] Remove @api annotation from ol.sphere.WGS84 --- src/ol/sphere/wgs84sphere.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ol/sphere/wgs84sphere.js b/src/ol/sphere/wgs84sphere.js index f637baac54..19624fd6b2 100644 --- a/src/ol/sphere/wgs84sphere.js +++ b/src/ol/sphere/wgs84sphere.js @@ -7,6 +7,5 @@ goog.require('ol.Sphere'); * A sphere with radius equal to the semi-major axis of the WGS84 ellipsoid. * @const * @type {ol.Sphere} - * @api */ ol.sphere.WGS84 = new ol.Sphere(6378137);