diff --git a/src/api/feature.js b/src/api/feature.js index cc71cfe2e7..6006f3259f 100644 --- a/src/api/feature.js +++ b/src/api/feature.js @@ -58,6 +58,7 @@ ol.feature = function(opt_arg){ }; /** + * @export * @param {!string} attr The name of the attribute to be set. * @param {string|number|boolean} value The value of the attribute to be set. * @returns {ol.Feature} The feature so calls can be chained @@ -68,6 +69,7 @@ ol.Feature.prototype.set = function(attr, value) { }; /** + * @export * @param {!string} attr The name of the attribute to be set. * @returns {string|number|boolean|undefined} The attribute value requested. */ @@ -76,6 +78,7 @@ ol.Feature.prototype.get = function(attr) { }; /** + * @export * @param {ol.geom.Geometry=} opt_arg * @returns {ol.Feature|ol.geom.Geometry|undefined} get or set the geometry on a feature */ @@ -87,5 +90,3 @@ ol.Feature.prototype.geometry = function(opt_arg) { return this.getGeometry(); } }; - - diff --git a/src/ol.export.js b/src/ol.export.js index 6e792a3ae2..2440e88f68 100644 --- a/src/ol.export.js +++ b/src/ol.export.js @@ -45,3 +45,18 @@ goog.exportProperty( ol.Bounds.prototype, 'minX', ol.Bounds.prototype.minX ); goog.exportProperty( ol.Bounds.prototype, 'minY', ol.Bounds.prototype.minY ); goog.exportProperty( ol.Bounds.prototype, 'maxX', ol.Bounds.prototype.maxX ); goog.exportProperty( ol.Bounds.prototype, 'maxY', ol.Bounds.prototype.maxY ); + +// ol.feature +goog.exportSymbol('ol.feature', ol.feature); +goog.exportSymbol('ol.Feature', ol.Feature); +goog.exportProperty(ol.Feature.prototype, 'set', ol.Feature.prototype.set); +goog.exportProperty(ol.Feature.prototype, 'get', ol.Feature.prototype.get); +goog.exportProperty(ol.Feature.prototype, 'geometry', ol.Feature.prototype.geometry); + +// ol.geom.point +goog.exportSymbol('ol.geom.point', ol.geom.point); +goog.exportSymbol('ol.geom.Point', ol.geom.Point); +goog.exportProperty(ol.geom.Point.prototype, 'x', ol.geom.Point.prototype.x); +goog.exportProperty(ol.geom.Point.prototype, 'y', ol.geom.Point.prototype.y); +goog.exportPropertz(ol.geom.Point.prototzpe, 'z', ol.geom.Point.prototzpe.z); +goog.exportProperty(ol.geom.Point.prototype, 'projection', ol.geom.Point.prototype.projection); diff --git a/src/ol/Feature.js b/src/ol/Feature.js index 1df98df634..7fb7d4fab4 100644 --- a/src/ol/Feature.js +++ b/src/ol/Feature.js @@ -5,6 +5,7 @@ goog.require('ol.geom.Geometry'); /** + * @export * @constructor */ ol.Feature = function() { diff --git a/test/spec/api/feature.test.js b/test/spec/api/feature.test.js index f360ee2bfc..e65437246e 100644 --- a/test/spec/api/feature.test.js +++ b/test/spec/api/feature.test.js @@ -31,8 +31,8 @@ describe("ol.feature", function() { var geom = feat.geometry(); expect(feat).toBeA(ol.Feature); - expect(geom.getX()).toBe(21); - expect(geom.getY()).toBe(4); + expect(geom.x()).toBe(21); + expect(geom.y()).toBe(4); }); it("should be easy to create a feature from object literals", function() { @@ -49,8 +49,8 @@ describe("ol.feature", function() { var geom = feat.geometry(); expect(feat).toBeA(ol.Feature); - expect(geom.getX()).toBe(56); - expect(geom.getY()).toBe(22); + expect(geom.x()).toBe(56); + expect(geom.y()).toBe(22); expect(feat.get('foo')).toBe('bar'); expect(feat.get('two')).toBe('deux'); expect(feat.get('size')).toBe(3); @@ -69,8 +69,8 @@ describe("ol.feature", function() { var geom = feat.geometry(); expect(feat).toBeA(ol.Feature); - expect(geom.getX()).toBe(102.0); - expect(geom.getY()).toBe(0.5); + expect(geom.x()).toBe(102.0); + expect(geom.y()).toBe(0.5); expect(feat.get('prop0')).toBe('value0'); }); */