From 8bdeca9f0a325507e32714806d3fd1ae4bf86510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 8 Jul 2014 16:25:07 +0200 Subject: [PATCH] Add ol.geom.Polygon#intersectsExtent --- src/ol/geom/polygon.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index 7e91e80ba5..52d55ff1fd 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -14,6 +14,7 @@ goog.require('ol.geom.flat.contains'); goog.require('ol.geom.flat.deflate'); goog.require('ol.geom.flat.inflate'); goog.require('ol.geom.flat.interiorpoint'); +goog.require('ol.geom.flat.intersectsextent'); goog.require('ol.geom.flat.orient'); goog.require('ol.geom.flat.simplify'); @@ -296,6 +297,16 @@ ol.geom.Polygon.prototype.getType = function() { }; +/** + * @inheritDoc + * @api + */ +ol.geom.Polygon.prototype.intersectsExtent = function(extent) { + return ol.geom.flat.intersectsextent.linearRings( + this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, extent); +}; + + /** * @param {Array.>} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout.