Add ol.geom.Polygon#intersectsExtent

This commit is contained in:
Éric Lemoine
2014-07-08 16:25:07 +02:00
parent 67f98145bb
commit 8bdeca9f0a

View File

@@ -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.<Array.<ol.Coordinate>>} coordinates Coordinates.
* @param {ol.geom.GeometryLayout=} opt_layout Layout.