diff --git a/src/ol/geom/geometry.js b/src/ol/geom/geometry.js
index b12a260d44..b2ab428bf5 100644
--- a/src/ol/geom/geometry.js
+++ b/src/ol/geom/geometry.js
@@ -7,7 +7,7 @@ goog.provide('ol.geom.GeometryType');
/**
- * @interface
+ * @constructor
*/
ol.geom.Geometry = function() {};
@@ -30,7 +30,7 @@ ol.geom.Geometry.prototype.getBounds = goog.abstractMethod;
* Get the geometry type.
* @return {ol.geom.GeometryType} The geometry type.
*/
-ol.geom.Geometry.prototype.getType = function() {};
+ol.geom.Geometry.prototype.getType = goog.abstractMethod;
/**
diff --git a/src/ol/geom/geometrycollection.js b/src/ol/geom/geometrycollection.js
index b0e8f7bd75..277eafa899 100644
--- a/src/ol/geom/geometrycollection.js
+++ b/src/ol/geom/geometrycollection.js
@@ -10,10 +10,12 @@ goog.require('ol.geom.GeometryType');
* A collection of geometries. This constructor should not called. Instead
* create one of the fixed type collections.
* @constructor
- * @implements {ol.geom.Geometry}
+ * @extends {ol.geom.Geometry}
*/
ol.geom.GeometryCollection = function() {
+ goog.base(this);
+
/**
* @type {Array.
}
*/
@@ -31,6 +33,7 @@ ol.geom.GeometryCollection = function() {
this.bounds = null;
};
+goog.inherits(ol.geom.GeometryCollection, ol.geom.Geometry);
/**
diff --git a/src/ol/geom/linestring.js b/src/ol/geom/linestring.js
index 1e90688115..5dbe11936e 100644
--- a/src/ol/geom/linestring.js
+++ b/src/ol/geom/linestring.js
@@ -10,12 +10,14 @@ goog.require('ol.geom.GeometryType');
/**
* @constructor
- * @implements {ol.geom.Geometry}
+ * @extends {ol.geom.Geometry}
* @param {ol.geom.CoordinateArray} coordinates Coordinates array (e.g.
* [[x0, y0], [x1, y1]]).
*/
ol.geom.LineString = function(coordinates) {
+ goog.base(this);
+
// assume the same dimension for all coordinates
var dimension = coordinates[0].length,
count = coordinates.length,
@@ -43,6 +45,7 @@ ol.geom.LineString = function(coordinates) {
this.bounds_ = null;
};
+goog.inherits(ol.geom.LineString, ol.geom.Geometry);
/**
diff --git a/src/ol/geom/point.js b/src/ol/geom/point.js
index 73b6b8338b..0409929adf 100644
--- a/src/ol/geom/point.js
+++ b/src/ol/geom/point.js
@@ -10,11 +10,13 @@ goog.require('ol.geom.GeometryType');
/**
* @constructor
- * @implements {ol.geom.Geometry}
+ * @extends {ol.geom.Geometry}
* @param {ol.geom.Coordinate} coordinates Coordinates array (e.g. [x, y]).
*/
ol.geom.Point = function(coordinates) {
+ goog.base(this);
+
/**
* @type {Float64Array}
*/
@@ -33,6 +35,7 @@ ol.geom.Point = function(coordinates) {
this.bounds_ = null;
};
+goog.inherits(ol.geom.Point, ol.geom.Geometry);
/**
diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js
index 4a0b32dad3..c3c3e88a76 100644
--- a/src/ol/geom/polygon.js
+++ b/src/ol/geom/polygon.js
@@ -11,12 +11,14 @@ goog.require('ol.geom.LinearRing');
/**
* @constructor
- * @implements {ol.geom.Geometry}
+ * @extends {ol.geom.Geometry}
* @param {Array.} coordinates Array of rings. First
* is outer, any remaining are inner.
*/
ol.geom.Polygon = function(coordinates) {
+ goog.base(this);
+
var numRings = coordinates.length,
dimension;
@@ -46,6 +48,7 @@ ol.geom.Polygon = function(coordinates) {
this.bounds_ = null;
};
+goog.inherits(ol.geom.Polygon, ol.geom.Geometry);
/**
diff --git a/test/spec/ol/geom/linestring.test.js b/test/spec/ol/geom/linestring.test.js
index 1fae0ee361..3ddf89d8af 100644
--- a/test/spec/ol/geom/linestring.test.js
+++ b/test/spec/ol/geom/linestring.test.js
@@ -7,6 +7,7 @@ describe('ol.geom.LineString', function() {
it('creates a linestring from an array', function() {
var line = new ol.geom.LineString([[10, 20], [30, 40]]);
expect(line).toBeA(ol.geom.LineString);
+ expect(line).toBeA(ol.geom.Geometry);
});
it('throws when given mismatched dimension', function() {
@@ -62,4 +63,5 @@ describe('ol.geom.LineString', function() {
});
+goog.require('ol.geom.Geometry');
goog.require('ol.geom.LineString');
diff --git a/test/spec/ol/geom/multilinestring.test.js b/test/spec/ol/geom/multilinestring.test.js
index 9870eaf8e2..356a70fc92 100644
--- a/test/spec/ol/geom/multilinestring.test.js
+++ b/test/spec/ol/geom/multilinestring.test.js
@@ -9,6 +9,7 @@ describe('ol.geom.MultiLineString', function() {
[[10, 20], [30, 40]],
[[20, 30], [40, 50]]]);
expect(multi).toBeA(ol.geom.MultiLineString);
+ expect(multi).toBeA(ol.geom.Geometry);
});
it('throws when given with insufficient dimensions', function() {
@@ -69,4 +70,5 @@ describe('ol.geom.MultiLineString', function() {
});
+goog.require('ol.geom.Geometry');
goog.require('ol.geom.MultiLineString');
diff --git a/test/spec/ol/geom/multipoint.test.js b/test/spec/ol/geom/multipoint.test.js
index 496a573f9a..0e1c641ff2 100644
--- a/test/spec/ol/geom/multipoint.test.js
+++ b/test/spec/ol/geom/multipoint.test.js
@@ -7,6 +7,7 @@ describe('ol.geom.MultiPoint', function() {
it('creates a multi-point from an array', function() {
var multi = new ol.geom.MultiPoint([[10, 20], [30, 40]]);
expect(multi).toBeA(ol.geom.MultiPoint);
+ expect(multi).toBeA(ol.geom.Geometry);
});
it('throws when given with insufficient dimensions', function() {
@@ -59,4 +60,5 @@ describe('ol.geom.MultiPoint', function() {
});
+goog.require('ol.geom.Geometry');
goog.require('ol.geom.MultiPoint');
diff --git a/test/spec/ol/geom/multipolygon.test.js b/test/spec/ol/geom/multipolygon.test.js
index 176df22dcf..0dd9dd9a80 100644
--- a/test/spec/ol/geom/multipolygon.test.js
+++ b/test/spec/ol/geom/multipolygon.test.js
@@ -14,6 +14,7 @@ describe('ol.geom.MultiPolygon', function() {
[outer1, inner1a, inner1b],
[outer2]]);
expect(multi).toBeA(ol.geom.MultiPolygon);
+ expect(multi).toBeA(ol.geom.Geometry);
});
it('throws when given with insufficient dimensions', function() {
@@ -72,4 +73,5 @@ describe('ol.geom.MultiPolygon', function() {
});
+goog.require('ol.geom.Geometry');
goog.require('ol.geom.MultiPolygon');
diff --git a/test/spec/ol/geom/point.test.js b/test/spec/ol/geom/point.test.js
index b550646e70..51031e02e9 100644
--- a/test/spec/ol/geom/point.test.js
+++ b/test/spec/ol/geom/point.test.js
@@ -7,6 +7,7 @@ describe('ol.geom.Point', function() {
it('creates a point from an array', function() {
var point = new ol.geom.Point([10, 20]);
expect(point).toBeA(ol.geom.Point);
+ expect(point).toBeA(ol.geom.Geometry);
});
it('throws when given with insufficient dimensions', function() {
@@ -60,4 +61,5 @@ describe('ol.geom.Point', function() {
});
+goog.require('ol.geom.Geometry');
goog.require('ol.geom.Point');
diff --git a/test/spec/ol/geom/polygon.test.js b/test/spec/ol/geom/polygon.test.js
index 1a12b02770..591b896643 100644
--- a/test/spec/ol/geom/polygon.test.js
+++ b/test/spec/ol/geom/polygon.test.js
@@ -11,6 +11,7 @@ describe('ol.geom.Polygon', function() {
it('creates a polygon from an array', function() {
var poly = new ol.geom.Polygon([outer, inner1, inner2]);
expect(poly).toBeA(ol.geom.Polygon);
+ expect(poly).toBeA(ol.geom.Geometry);
});
it('throws when given mismatched dimension', function() {
@@ -64,4 +65,5 @@ describe('ol.geom.Polygon', function() {
});
+goog.require('ol.geom.Geometry');
goog.require('ol.geom.Polygon');