From 4f9968d106cfca1a87e7eba90e876c223869105c Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 2 May 2014 09:21:56 -0600 Subject: [PATCH 1/6] Rename transform to applyTransform for geometries --- src/ol/geolocation.js | 2 +- src/ol/geom/circle.js | 2 +- src/ol/geom/geometry.js | 3 ++- src/ol/geom/geometrycollection.js | 4 ++-- src/ol/geom/simplegeometry.js | 2 +- src/ol/interaction/draganddropinteraction.js | 2 +- src/ol/source/formatvectorsource.js | 2 +- test/spec/ol/geom/circle.test.js | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index ecbf7e6669..bc7fe3a501 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -187,7 +187,7 @@ ol.Geolocation.prototype.positionChange_ = function(position) { this.set(ol.GeolocationProperty.SPEED, goog.isNull(coords.speed) ? undefined : coords.speed); var geometry = ol.sphere.WGS84.circle(this.position_, coords.accuracy); - geometry.transform(this.transform_); + geometry.applyTransform(this.transform_); this.set(ol.GeolocationProperty.ACCURACY_GEOMETRY, geometry); this.dispatchChangeEvent(); }; diff --git a/src/ol/geom/circle.js b/src/ol/geom/circle.js index 10efe0cefb..a8762facf1 100644 --- a/src/ol/geom/circle.js +++ b/src/ol/geom/circle.js @@ -217,4 +217,4 @@ ol.geom.Circle.prototype.setRadius = function(radius) { /** * @inheritDoc */ -ol.geom.Circle.prototype.transform = goog.abstractMethod; +ol.geom.Circle.prototype.applyTransform = goog.abstractMethod; diff --git a/src/ol/geom/geometry.js b/src/ol/geom/geometry.js index 613de8949d..664ab20a18 100644 --- a/src/ol/geom/geometry.js +++ b/src/ol/geom/geometry.js @@ -159,10 +159,11 @@ ol.geom.Geometry.prototype.getType = goog.abstractMethod; /** + * Apply a transform function to the geometry. Modifies the geometry in place. * @function * @param {ol.TransformFunction} transformFn Transform. */ -ol.geom.Geometry.prototype.transform = goog.abstractMethod; +ol.geom.Geometry.prototype.applyTransform = goog.abstractMethod; /** diff --git a/src/ol/geom/geometrycollection.js b/src/ol/geom/geometrycollection.js index f64ebf396a..a1ea40b2a7 100644 --- a/src/ol/geom/geometrycollection.js +++ b/src/ol/geom/geometrycollection.js @@ -247,11 +247,11 @@ ol.geom.GeometryCollection.prototype.setGeometriesArray = function(geometries) { /** * @inheritDoc */ -ol.geom.GeometryCollection.prototype.transform = function(transformFn) { +ol.geom.GeometryCollection.prototype.applyTransform = function(transformFn) { var geometries = this.geometries_; var i, ii; for (i = 0, ii = geometries.length; i < ii; ++i) { - geometries[i].transform(transformFn); + geometries[i].applyTransform(transformFn); } this.dispatchChangeEvent(); }; diff --git a/src/ol/geom/simplegeometry.js b/src/ol/geom/simplegeometry.js index 24adb6b983..8f4555800d 100644 --- a/src/ol/geom/simplegeometry.js +++ b/src/ol/geom/simplegeometry.js @@ -244,7 +244,7 @@ ol.geom.SimpleGeometry.prototype.setLayout = * @inheritDoc * @todo api */ -ol.geom.SimpleGeometry.prototype.transform = function(transformFn) { +ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) { if (!goog.isNull(this.flatCoordinates)) { transformFn(this.flatCoordinates, this.flatCoordinates, this.stride); this.dispatchChangeEvent(); diff --git a/src/ol/interaction/draganddropinteraction.js b/src/ol/interaction/draganddropinteraction.js index a1a31bc010..5b76294a4a 100644 --- a/src/ol/interaction/draganddropinteraction.js +++ b/src/ol/interaction/draganddropinteraction.js @@ -118,7 +118,7 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, result) { var feature = readFeatures[j]; var geometry = feature.getGeometry(); if (!goog.isNull(geometry)) { - geometry.transform(transform); + geometry.applyTransform(transform); } features.push(feature); } diff --git a/src/ol/source/formatvectorsource.js b/src/ol/source/formatvectorsource.js index 7cf28860b7..e6f1fd2242 100644 --- a/src/ol/source/formatvectorsource.js +++ b/src/ol/source/formatvectorsource.js @@ -125,7 +125,7 @@ ol.source.FormatVector.prototype.readFeatures = function(source) { var feature = features[i]; var geometry = feature.getGeometry(); if (!goog.isNull(geometry)) { - geometry.transform(transform); + geometry.applyTransform(transform); } } } diff --git a/test/spec/ol/geom/circle.test.js b/test/spec/ol/geom/circle.test.js index 3ae6298440..bd1bee2802 100644 --- a/test/spec/ol/geom/circle.test.js +++ b/test/spec/ol/geom/circle.test.js @@ -207,7 +207,7 @@ describe('ol.geom.Circle', function() { it('throws an exception', function() { expect(function() { - circle.transform(ol.proj.identityTransform); + circle.applyTransform(ol.proj.identityTransform); }).to.throwException(); }); From a4f1efbddb8c0764d7406013f93f55369fca587e Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 2 May 2014 09:58:23 -0600 Subject: [PATCH 2/6] Add tests for geometry applyTransform method --- test/spec/ol/geom/multipoint.test.js | 38 ++++++++++++++++++++++++++++ test/spec/ol/geom/point.test.js | 36 ++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/test/spec/ol/geom/multipoint.test.js b/test/spec/ol/geom/multipoint.test.js index 26535273c6..c8c2ae877d 100644 --- a/test/spec/ol/geom/multipoint.test.js +++ b/test/spec/ol/geom/multipoint.test.js @@ -192,6 +192,44 @@ describe('ol.geom.MultiPoint', function() { }); + describe('#applyTransform()', function() { + + var multi, transform; + beforeEach(function() { + multi = new ol.geom.MultiPoint([[1, 2], [3, 4]]); + transform = sinon.spy(); + }); + + it('calls a transform function', function() { + multi.applyTransform(transform); + expect(transform.calledOnce).to.be(true); + var args = transform.firstCall.args; + expect(args).to.have.length(3); + + expect(args[0]).to.be(multi.getFlatCoordinates()); // input coords + expect(args[1]).to.be(multi.getFlatCoordinates()); // output coords + expect(args[2]).to.be(2); // dimension + }); + + it('allows for modification of coordinates', function() { + var mod = function(input, output, dimension) { + var copy = input.slice(); + for (var i = 0, ii = copy.length; i < ii; i += dimension) { + output[i] = copy[i + 1]; + output[i + 1] = copy[i]; + } + }; + multi.applyTransform(mod); + expect(multi.getCoordinates()).to.eql([[2, 1], [4, 3]]); + }); + + it('returns undefined', function() { + var got = multi.applyTransform(transform); + expect(got).to.be(undefined); + }); + + }); + }); diff --git a/test/spec/ol/geom/point.test.js b/test/spec/ol/geom/point.test.js index 84b01276c3..d7fa67dbf2 100644 --- a/test/spec/ol/geom/point.test.js +++ b/test/spec/ol/geom/point.test.js @@ -106,6 +106,42 @@ describe('ol.geom.Point', function() { }); + describe('#applyTransform()', function() { + + var point, transform; + beforeEach(function() { + point = new ol.geom.Point([1, 2]); + transform = sinon.spy(); + }); + + it('calls a transform function', function() { + point.applyTransform(transform); + expect(transform.calledOnce).to.be(true); + var args = transform.firstCall.args; + expect(args).to.have.length(3); + + expect(args[0]).to.be(point.getFlatCoordinates()); // input coords + expect(args[1]).to.be(point.getFlatCoordinates()); // output coords + expect(args[2]).to.be(2); // dimension + }); + + it('allows for modification of coordinates', function() { + var mod = function(input, output, dimension) { + var copy = input.slice(); + output[1] = copy[0]; + output[0] = copy[1]; + }; + point.applyTransform(mod); + expect(point.getCoordinates()).to.eql([2, 1]); + }); + + it('returns undefined', function() { + var got = point.applyTransform(transform); + expect(got).to.be(undefined); + }); + + }); + }); From 015aab8af34a6a1c57aa3e659b12dceeaa712315 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 2 May 2014 10:13:28 -0600 Subject: [PATCH 3/6] Rename ol.extent.transform to ol.extent.applyTransform This gives more consistency with ol.proj.applyTransform, allowing us to add a more convenient ol.extent.transform method that takes projection-like arguments. --- src/ol/extent.js | 6 ++++-- src/ol/source/bingmapssource.js | 3 ++- src/ol/source/tilejsonsource.js | 2 +- test/spec/ol/extent.test.js | 8 +++++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/ol/extent.js b/src/ol/extent.js index 3e85f5a04e..fc3ec13806 100644 --- a/src/ol/extent.js +++ b/src/ol/extent.js @@ -714,13 +714,15 @@ ol.extent.touches = function(extent1, extent2) { /** + * Apply a transform function to the extent. * @param {ol.Extent} extent Extent. - * @param {ol.TransformFunction} transformFn Transform function. + * @param {ol.TransformFunction} transformFn Transform function. Called with + * [minX, minY, maxX, maxY] extent coordinates. * @param {ol.Extent=} opt_extent Destination extent. * @return {ol.Extent} Extent. * @todo api */ -ol.extent.transform = function(extent, transformFn, opt_extent) { +ol.extent.applyTransform = function(extent, transformFn, opt_extent) { var coordinates = [ extent[0], extent[1], extent[0], extent[3], diff --git a/src/ol/source/bingmapssource.js b/src/ol/source/bingmapssource.js index 457eb1a489..f2aee053fd 100644 --- a/src/ol/source/bingmapssource.js +++ b/src/ol/source/bingmapssource.js @@ -139,7 +139,8 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = var maxZ = coverageArea.zoomMax; var bbox = coverageArea.bbox; var epsg4326Extent = [bbox[1], bbox[0], bbox[3], bbox[2]]; - var extent = ol.extent.transform(epsg4326Extent, transform); + var extent = ol.extent.applyTransform( + epsg4326Extent, transform); var tileRange, z, zKey; for (z = minZ; z <= maxZ; ++z) { zKey = z.toString(); diff --git a/src/ol/source/tilejsonsource.js b/src/ol/source/tilejsonsource.js index 0cfd14c546..ffbda97f91 100644 --- a/src/ol/source/tilejsonsource.js +++ b/src/ol/source/tilejsonsource.js @@ -55,7 +55,7 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) { if (goog.isDef(tileJSON.bounds)) { var transform = ol.proj.getTransformFromProjections( epsg4326Projection, this.getProjection()); - extent = ol.extent.transform(tileJSON.bounds, transform); + extent = ol.extent.applyTransform(tileJSON.bounds, transform); this.setExtent(extent); } diff --git a/test/spec/ol/extent.test.js b/test/spec/ol/extent.test.js index 23a21ea675..0be6ffa937 100644 --- a/test/spec/ol/extent.test.js +++ b/test/spec/ol/extent.test.js @@ -425,12 +425,13 @@ describe('ol.extent', function() { }); - describe('transform', function() { + describe('#applyTransform()', function() { it('does transform', function() { var transformFn = ol.proj.getTransform('EPSG:4326', 'EPSG:3857'); var sourceExtent = [-15, -30, 45, 60]; - var destinationExtent = ol.extent.transform(sourceExtent, transformFn); + var destinationExtent = ol.extent.applyTransform( + sourceExtent, transformFn); expect(destinationExtent).not.to.be(undefined); expect(destinationExtent).not.to.be(null); // FIXME check values with third-party tool @@ -456,7 +457,8 @@ describe('ol.extent', function() { return output; }; var sourceExtent = [-15, -30, 45, 60]; - var destinationExtent = ol.extent.transform(sourceExtent, transformFn); + var destinationExtent = ol.extent.applyTransform( + sourceExtent, transformFn); expect(destinationExtent).not.to.be(undefined); expect(destinationExtent).not.to.be(null); expect(destinationExtent[0]).to.be(-45); From 1110da37e1a080bbfdd60bd2da9d3bd380dfdf98 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 2 May 2014 11:25:44 -0600 Subject: [PATCH 4/6] Move ol.Sphere#circle to ol.geom.Polygon.circular Previously, ol.geom.Polygon was a transitive dependency of ol.proj (since ol.proj requires ol.sphere.NORMAL, and all spheres were capable of generating circular polygons). Instead, ol.proj should be lower-level. Since it deals only with coordinate arrays, it shouldn't depend on all of the geometry code. By adding a static `circular` function to `ol.geom.Polygon`, the dependency tree makes more sense. If you want to create a polygon that approximates a circle on a sphere, you require `ol.geom.Polygon` and `ol.Sphere` (or one of the constants). This makes room for geometries to have a `transform` method that takes projection-like arguments (meaning that `ol.geom.Geometry` will require `ol.proj`). --- examples/tissot.js | 5 +++-- src/ol/geolocation.js | 4 +++- src/ol/geom/polygon.js | 26 ++++++++++++++++++++++++++ src/ol/sphere/sphere.js | 28 ---------------------------- 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/examples/tissot.js b/examples/tissot.js index 909df77ae3..3fcb7afebd 100644 --- a/examples/tissot.js +++ b/examples/tissot.js @@ -1,6 +1,7 @@ goog.require('ol.Feature'); goog.require('ol.Map'); goog.require('ol.View2D'); +goog.require('ol.geom.Polygon'); goog.require('ol.layer.Tile'); goog.require('ol.layer.Vector'); goog.require('ol.source.TileWMS'); @@ -38,7 +39,7 @@ var map = new ol.Map({ var radius = 800000; for (var x = -180; x < 180; x += 30) { for (var y = -90; y < 90; y += 30) { - var geometry = ol.sphere.WGS84.circle([x, y], radius, 64); - vectorSource.addFeature(new ol.Feature(geometry)); + var circle = ol.geom.Polygon.circular(ol.sphere.WGS84, [x, y], radius, 64); + vectorSource.addFeature(new ol.Feature(circle)); } } diff --git a/src/ol/geolocation.js b/src/ol/geolocation.js index bc7fe3a501..7a6000bae6 100644 --- a/src/ol/geolocation.js +++ b/src/ol/geolocation.js @@ -11,6 +11,7 @@ goog.require('ol.BrowserFeature'); goog.require('ol.Coordinate'); goog.require('ol.Object'); goog.require('ol.geom.Geometry'); +goog.require('ol.geom.Polygon'); goog.require('ol.proj'); goog.require('ol.sphere.WGS84'); @@ -186,7 +187,8 @@ 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.sphere.WGS84.circle(this.position_, coords.accuracy); + var geometry = ol.geom.Polygon.circular( + ol.sphere.WGS84, this.position_, coords.accuracy); geometry.applyTransform(this.transform_); this.set(ol.GeolocationProperty.ACCURACY_GEOMETRY, geometry); this.dispatchChangeEvent(); diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index 0d7bfd605e..b7a484410a 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -314,3 +314,29 @@ ol.geom.Polygon.prototype.setFlatCoordinates = this.ends_ = ends; this.dispatchChangeEvent(); }; + + +/** + * Create an approximation of a circle on the surface of a sphere. + * @param {ol.Sphere} sphere The sphere. + * @param {ol.Coordinate} center Center. + * @param {number} radius Radius. + * @param {number=} opt_n Optional number of points. Default is `32`. + * @return {ol.geom.Polygon} Circle geometry. + * @todo api + */ +ol.geom.Polygon.circular = function(sphere, center, radius, opt_n) { + var n = goog.isDef(opt_n) ? opt_n : 32; + /** @type {Array.} */ + var flatCoordinates = []; + var i; + for (i = 0; i < n; ++i) { + goog.array.extend( + flatCoordinates, sphere.offset(center, radius, 2 * Math.PI * i / n)); + } + flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]); + var polygon = new ol.geom.Polygon(null); + polygon.setFlatCoordinates( + ol.geom.GeometryLayout.XY, flatCoordinates, [flatCoordinates.length]); + return polygon; +}; diff --git a/src/ol/sphere/sphere.js b/src/ol/sphere/sphere.js index ed095e7736..37ccca8d38 100644 --- a/src/ol/sphere/sphere.js +++ b/src/ol/sphere/sphere.js @@ -12,7 +12,6 @@ goog.provide('ol.Sphere'); goog.require('goog.array'); goog.require('goog.math'); -goog.require('ol.geom.Polygon'); @@ -30,33 +29,6 @@ ol.Sphere = function(radius) { }; -/** - * Returns an approximation to a circle centered on `center` with radius - * `radius` with `n` distinct points. - * - * @param {ol.Coordinate} center Center. - * @param {number} radius Radius. - * @param {number=} opt_n N. - * @return {ol.geom.Geometry} Circle geometry. - * @todo api - */ -ol.Sphere.prototype.circle = function(center, radius, opt_n) { - var n = goog.isDef(opt_n) ? opt_n : 32; - /** @type {Array.} */ - var flatCoordinates = []; - var i; - for (i = 0; i < n; ++i) { - goog.array.extend( - flatCoordinates, this.offset(center, radius, 2 * Math.PI * i / n)); - } - flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]); - var polygon = new ol.geom.Polygon(null); - polygon.setFlatCoordinates( - ol.geom.GeometryLayout.XY, flatCoordinates, [flatCoordinates.length]); - return polygon; -}; - - /** * Returns the distance from c1 to c2 using the spherical law of cosines. * From e448f100fdea4a804957623b32ea2fcf6d0848c2 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 2 May 2014 11:47:59 -0600 Subject: [PATCH 5/6] Add a transform method to geometries This accepts CRS identifiers for source and destination, transforms the geometry in place, and returns a reference to the geometry. --- src/ol/geom/geometry.js | 19 +++++++++++++ test/spec/ol/geom/geometrycollection.test.js | 29 ++++++++++++++++++++ test/spec/ol/geom/multipoint.test.js | 19 +++++++++++++ test/spec/ol/geom/point.test.js | 25 +++++++++++++++++ 4 files changed, 92 insertions(+) diff --git a/src/ol/geom/geometry.js b/src/ol/geom/geometry.js index 664ab20a18..9e1559fae1 100644 --- a/src/ol/geom/geometry.js +++ b/src/ol/geom/geometry.js @@ -4,6 +4,7 @@ goog.provide('ol.geom.GeometryType'); goog.require('goog.asserts'); goog.require('goog.functions'); goog.require('ol.Observable'); +goog.require('ol.proj'); /** @@ -166,6 +167,24 @@ ol.geom.Geometry.prototype.getType = goog.abstractMethod; ol.geom.Geometry.prototype.applyTransform = goog.abstractMethod; +/** + * Transform a geometry from one coordinate reference system to another. + * Modifies the geometry in place. + * + * @param {ol.proj.ProjectionLike} source The current projection. Can be a + * string identifier or a {@link ol.proj.Projection} object. + * @param {ol.proj.ProjectionLike} destination The desired projection. Can be a + * string identifier or a {@link ol.proj.Projection} object. + * @return {ol.geom.Geometry} This geometry. Note that original geometry is + * modified in place. + * @todo api + */ +ol.geom.Geometry.prototype.transform = function(source, destination) { + this.applyTransform(ol.proj.getTransform(source, destination)); + return this; +}; + + /** * @typedef {ol.Coordinate} */ diff --git a/test/spec/ol/geom/geometrycollection.test.js b/test/spec/ol/geom/geometrycollection.test.js index 26d8d9f9eb..f5952be233 100644 --- a/test/spec/ol/geom/geometrycollection.test.js +++ b/test/spec/ol/geom/geometrycollection.test.js @@ -139,6 +139,35 @@ describe('ol.geom.GeometryCollection', function() { }); + describe('#transform()', function() { + + var line, multi, point; + beforeEach(function() { + point = new ol.geom.Point([10, 20]); + line = new ol.geom.LineString([[10, 20], [30, 40]]); + multi = new ol.geom.GeometryCollection([point, line]); + }); + + it('transforms all geometries', function() { + multi.transform('EPSG:4326', 'EPSG:3857'); + + var geometries = multi.getGeometries(); + expect(geometries[0]).to.be.a(ol.geom.Point); + expect(geometries[1]).to.be.a(ol.geom.LineString); + + var coords = geometries[0].getCoordinates(); + expect(coords[0]).to.roughlyEqual(1113194.90, 1e-2); + expect(coords[1]).to.roughlyEqual(2273030.92, 1e-2); + + coords = geometries[1].getCoordinates(); + expect(coords[0][0]).to.roughlyEqual(1113194.90, 1e-2); + expect(coords[0][1]).to.roughlyEqual(2273030.92, 1e-2); + expect(coords[1][0]).to.roughlyEqual(3339584.72, 1e-2); + expect(coords[1][1]).to.roughlyEqual(4865942.27, 1e-2); + }); + + }); + }); diff --git a/test/spec/ol/geom/multipoint.test.js b/test/spec/ol/geom/multipoint.test.js index c8c2ae877d..a6b3a472b6 100644 --- a/test/spec/ol/geom/multipoint.test.js +++ b/test/spec/ol/geom/multipoint.test.js @@ -230,6 +230,25 @@ describe('ol.geom.MultiPoint', function() { }); + describe('#transform()', function() { + + it('transforms a geometry given CRS identifiers', function() { + var multi = new ol.geom.MultiPoint([[-111, 45], [111, -45]]).transform( + 'EPSG:4326', 'EPSG:3857'); + + expect(multi).to.be.a(ol.geom.MultiPoint); + + var coords = multi.getCoordinates(); + + expect(coords[0][0]).to.roughlyEqual(-12356463.47, 1e-2); + expect(coords[0][1]).to.roughlyEqual(5621521.48, 1e-2); + + expect(coords[1][0]).to.roughlyEqual(12356463.47, 1e-2); + expect(coords[1][1]).to.roughlyEqual(-5621521.48, 1e-2); + }); + + }); + }); diff --git a/test/spec/ol/geom/point.test.js b/test/spec/ol/geom/point.test.js index d7fa67dbf2..f32f86f23c 100644 --- a/test/spec/ol/geom/point.test.js +++ b/test/spec/ol/geom/point.test.js @@ -142,6 +142,31 @@ describe('ol.geom.Point', function() { }); + describe('#transform()', function() { + + it('transforms a geometry given CRS identifiers', function() { + var point = new ol.geom.Point([-111, 45]).transform( + 'EPSG:4326', 'EPSG:3857'); + + expect(point).to.be.a(ol.geom.Point); + + var coords = point.getCoordinates(); + + expect(coords[0]).to.roughlyEqual(-12356463.47, 1e-2); + expect(coords[1]).to.roughlyEqual(5621521.48, 1e-2); + }); + + it('modifies the original', function() { + var point = new ol.geom.Point([-111, 45]); + point.transform('EPSG:4326', 'EPSG:3857'); + var coords = point.getCoordinates(); + + expect(coords[0]).to.roughlyEqual(-12356463.47, 1e-2); + expect(coords[1]).to.roughlyEqual(5621521.48, 1e-2); + }); + + }); + }); From 0b8f1e8944027e8cf7382706a34cf1cfb88ad717 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Fri, 2 May 2014 13:24:04 -0600 Subject: [PATCH 6/6] Mark applyTransform as part of the API for all geometries --- src/ol/geom/geometry.js | 1 + src/ol/geom/simplegeometry.js | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ol/geom/geometry.js b/src/ol/geom/geometry.js index 9e1559fae1..f161b192dc 100644 --- a/src/ol/geom/geometry.js +++ b/src/ol/geom/geometry.js @@ -163,6 +163,7 @@ ol.geom.Geometry.prototype.getType = goog.abstractMethod; * Apply a transform function to the geometry. Modifies the geometry in place. * @function * @param {ol.TransformFunction} transformFn Transform. + * @todo api */ ol.geom.Geometry.prototype.applyTransform = goog.abstractMethod; diff --git a/src/ol/geom/simplegeometry.js b/src/ol/geom/simplegeometry.js index 8f4555800d..ae61834ca7 100644 --- a/src/ol/geom/simplegeometry.js +++ b/src/ol/geom/simplegeometry.js @@ -242,7 +242,6 @@ ol.geom.SimpleGeometry.prototype.setLayout = /** * @inheritDoc - * @todo api */ ol.geom.SimpleGeometry.prototype.applyTransform = function(transformFn) { if (!goog.isNull(this.flatCoordinates)) {