diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index 57fd12ffd8..7da4f2a82a 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -100,6 +100,7 @@ ol.geom.Polygon.prototype.getType = function() { */ ol.geom.Polygon.prototype.containsCoordinate = function(coordinate) { var rings = this.rings; + /** @type {boolean} */ var containsCoordinate; for (var i = 0, ii = rings.length; i < ii; ++i) { containsCoordinate = rings[i].containsCoordinate(coordinate); diff --git a/test/spec/ol/geom/linearring.test.js b/test/spec/ol/geom/linearring.test.js index 1c3380deff..118b076f36 100644 --- a/test/spec/ol/geom/linearring.test.js +++ b/test/spec/ol/geom/linearring.test.js @@ -58,48 +58,47 @@ describe('ol.geom.LinearRing', function() { // contains: 1 (touches - not implemented), true (within), false (outside) var cases = [{ - point: [5, 5], contains: true + point: [5, 5], contains: true }, { - point: [20, 20], contains: false + point: [20, 20], contains: false }, { - point: [15, 15], contains: false + point: [15, 15], contains: false }/*, { - point: [0, 0], contains: 1 // lower left corner + point: [0, 0], contains: 1 // lower left corner }, { - point: [10, 0], contains: 1 // lower right corner + point: [10, 0], contains: 1 // lower right corner }, { - point: [15, 10], contains: 1 // upper right corner + point: [15, 10], contains: 1 // upper right corner }, { - point: [5, 10], contains: 1 // upper left corner + point: [5, 10], contains: 1 // upper left corner }, { - point: [5, 0], contains: 1 // on edge 1 + point: [5, 0], contains: 1 // on edge 1 }*/, { - point: [5, -0.1], contains: false // below edge 1 + point: [5, -0.1], contains: false // below edge 1 }, { - point: [5, 0.1], contains: true // above edge 1 + point: [5, 0.1], contains: true // above edge 1 }/*, { - point: [12.5, 5], contains: 1 // on edge 2 + point: [12.5, 5], contains: 1 // on edge 2 }*/, { - point: [12.4, 5], contains: true // left of edge 2 + point: [12.4, 5], contains: true // left of edge 2 }, { - point: [12.6, 5], contains: false // right of edge 2 + point: [12.6, 5], contains: false // right of edge 2 }/*, { - point: [10, 10], contains: 1 // on edge 3 + point: [10, 10], contains: 1 // on edge 3 }*/, { - point: [10, 9.9], contains: true // below edge 3 + point: [10, 9.9], contains: true // below edge 3 }, { - point: [10, 10.1], contains: false // above edge 3 + point: [10, 10.1], contains: false // above edge 3 }/*, { - point: [2.5, 5], contains: 1 // on edge 4 + point: [2.5, 5], contains: 1 // on edge 4 }*/, { - point: [2.4, 5], contains: false // left of edge 4 + point: [2.4, 5], contains: false // left of edge 4 }, { - point: [2.6, 5], contains: true // right of edge 4 + point: [2.6, 5], contains: true // right of edge 4 }]; - var len = cases.length; var c; - for (var i=0; i