Add ol.geom.MultiPolygon#getSimplifiedGeometryInternal
This commit is contained in:
@@ -3,6 +3,7 @@ goog.provide('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Geometry');
|
||||
goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.geom.flat');
|
||||
goog.require('ol.geom.simplify');
|
||||
|
||||
|
||||
|
||||
@@ -90,6 +91,24 @@ ol.geom.MultiPolygon.prototype.getInteriorPoints = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal =
|
||||
function(squaredTolerance) {
|
||||
var simplifiedFlatCoordinates = [];
|
||||
var simplifiedEndss = [];
|
||||
simplifiedFlatCoordinates.length =
|
||||
ol.geom.simplify.douglasPeuckerss(this.flatCoordinates, 0,
|
||||
this.endss_, this.stride, squaredTolerance, simplifiedFlatCoordinates,
|
||||
0, simplifiedEndss);
|
||||
var simplifiedMultiPolygon = new ol.geom.MultiPolygon(null);
|
||||
simplifiedMultiPolygon.setFlatCoordinates(
|
||||
ol.geom.GeometryLayout.XY, simplifiedFlatCoordinates, simplifiedEndss);
|
||||
return simplifiedMultiPolygon;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<ol.geom.Polygon>} Polygons.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user