Use oriented rings where needed
This commit is contained in:
@@ -104,7 +104,7 @@ ol.geom.Polygon.prototype.closestPointXY =
|
||||
*/
|
||||
ol.geom.Polygon.prototype.containsXY = function(x, y) {
|
||||
return ol.geom.flat.linearRingsContainsXY(
|
||||
this.flatCoordinates, 0, this.ends_, this.stride, x, y);
|
||||
this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, x, y);
|
||||
};
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ ol.geom.Polygon.prototype.containsXY = function(x, y) {
|
||||
*/
|
||||
ol.geom.Polygon.prototype.getArea = function() {
|
||||
return ol.geom.flat.linearRingsArea(
|
||||
this.flatCoordinates, 0, this.ends_, this.stride);
|
||||
this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride);
|
||||
};
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ ol.geom.Polygon.prototype.getInteriorPoint = function() {
|
||||
var extent = this.getExtent();
|
||||
var y = (extent[1] + extent[3]) / 2;
|
||||
this.interiorPoint_ = ol.geom.flat.linearRingsGetInteriorPoint(
|
||||
this.flatCoordinates, 0, this.ends_, this.stride, y);
|
||||
this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, y);
|
||||
this.interiorPointRevision_ = this.getRevision();
|
||||
}
|
||||
return this.interiorPoint_;
|
||||
|
||||
@@ -1096,7 +1096,7 @@ ol.render.canvas.PolygonReplay.prototype.drawPolygonGeometry =
|
||||
state.miterLimit, state.lineDash]);
|
||||
}
|
||||
var ends = polygonGeometry.getEnds();
|
||||
var flatCoordinates = polygonGeometry.getFlatCoordinates();
|
||||
var flatCoordinates = polygonGeometry.getOrientedFlatCoordinates();
|
||||
var stride = polygonGeometry.getStride();
|
||||
this.drawFlatCoordinatess_(flatCoordinates, 0, ends, stride);
|
||||
this.endGeometry(polygonGeometry, data);
|
||||
|
||||
Reference in New Issue
Block a user