From d1f6f132d64a22922c89b341021a8c456a5af600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 8 Jul 2014 16:25:29 +0200 Subject: [PATCH] Add ol.geom.MultiPolygon#intersectsExtent --- src/ol/geom/multipolygon.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ol/geom/multipolygon.js b/src/ol/geom/multipolygon.js index e546877f65..b881e2eb12 100644 --- a/src/ol/geom/multipolygon.js +++ b/src/ol/geom/multipolygon.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'); @@ -315,6 +316,16 @@ ol.geom.MultiPolygon.prototype.getType = function() { }; +/** + * @inheritDoc + * @api + */ +ol.geom.MultiPolygon.prototype.intersectsExtent = function(extent) { + return ol.geom.flat.intersectsextent.linearRingss( + this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, extent); +}; + + /** * @param {Array.>>} coordinates Coordinates. * @param {ol.geom.GeometryLayout=} opt_layout Layout.