Rename _ol_geom_MultiPolygon_ to MultiPolygon
This commit is contained in:
@@ -13,7 +13,7 @@ import LineString from '../geom/LineString.js';
|
|||||||
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import MultiPoint from '../geom/MultiPoint.js';
|
import MultiPoint from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
import _ol_geom_flat_deflate_ from '../geom/flat/deflate.js';
|
||||||
@@ -225,7 +225,7 @@ _ol_format_EsriJSON_.readMultiPointGeometry_ = function(object) {
|
|||||||
*/
|
*/
|
||||||
_ol_format_EsriJSON_.readMultiPolygonGeometry_ = function(object) {
|
_ol_format_EsriJSON_.readMultiPolygonGeometry_ = function(object) {
|
||||||
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
|
var layout = _ol_format_EsriJSON_.getGeometryLayout_(object);
|
||||||
return new _ol_geom_MultiPolygon_(
|
return new MultiPolygon(
|
||||||
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
/** @type {Array.<Array.<Array.<Array.<number>>>>} */(object.rings),
|
||||||
layout);
|
layout);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import _ol_geom_Geometry_ from '../geom/Geometry.js';
|
|||||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_obj_ from '../obj.js';
|
import _ol_obj_ from '../obj.js';
|
||||||
import {get as getProjection, transformExtent} from '../proj.js';
|
import {get as getProjection, transformExtent} from '../proj.js';
|
||||||
@@ -120,7 +120,7 @@ _ol_format_GML3_.prototype.readMultiSurface_ = function(node, objectStack) {
|
|||||||
var polygons = _ol_xml_.pushParseAndPop([],
|
var polygons = _ol_xml_.pushParseAndPop([],
|
||||||
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
this.MULTISURFACE_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_(null);
|
var multiPolygon = new MultiPolygon(null);
|
||||||
multiPolygon.setPolygons(polygons);
|
multiPolygon.setPolygons(polygons);
|
||||||
return multiPolygon;
|
return multiPolygon;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import LineString from '../geom/LineString.js';
|
|||||||
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
import _ol_geom_LinearRing_ from '../geom/LinearRing.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import MultiPoint from '../geom/MultiPoint.js';
|
import MultiPoint from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_obj_ from '../obj.js';
|
import _ol_obj_ from '../obj.js';
|
||||||
@@ -317,7 +317,7 @@ _ol_format_GMLBase_.prototype.readMultiPolygon = function(node, objectStack) {
|
|||||||
var polygons = _ol_xml_.pushParseAndPop([],
|
var polygons = _ol_xml_.pushParseAndPop([],
|
||||||
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
this.MULTIPOLYGON_PARSERS_, node, objectStack, this);
|
||||||
if (polygons) {
|
if (polygons) {
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_(null);
|
var multiPolygon = new MultiPolygon(null);
|
||||||
multiPolygon.setPolygons(polygons);
|
multiPolygon.setPolygons(polygons);
|
||||||
return multiPolygon;
|
return multiPolygon;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import _ol_geom_GeometryCollection_ from '../geom/GeometryCollection.js';
|
|||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import MultiPoint from '../geom/MultiPoint.js';
|
import MultiPoint from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_obj_ from '../obj.js';
|
import _ol_obj_ from '../obj.js';
|
||||||
@@ -149,7 +149,7 @@ _ol_format_GeoJSON_.readMultiPointGeometry_ = function(object) {
|
|||||||
* @return {ol.geom.MultiPolygon} MultiPolygon.
|
* @return {ol.geom.MultiPolygon} MultiPolygon.
|
||||||
*/
|
*/
|
||||||
_ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) {
|
_ol_format_GeoJSON_.readMultiPolygonGeometry_ = function(object) {
|
||||||
return new _ol_geom_MultiPolygon_(object.coordinates);
|
return new MultiPolygon(object.coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
|||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import MultiPoint from '../geom/MultiPoint.js';
|
import MultiPoint from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_math_ from '../math.js';
|
import _ol_math_ from '../math.js';
|
||||||
@@ -944,7 +944,7 @@ _ol_format_KML_.readMultiGeometry_ = function(node, objectStack) {
|
|||||||
multiGeometry.setLineStrings(geometries);
|
multiGeometry.setLineStrings(geometries);
|
||||||
_ol_format_KML_.setCommonGeometryProperties_(multiGeometry, geometries);
|
_ol_format_KML_.setCommonGeometryProperties_(multiGeometry, geometries);
|
||||||
} else if (type == _ol_geom_GeometryType_.POLYGON) {
|
} else if (type == _ol_geom_GeometryType_.POLYGON) {
|
||||||
multiGeometry = new _ol_geom_MultiPolygon_(null);
|
multiGeometry = new MultiPolygon(null);
|
||||||
multiGeometry.setPolygons(geometries);
|
multiGeometry.setPolygons(geometries);
|
||||||
_ol_format_KML_.setCommonGeometryProperties_(multiGeometry, geometries);
|
_ol_format_KML_.setCommonGeometryProperties_(multiGeometry, geometries);
|
||||||
} else if (type == _ol_geom_GeometryType_.GEOMETRY_COLLECTION) {
|
} else if (type == _ol_geom_GeometryType_.GEOMETRY_COLLECTION) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
|||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import MultiPoint from '../geom/MultiPoint.js';
|
import MultiPoint from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
import _ol_geom_flat_orient_ from '../geom/flat/orient.js';
|
||||||
@@ -305,7 +305,7 @@ _ol_format_MVT_.prototype.createFeature_ = function(pbf, rawFeature, opt_options
|
|||||||
}
|
}
|
||||||
if (endss.length > 1) {
|
if (endss.length > 1) {
|
||||||
ends = endss;
|
ends = endss;
|
||||||
geom = new _ol_geom_MultiPolygon_(null);
|
geom = new MultiPolygon(null);
|
||||||
} else {
|
} else {
|
||||||
geom = new Polygon(null);
|
geom = new Polygon(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
|||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import MultiPoint from '../geom/MultiPoint.js';
|
import MultiPoint from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import {get as getProjection} from '../proj.js';
|
import {get as getProjection} from '../proj.js';
|
||||||
@@ -202,7 +202,7 @@ _ol_format_TopoJSON_.readMultiPolygonGeometry_ = function(object, arcs) {
|
|||||||
}
|
}
|
||||||
coordinates[i] = ringCoords;
|
coordinates[i] = ringCoords;
|
||||||
}
|
}
|
||||||
return new _ol_geom_MultiPolygon_(coordinates);
|
return new MultiPolygon(coordinates);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
|||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import MultiPoint from '../geom/MultiPoint.js';
|
import MultiPoint from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
import _ol_geom_SimpleGeometry_ from '../geom/SimpleGeometry.js';
|
||||||
@@ -923,7 +923,7 @@ _ol_format_WKT_.Parser.GeometryConstructor_ = {
|
|||||||
'POLYGON': Polygon,
|
'POLYGON': Polygon,
|
||||||
'MULTIPOINT': MultiPoint,
|
'MULTIPOINT': MultiPoint,
|
||||||
'MULTILINESTRING': MultiLineString,
|
'MULTILINESTRING': MultiLineString,
|
||||||
'MULTIPOLYGON': _ol_geom_MultiPolygon_
|
'MULTIPOLYGON': MultiPolygon
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+23
-23
@@ -30,7 +30,7 @@ import _ol_geom_flat_simplify_ from '../geom/flat/simplify.js';
|
|||||||
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
* @param {ol.geom.GeometryLayout=} opt_layout Layout.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_geom_MultiPolygon_ = function(coordinates, opt_layout) {
|
var MultiPolygon = function(coordinates, opt_layout) {
|
||||||
|
|
||||||
_ol_geom_SimpleGeometry_.call(this);
|
_ol_geom_SimpleGeometry_.call(this);
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ var _ol_geom_MultiPolygon_ = function(coordinates, opt_layout) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_geom_MultiPolygon_, _ol_geom_SimpleGeometry_);
|
inherits(MultiPolygon, _ol_geom_SimpleGeometry_);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -88,7 +88,7 @@ inherits(_ol_geom_MultiPolygon_, _ol_geom_SimpleGeometry_);
|
|||||||
* @param {ol.geom.Polygon} polygon Polygon.
|
* @param {ol.geom.Polygon} polygon Polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.appendPolygon = function(polygon) {
|
MultiPolygon.prototype.appendPolygon = function(polygon) {
|
||||||
/** @type {Array.<number>} */
|
/** @type {Array.<number>} */
|
||||||
var ends;
|
var ends;
|
||||||
if (!this.flatCoordinates) {
|
if (!this.flatCoordinates) {
|
||||||
@@ -115,8 +115,8 @@ _ol_geom_MultiPolygon_.prototype.appendPolygon = function(polygon) {
|
|||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.clone = function() {
|
MultiPolygon.prototype.clone = function() {
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_(null);
|
var multiPolygon = new MultiPolygon(null);
|
||||||
|
|
||||||
var len = this.endss_.length;
|
var len = this.endss_.length;
|
||||||
var newEndss = new Array(len);
|
var newEndss = new Array(len);
|
||||||
@@ -133,7 +133,7 @@ _ol_geom_MultiPolygon_.prototype.clone = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
MultiPolygon.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||||
if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||||
return minSquaredDistance;
|
return minSquaredDistance;
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ _ol_geom_MultiPolygon_.prototype.closestPointXY = function(x, y, closestPoint, m
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.containsXY = function(x, y) {
|
MultiPolygon.prototype.containsXY = function(x, y) {
|
||||||
return _ol_geom_flat_contains_.linearRingssContainsXY(
|
return _ol_geom_flat_contains_.linearRingssContainsXY(
|
||||||
this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, x, y);
|
this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, x, y);
|
||||||
};
|
};
|
||||||
@@ -162,7 +162,7 @@ _ol_geom_MultiPolygon_.prototype.containsXY = function(x, y) {
|
|||||||
* @return {number} Area (on projected plane).
|
* @return {number} Area (on projected plane).
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getArea = function() {
|
MultiPolygon.prototype.getArea = function() {
|
||||||
return _ol_geom_flat_area_.linearRingss(
|
return _ol_geom_flat_area_.linearRingss(
|
||||||
this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride);
|
this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride);
|
||||||
};
|
};
|
||||||
@@ -182,7 +182,7 @@ _ol_geom_MultiPolygon_.prototype.getArea = function() {
|
|||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getCoordinates = function(opt_right) {
|
MultiPolygon.prototype.getCoordinates = function(opt_right) {
|
||||||
var flatCoordinates;
|
var flatCoordinates;
|
||||||
if (opt_right !== undefined) {
|
if (opt_right !== undefined) {
|
||||||
flatCoordinates = this.getOrientedFlatCoordinates().slice();
|
flatCoordinates = this.getOrientedFlatCoordinates().slice();
|
||||||
@@ -200,7 +200,7 @@ _ol_geom_MultiPolygon_.prototype.getCoordinates = function(opt_right) {
|
|||||||
/**
|
/**
|
||||||
* @return {Array.<Array.<number>>} Endss.
|
* @return {Array.<Array.<number>>} Endss.
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getEndss = function() {
|
MultiPolygon.prototype.getEndss = function() {
|
||||||
return this.endss_;
|
return this.endss_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ _ol_geom_MultiPolygon_.prototype.getEndss = function() {
|
|||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Flat interior points.
|
* @return {Array.<number>} Flat interior points.
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getFlatInteriorPoints = function() {
|
MultiPolygon.prototype.getFlatInteriorPoints = function() {
|
||||||
if (this.flatInteriorPointsRevision_ != this.getRevision()) {
|
if (this.flatInteriorPointsRevision_ != this.getRevision()) {
|
||||||
var flatCenters = _ol_geom_flat_center_.linearRingss(
|
var flatCenters = _ol_geom_flat_center_.linearRingss(
|
||||||
this.flatCoordinates, 0, this.endss_, this.stride);
|
this.flatCoordinates, 0, this.endss_, this.stride);
|
||||||
@@ -227,7 +227,7 @@ _ol_geom_MultiPolygon_.prototype.getFlatInteriorPoints = function() {
|
|||||||
* the length of the horizontal intersection that the point belongs to.
|
* the length of the horizontal intersection that the point belongs to.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getInteriorPoints = function() {
|
MultiPolygon.prototype.getInteriorPoints = function() {
|
||||||
var interiorPoints = new MultiPoint(null);
|
var interiorPoints = new MultiPoint(null);
|
||||||
interiorPoints.setFlatCoordinates(_ol_geom_GeometryLayout_.XYM,
|
interiorPoints.setFlatCoordinates(_ol_geom_GeometryLayout_.XYM,
|
||||||
this.getFlatInteriorPoints().slice());
|
this.getFlatInteriorPoints().slice());
|
||||||
@@ -238,7 +238,7 @@ _ol_geom_MultiPolygon_.prototype.getInteriorPoints = function() {
|
|||||||
/**
|
/**
|
||||||
* @return {Array.<number>} Oriented flat coordinates.
|
* @return {Array.<number>} Oriented flat coordinates.
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getOrientedFlatCoordinates = function() {
|
MultiPolygon.prototype.getOrientedFlatCoordinates = function() {
|
||||||
if (this.orientedRevision_ != this.getRevision()) {
|
if (this.orientedRevision_ != this.getRevision()) {
|
||||||
var flatCoordinates = this.flatCoordinates;
|
var flatCoordinates = this.flatCoordinates;
|
||||||
if (_ol_geom_flat_orient_.linearRingssAreOriented(
|
if (_ol_geom_flat_orient_.linearRingssAreOriented(
|
||||||
@@ -259,14 +259,14 @@ _ol_geom_MultiPolygon_.prototype.getOrientedFlatCoordinates = function() {
|
|||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredTolerance) {
|
||||||
var simplifiedFlatCoordinates = [];
|
var simplifiedFlatCoordinates = [];
|
||||||
var simplifiedEndss = [];
|
var simplifiedEndss = [];
|
||||||
simplifiedFlatCoordinates.length = _ol_geom_flat_simplify_.quantizess(
|
simplifiedFlatCoordinates.length = _ol_geom_flat_simplify_.quantizess(
|
||||||
this.flatCoordinates, 0, this.endss_, this.stride,
|
this.flatCoordinates, 0, this.endss_, this.stride,
|
||||||
Math.sqrt(squaredTolerance),
|
Math.sqrt(squaredTolerance),
|
||||||
simplifiedFlatCoordinates, 0, simplifiedEndss);
|
simplifiedFlatCoordinates, 0, simplifiedEndss);
|
||||||
var simplifiedMultiPolygon = new _ol_geom_MultiPolygon_(null);
|
var simplifiedMultiPolygon = new MultiPolygon(null);
|
||||||
simplifiedMultiPolygon.setFlatCoordinates(
|
simplifiedMultiPolygon.setFlatCoordinates(
|
||||||
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates, simplifiedEndss);
|
_ol_geom_GeometryLayout_.XY, simplifiedFlatCoordinates, simplifiedEndss);
|
||||||
return simplifiedMultiPolygon;
|
return simplifiedMultiPolygon;
|
||||||
@@ -279,7 +279,7 @@ _ol_geom_MultiPolygon_.prototype.getSimplifiedGeometryInternal = function(square
|
|||||||
* @return {ol.geom.Polygon} Polygon.
|
* @return {ol.geom.Polygon} Polygon.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getPolygon = function(index) {
|
MultiPolygon.prototype.getPolygon = function(index) {
|
||||||
if (index < 0 || this.endss_.length <= index) {
|
if (index < 0 || this.endss_.length <= index) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -310,7 +310,7 @@ _ol_geom_MultiPolygon_.prototype.getPolygon = function(index) {
|
|||||||
* @return {Array.<ol.geom.Polygon>} Polygons.
|
* @return {Array.<ol.geom.Polygon>} Polygons.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getPolygons = function() {
|
MultiPolygon.prototype.getPolygons = function() {
|
||||||
var layout = this.layout;
|
var layout = this.layout;
|
||||||
var flatCoordinates = this.flatCoordinates;
|
var flatCoordinates = this.flatCoordinates;
|
||||||
var endss = this.endss_;
|
var endss = this.endss_;
|
||||||
@@ -339,7 +339,7 @@ _ol_geom_MultiPolygon_.prototype.getPolygons = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.getType = function() {
|
MultiPolygon.prototype.getType = function() {
|
||||||
return _ol_geom_GeometryType_.MULTI_POLYGON;
|
return _ol_geom_GeometryType_.MULTI_POLYGON;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ _ol_geom_MultiPolygon_.prototype.getType = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.intersectsExtent = function(extent) {
|
MultiPolygon.prototype.intersectsExtent = function(extent) {
|
||||||
return _ol_geom_flat_intersectsextent_.linearRingss(
|
return _ol_geom_flat_intersectsextent_.linearRingss(
|
||||||
this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, extent);
|
this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, extent);
|
||||||
};
|
};
|
||||||
@@ -361,7 +361,7 @@ _ol_geom_MultiPolygon_.prototype.intersectsExtent = function(extent) {
|
|||||||
* @override
|
* @override
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.setCoordinates = function(coordinates, opt_layout) {
|
MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout) {
|
||||||
if (!coordinates) {
|
if (!coordinates) {
|
||||||
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null, this.endss_);
|
this.setFlatCoordinates(_ol_geom_GeometryLayout_.XY, null, this.endss_);
|
||||||
} else {
|
} else {
|
||||||
@@ -388,7 +388,7 @@ _ol_geom_MultiPolygon_.prototype.setCoordinates = function(coordinates, opt_layo
|
|||||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||||
* @param {Array.<Array.<number>>} endss Endss.
|
* @param {Array.<Array.<number>>} endss Endss.
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) {
|
MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) {
|
||||||
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
this.setFlatCoordinatesInternal(layout, flatCoordinates);
|
||||||
this.endss_ = endss;
|
this.endss_ = endss;
|
||||||
this.changed();
|
this.changed();
|
||||||
@@ -398,7 +398,7 @@ _ol_geom_MultiPolygon_.prototype.setFlatCoordinates = function(layout, flatCoord
|
|||||||
/**
|
/**
|
||||||
* @param {Array.<ol.geom.Polygon>} polygons Polygons.
|
* @param {Array.<ol.geom.Polygon>} polygons Polygons.
|
||||||
*/
|
*/
|
||||||
_ol_geom_MultiPolygon_.prototype.setPolygons = function(polygons) {
|
MultiPolygon.prototype.setPolygons = function(polygons) {
|
||||||
var layout = this.getLayout();
|
var layout = this.getLayout();
|
||||||
var flatCoordinates = [];
|
var flatCoordinates = [];
|
||||||
var endss = [];
|
var endss = [];
|
||||||
@@ -419,4 +419,4 @@ _ol_geom_MultiPolygon_.prototype.setPolygons = function(polygons) {
|
|||||||
}
|
}
|
||||||
this.setFlatCoordinates(layout, flatCoordinates, endss);
|
this.setFlatCoordinates(layout, flatCoordinates, endss);
|
||||||
};
|
};
|
||||||
export default _ol_geom_MultiPolygon_;
|
export default MultiPolygon;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
|||||||
import LineString from '../geom/LineString.js';
|
import LineString from '../geom/LineString.js';
|
||||||
import MultiLineString from '../geom/MultiLineString.js';
|
import MultiLineString from '../geom/MultiLineString.js';
|
||||||
import MultiPoint from '../geom/MultiPoint.js';
|
import MultiPoint from '../geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../geom/MultiPolygon.js';
|
import MultiPolygon from '../geom/MultiPolygon.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon from '../geom/Polygon.js';
|
import Polygon from '../geom/Polygon.js';
|
||||||
import _ol_interaction_DrawEventType_ from '../interaction/DrawEventType.js';
|
import _ol_interaction_DrawEventType_ from '../interaction/DrawEventType.js';
|
||||||
@@ -676,7 +676,7 @@ _ol_interaction_Draw_.prototype.finishDrawing = function() {
|
|||||||
} else if (this.type_ === _ol_geom_GeometryType_.MULTI_LINE_STRING) {
|
} else if (this.type_ === _ol_geom_GeometryType_.MULTI_LINE_STRING) {
|
||||||
sketchFeature.setGeometry(new MultiLineString([coordinates]));
|
sketchFeature.setGeometry(new MultiLineString([coordinates]));
|
||||||
} else if (this.type_ === _ol_geom_GeometryType_.MULTI_POLYGON) {
|
} else if (this.type_ === _ol_geom_GeometryType_.MULTI_POLYGON) {
|
||||||
sketchFeature.setGeometry(new _ol_geom_MultiPolygon_([coordinates]));
|
sketchFeature.setGeometry(new MultiPolygon([coordinates]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// First dispatch event to allow full set up of feature
|
// First dispatch event to allow full set up of feature
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../../src/ol/View.js';
|
import _ol_View_ from '../../../../src/ol/View.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_layer_Tile_ from '../../../../src/ol/layer/Tile.js';
|
import _ol_layer_Tile_ from '../../../../src/ol/layer/Tile.js';
|
||||||
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
|
import _ol_source_XYZ_ from '../../../../src/ol/source/XYZ.js';
|
||||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||||
@@ -64,7 +64,7 @@ describe('layer clipping', function() {
|
|||||||
source: source
|
source: source
|
||||||
});
|
});
|
||||||
|
|
||||||
var geometry = new _ol_geom_MultiPolygon_([
|
var geometry = new MultiPolygon([
|
||||||
[[[-80, -40], [-40, 0], [-80, 40], [-120, 0], [-80, -40]]],
|
[[[-80, -40], [-40, 0], [-80, 40], [-120, 0], [-80, -40]]],
|
||||||
[[[80, -40], [120, 0], [80, 40], [40, 0], [80, -40]]]
|
[[[80, -40], [120, 0], [80, 40], [40, 0], [80, -40]]]
|
||||||
]).transform('EPSG:4326', 'EPSG:3857');
|
]).transform('EPSG:4326', 'EPSG:3857');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_Map_ from '../../../../src/ol/Map.js';
|
import _ol_Map_ from '../../../../src/ol/Map.js';
|
||||||
@@ -307,7 +307,7 @@ describe('ol.rendering.style.Text', function() {
|
|||||||
createMap('canvas');
|
createMap('canvas');
|
||||||
var geom = new Polygon(null);
|
var geom = new Polygon(null);
|
||||||
geom.setFlatCoordinates('XY', polygon, [polygon.length]);
|
geom.setFlatCoordinates('XY', polygon, [polygon.length]);
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_(null);
|
var multiPolygon = new MultiPolygon(null);
|
||||||
multiPolygon.appendPolygon(geom);
|
multiPolygon.appendPolygon(geom);
|
||||||
geom = geom.clone();
|
geom = geom.clone();
|
||||||
geom.translate(0, 30);
|
geom.translate(0, 30);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import LineString from '../../../../src/ol/geom/LineString.js';
|
|||||||
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
||||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
|
||||||
@@ -217,7 +217,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
var feature = format.readFeature(multiPolygonEsriJSON);
|
var feature = format.readFeature(multiPolygonEsriJSON);
|
||||||
expect(feature).to.be.an(_ol_Feature_);
|
expect(feature).to.be.an(_ol_Feature_);
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
expect(geometry).to.be.an(_ol_geom_MultiPolygon_);
|
expect(geometry).to.be.an(MultiPolygon);
|
||||||
expect(geometry.getCoordinates()).to.eql([
|
expect(geometry.getCoordinates()).to.eql([
|
||||||
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2], [3, 3], [2, 3]]],
|
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2], [3, 3], [2, 3]]],
|
||||||
[[[10, 1], [11, 5], [14, 3], [13, 0]]]
|
[[[10, 1], [11, 5], [14, 3], [13, 0]]]
|
||||||
@@ -644,7 +644,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_MultiPolygon_);
|
expect(obj).to.be.a(MultiPolygon);
|
||||||
expect(obj.getLayout()).to.eql('XY');
|
expect(obj.getLayout()).to.eql('XY');
|
||||||
expect(obj.getCoordinates()).to.eql([
|
expect(obj.getCoordinates()).to.eql([
|
||||||
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2],
|
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2],
|
||||||
@@ -663,7 +663,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
hasZ: true
|
hasZ: true
|
||||||
});
|
});
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_MultiPolygon_);
|
expect(obj).to.be.a(MultiPolygon);
|
||||||
expect(obj.getLayout()).to.eql('XYZ');
|
expect(obj.getLayout()).to.eql('XYZ');
|
||||||
expect(obj.getCoordinates()).to.eql([
|
expect(obj.getCoordinates()).to.eql([
|
||||||
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
||||||
@@ -682,7 +682,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
hasM: true
|
hasM: true
|
||||||
});
|
});
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_MultiPolygon_);
|
expect(obj).to.be.a(MultiPolygon);
|
||||||
expect(obj.getLayout()).to.eql('XYM');
|
expect(obj.getLayout()).to.eql('XYM');
|
||||||
expect(obj.getCoordinates()).to.eql([
|
expect(obj.getCoordinates()).to.eql([
|
||||||
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
||||||
@@ -702,7 +702,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
hasM: true
|
hasM: true
|
||||||
});
|
});
|
||||||
var obj = format.readGeometry(str);
|
var obj = format.readGeometry(str);
|
||||||
expect(obj).to.be.a(_ol_geom_MultiPolygon_);
|
expect(obj).to.be.a(MultiPolygon);
|
||||||
expect(obj.getLayout()).to.eql('XYZM');
|
expect(obj.getLayout()).to.eql('XYZM');
|
||||||
expect(obj.getCoordinates()).to.eql([
|
expect(obj.getCoordinates()).to.eql([
|
||||||
[[[0, 1, 0, 1], [1, 4, 0, 1], [4, 3, 0, 1], [3, 0, 0, 1]],
|
[[[0, 1, 0, 1], [1, 4, 0, 1], [4, 3, 0, 1], [3, 0, 0, 1]],
|
||||||
@@ -945,7 +945,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes multipolygon', function() {
|
it('encodes multipolygon', function() {
|
||||||
var multipolygon = new _ol_geom_MultiPolygon_([
|
var multipolygon = new MultiPolygon([
|
||||||
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2], [3, 3], [2, 3]]],
|
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2], [3, 3], [2, 3]]],
|
||||||
[[[10, 1], [11, 5], [14, 3], [13, 0]]]
|
[[[10, 1], [11, 5], [14, 3], [13, 0]]]
|
||||||
]);
|
]);
|
||||||
@@ -955,7 +955,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYZ multipolygon', function() {
|
it('encodes XYZ multipolygon', function() {
|
||||||
var multipolygon = new _ol_geom_MultiPolygon_([
|
var multipolygon = new MultiPolygon([
|
||||||
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
||||||
[3, 3, 0], [2, 3, 0]]],
|
[3, 3, 0], [2, 3, 0]]],
|
||||||
[[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]]
|
[[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]]
|
||||||
@@ -966,7 +966,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYM multipolygon', function() {
|
it('encodes XYM multipolygon', function() {
|
||||||
var multipolygon = new _ol_geom_MultiPolygon_([
|
var multipolygon = new MultiPolygon([
|
||||||
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
||||||
[3, 3, 0], [2, 3, 0]]],
|
[3, 3, 0], [2, 3, 0]]],
|
||||||
[[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]]
|
[[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]]
|
||||||
@@ -977,7 +977,7 @@ describe('ol.format.EsriJSON', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('encodes XYZM multipolygon', function() {
|
it('encodes XYZM multipolygon', function() {
|
||||||
var multipolygon = new _ol_geom_MultiPolygon_([
|
var multipolygon = new MultiPolygon([
|
||||||
[[[0, 1, 0, 1], [1, 4, 0, 1], [4, 3, 0, 3], [3, 0, 0, 3]],
|
[[[0, 1, 0, 1], [1, 4, 0, 1], [4, 3, 0, 3], [3, 0, 0, 3]],
|
||||||
[[2, 2, 0, 3], [3, 2, 0, 4],
|
[[2, 2, 0, 3], [3, 2, 0, 4],
|
||||||
[3, 3, 0, 1], [2, 3, 0, 1]]],
|
[3, 3, 0, 1], [2, 3, 0, 1]]],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
|
|||||||
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
|
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
|
||||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||||
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {fromLonLat, get as getProjection, toLonLat, transform} from '../../../../src/ol/proj.js';
|
import {fromLonLat, get as getProjection, toLonLat, transform} from '../../../../src/ol/proj.js';
|
||||||
@@ -634,9 +634,9 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
|
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
|
||||||
|
|
||||||
var right = new Polygon([ccw, cw]);
|
var right = new Polygon([ccw, cw]);
|
||||||
var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]);
|
var rightMulti = new MultiPolygon([[ccw, cw]]);
|
||||||
var left = new Polygon([cw, ccw]);
|
var left = new Polygon([cw, ccw]);
|
||||||
var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]);
|
var leftMulti = new MultiPolygon([[cw, ccw]]);
|
||||||
|
|
||||||
var rightObj = {
|
var rightObj = {
|
||||||
type: 'Polygon',
|
type: 'Polygon',
|
||||||
@@ -671,9 +671,9 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]];
|
var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]];
|
||||||
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
|
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
|
||||||
var right = new Polygon([ccw, cw]);
|
var right = new Polygon([ccw, cw]);
|
||||||
var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]);
|
var rightMulti = new MultiPolygon([[ccw, cw]]);
|
||||||
var left = new Polygon([cw, ccw]);
|
var left = new Polygon([cw, ccw]);
|
||||||
var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]);
|
var leftMulti = new MultiPolygon([[cw, ccw]]);
|
||||||
|
|
||||||
var rightObj = {
|
var rightObj = {
|
||||||
type: 'Polygon',
|
type: 'Polygon',
|
||||||
@@ -702,9 +702,9 @@ describe('ol.format.GeoJSON', function() {
|
|||||||
var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]];
|
var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]];
|
||||||
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
|
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
|
||||||
var right = new Polygon([ccw, cw]);
|
var right = new Polygon([ccw, cw]);
|
||||||
var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]);
|
var rightMulti = new MultiPolygon([[ccw, cw]]);
|
||||||
var left = new Polygon([cw, ccw]);
|
var left = new Polygon([cw, ccw]);
|
||||||
var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]);
|
var leftMulti = new MultiPolygon([[cw, ccw]]);
|
||||||
|
|
||||||
var leftObj = {
|
var leftObj = {
|
||||||
type: 'Polygon',
|
type: 'Polygon',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import LineString from '../../../../src/ol/geom/LineString.js';
|
|||||||
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
||||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {transform} from '../../../../src/ol/proj.js';
|
import {transform} from '../../../../src/ol/proj.js';
|
||||||
@@ -118,7 +118,7 @@ describe('ol.format.GML2', function() {
|
|||||||
'</gml:MultiPolygon>';
|
'</gml:MultiPolygon>';
|
||||||
|
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_MultiPolygon_);
|
expect(g).to.be.an(MultiPolygon);
|
||||||
expect(g.getCoordinates()).to.eql([
|
expect(g.getCoordinates()).to.eql([
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
@@ -319,7 +319,7 @@ describe('ol.format.GML2', function() {
|
|||||||
' </layer>';
|
' </layer>';
|
||||||
|
|
||||||
var feature = new _ol_Feature_({
|
var feature = new _ol_Feature_({
|
||||||
geometry: new _ol_geom_MultiPolygon_([[[[1.1, 2], [3, 4.2], [5.2, 6]]]])
|
geometry: new MultiPolygon([[[[1.1, 2], [3, 4.2], [5.2, 6]]]])
|
||||||
});
|
});
|
||||||
feature.setId(1);
|
feature.setId(1);
|
||||||
var objectStack = [{
|
var objectStack = [{
|
||||||
@@ -844,7 +844,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' </gml:polygonMember>' +
|
' </gml:polygonMember>' +
|
||||||
'</gml:MultiPolygon>';
|
'</gml:MultiPolygon>';
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_MultiPolygon_);
|
expect(g).to.be.an(MultiPolygon);
|
||||||
expect(g.getCoordinates()).to.eql([
|
expect(g.getCoordinates()).to.eql([
|
||||||
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
||||||
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
||||||
@@ -887,7 +887,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' </gml:polygonMembers>' +
|
' </gml:polygonMembers>' +
|
||||||
'</gml:MultiPolygon>';
|
'</gml:MultiPolygon>';
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_MultiPolygon_);
|
expect(g).to.be.an(MultiPolygon);
|
||||||
expect(g.getCoordinates()).to.eql([
|
expect(g.getCoordinates()).to.eql([
|
||||||
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
||||||
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
||||||
@@ -1001,7 +1001,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' </gml:surfaceMember>' +
|
' </gml:surfaceMember>' +
|
||||||
'</gml:MultiSurface>';
|
'</gml:MultiSurface>';
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_MultiPolygon_);
|
expect(g).to.be.an(MultiPolygon);
|
||||||
expect(g.getCoordinates()).to.eql([
|
expect(g.getCoordinates()).to.eql([
|
||||||
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
||||||
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
||||||
@@ -1045,7 +1045,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' </gml:surfaceMembers>' +
|
' </gml:surfaceMembers>' +
|
||||||
'</gml:MultiSurface>';
|
'</gml:MultiSurface>';
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_MultiPolygon_);
|
expect(g).to.be.an(MultiPolygon);
|
||||||
expect(g.getCoordinates()).to.eql([
|
expect(g.getCoordinates()).to.eql([
|
||||||
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
||||||
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
||||||
@@ -1103,7 +1103,7 @@ describe('ol.format.GML3', function() {
|
|||||||
' </gml:surfaceMember>' +
|
' </gml:surfaceMember>' +
|
||||||
'</gml:MultiSurface>';
|
'</gml:MultiSurface>';
|
||||||
var g = readGeometry(format, text);
|
var g = readGeometry(format, text);
|
||||||
expect(g).to.be.an(_ol_geom_MultiPolygon_);
|
expect(g).to.be.an(MultiPolygon);
|
||||||
expect(g.getCoordinates()).to.eql([
|
expect(g.getCoordinates()).to.eql([
|
||||||
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
|
||||||
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
|
||||||
@@ -1308,7 +1308,7 @@ describe('ol.format.GML3', function() {
|
|||||||
feature = features[0];
|
feature = features[0];
|
||||||
expect(feature.getId()).to.equal('states.1');
|
expect(feature.getId()).to.equal('states.1');
|
||||||
expect(feature.get('STATE_NAME')).to.equal('Illinois');
|
expect(feature.get('STATE_NAME')).to.equal('Illinois');
|
||||||
expect(feature.getGeometry()).to.be.an(_ol_geom_MultiPolygon_);
|
expect(feature.getGeometry()).to.be.an(MultiPolygon);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -1334,7 +1334,7 @@ describe('ol.format.GML3', function() {
|
|||||||
it('creates 2 geometries', function() {
|
it('creates 2 geometries', function() {
|
||||||
var feature = features[0];
|
var feature = features[0];
|
||||||
expect(feature.get('center')).to.be.a(Point);
|
expect(feature.get('center')).to.be.a(Point);
|
||||||
expect(feature.get('the_geom')).to.be.a(_ol_geom_MultiPolygon_);
|
expect(feature.get('the_geom')).to.be.a(MultiPolygon);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import LineString from '../../../../src/ol/geom/LineString.js';
|
|||||||
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
||||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {addProjection, addCoordinateTransforms, transform, get as getProjection} from '../../../../src/ol/proj.js';
|
import {addProjection, addCoordinateTransforms, transform, get as getProjection} from '../../../../src/ol/proj.js';
|
||||||
@@ -876,7 +876,7 @@ describe('ol.format.KML', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_MultiPolygon_);
|
expect(g).to.be.an(MultiPolygon);
|
||||||
expect(g.getCoordinates()).to.eql(
|
expect(g.getCoordinates()).to.eql(
|
||||||
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]]);
|
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]]);
|
||||||
@@ -892,7 +892,7 @@ describe('ol.format.KML', function() {
|
|||||||
|
|
||||||
it('can write MultiPolygon geometries', function() {
|
it('can write MultiPolygon geometries', function() {
|
||||||
var layout = 'XYZ';
|
var layout = 'XYZ';
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_(
|
var multiPolygon = new MultiPolygon(
|
||||||
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]], layout);
|
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]], layout);
|
||||||
var features = [new _ol_Feature_(multiPolygon)];
|
var features = [new _ol_Feature_(multiPolygon)];
|
||||||
@@ -1080,7 +1080,7 @@ describe('ol.format.KML', function() {
|
|||||||
var f = fs[0];
|
var f = fs[0];
|
||||||
expect(f).to.be.an(_ol_Feature_);
|
expect(f).to.be.an(_ol_Feature_);
|
||||||
var g = f.getGeometry();
|
var g = f.getGeometry();
|
||||||
expect(g).to.be.an(_ol_geom_MultiPolygon_);
|
expect(g).to.be.an(MultiPolygon);
|
||||||
expect(g.getCoordinates()).to.eql([
|
expect(g.getCoordinates()).to.eql([
|
||||||
[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]
|
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]
|
||||||
@@ -1097,7 +1097,7 @@ describe('ol.format.KML', function() {
|
|||||||
|
|
||||||
it('can write MultiPolygon geometries', function() {
|
it('can write MultiPolygon geometries', function() {
|
||||||
var layout = 'XYZ';
|
var layout = 'XYZ';
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_([
|
var multiPolygon = new MultiPolygon([
|
||||||
[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]
|
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]
|
||||||
], layout);
|
], layout);
|
||||||
@@ -3199,7 +3199,7 @@ describe('ol.format.KML', function() {
|
|||||||
var components = geometry.getGeometries();
|
var components = geometry.getGeometries();
|
||||||
expect(components).to.have.length(2);
|
expect(components).to.have.length(2);
|
||||||
expect(components[0]).to.be.an(Point);
|
expect(components[0]).to.be.an(Point);
|
||||||
expect(components[1]).to.be.an(_ol_geom_MultiPolygon_);
|
expect(components[1]).to.be.an(MultiPolygon);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reads style and icon', function() {
|
it('reads style and icon', function() {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
|||||||
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
|
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
|
||||||
import Point from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
|
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
|
||||||
|
|
||||||
where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
|
where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
|
||||||
@@ -159,7 +159,7 @@ describe('ol.format.MVT', function() {
|
|||||||
var feature = format.createFeature_({}, rawFeature);
|
var feature = format.createFeature_({}, rawFeature);
|
||||||
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
|
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
|
||||||
var geometry = feature.getGeometry();
|
var geometry = feature.getGeometry();
|
||||||
expect(geometry).to.be.a(_ol_geom_MultiPolygon_);
|
expect(geometry).to.be.a(MultiPolygon);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates ol.render.Feature instances', function() {
|
it('creates ol.render.Feature instances', function() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_format_Feature_ from '../../../../src/ol/format/Feature.js';
|
import _ol_format_Feature_ from '../../../../src/ol/format/Feature.js';
|
||||||
import {transform} from '../../../../src/ol/proj.js';
|
import {transform} from '../../../../src/ol/proj.js';
|
||||||
@@ -157,7 +157,7 @@ describe('ol.format.TopoJSON', function() {
|
|||||||
var first = features[0];
|
var first = features[0];
|
||||||
expect(first).to.be.a(_ol_Feature_);
|
expect(first).to.be.a(_ol_Feature_);
|
||||||
var firstGeom = first.getGeometry();
|
var firstGeom = first.getGeometry();
|
||||||
expect(firstGeom).to.be.a(_ol_geom_MultiPolygon_);
|
expect(firstGeom).to.be.a(MultiPolygon);
|
||||||
expect(firstGeom.getExtent()).to.eql(
|
expect(firstGeom.getExtent()).to.eql(
|
||||||
[-180, -85.60903777459777, 180, 83.64513000000002]);
|
[-180, -85.60903777459777, 180, 83.64513000000002]);
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import _ol_format_filter_ from '../../../../src/ol/format/filter.js';
|
|||||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import {transform} from '../../../../src/ol/proj.js';
|
import {transform} from '../../../../src/ol/proj.js';
|
||||||
import _ol_xml_ from '../../../../src/ol/xml.js';
|
import _ol_xml_ from '../../../../src/ol/xml.js';
|
||||||
@@ -55,7 +55,7 @@ describe('ol.format.WFS', function() {
|
|||||||
feature = features[0];
|
feature = features[0];
|
||||||
expect(feature.getId()).to.equal('states.1');
|
expect(feature.getId()).to.equal('states.1');
|
||||||
expect(feature.get('STATE_NAME')).to.equal('Illinois');
|
expect(feature.get('STATE_NAME')).to.equal('Illinois');
|
||||||
expect(feature.getGeometry()).to.be.an(_ol_geom_MultiPolygon_);
|
expect(feature.getGeometry()).to.be.an(MultiPolygon);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('transforms and creates a polygon for Illinois', function() {
|
it('transforms and creates a polygon for Illinois', function() {
|
||||||
@@ -66,7 +66,7 @@ describe('ol.format.WFS', function() {
|
|||||||
expect(feature.getId()).to.equal('states.1');
|
expect(feature.getId()).to.equal('states.1');
|
||||||
expect(feature.get('STATE_NAME')).to.equal('Illinois');
|
expect(feature.get('STATE_NAME')).to.equal('Illinois');
|
||||||
var geom = feature.getGeometry();
|
var geom = feature.getGeometry();
|
||||||
expect(geom).to.be.an(_ol_geom_MultiPolygon_);
|
expect(geom).to.be.an(MultiPolygon);
|
||||||
var p = transform([-88.071, 37.511], 'EPSG:4326', 'EPSG:3857');
|
var p = transform([-88.071, 37.511], 'EPSG:4326', 'EPSG:3857');
|
||||||
p.push(0);
|
p.push(0);
|
||||||
expect(geom.getFirstCoordinate()).to.eql(p);
|
expect(geom.getFirstCoordinate()).to.eql(p);
|
||||||
@@ -106,7 +106,7 @@ describe('ol.format.WFS', function() {
|
|||||||
expect(feature.get('name')).to.equal('My Polygon with hole');
|
expect(feature.get('name')).to.equal('My Polygon with hole');
|
||||||
expect(feature.get('boundedBy')).to.eql(
|
expect(feature.get('boundedBy')).to.eql(
|
||||||
[47.003018, -0.768746, 47.925567, 0.532597]);
|
[47.003018, -0.768746, 47.925567, 0.532597]);
|
||||||
expect(feature.getGeometry()).to.be.an(_ol_geom_MultiPolygon_);
|
expect(feature.getGeometry()).to.be.an(MultiPolygon);
|
||||||
expect(feature.getGeometry().getFlatCoordinates()).
|
expect(feature.getGeometry().getFlatCoordinates()).
|
||||||
to.have.length(60);
|
to.have.length(60);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_geom_flat_center_ from '../../../../../src/ol/geom/flat/center.js';
|
import _ol_geom_flat_center_ from '../../../../../src/ol/geom/flat/center.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
|
|
||||||
|
|
||||||
describe('ol.geom.flat.center', function() {
|
describe('ol.geom.flat.center', function() {
|
||||||
@@ -7,7 +7,7 @@ describe('ol.geom.flat.center', function() {
|
|||||||
describe('ol.geom.flat.center.linearRingss', function() {
|
describe('ol.geom.flat.center.linearRingss', function() {
|
||||||
|
|
||||||
it('calculates the center of a square', function() {
|
it('calculates the center of a square', function() {
|
||||||
var squareMultiPoly = new _ol_geom_MultiPolygon_([[
|
var squareMultiPoly = new MultiPolygon([[
|
||||||
[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]
|
[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]
|
||||||
]]);
|
]]);
|
||||||
var got = _ol_geom_flat_center_.linearRingss(
|
var got = _ol_geom_flat_center_.linearRingss(
|
||||||
@@ -20,7 +20,7 @@ describe('ol.geom.flat.center', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('calculates the centers of two squares', function() {
|
it('calculates the centers of two squares', function() {
|
||||||
var squareMultiPoly = new _ol_geom_MultiPolygon_([
|
var squareMultiPoly = new MultiPolygon([
|
||||||
[
|
[
|
||||||
[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]
|
[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]
|
||||||
],
|
],
|
||||||
@@ -38,7 +38,7 @@ describe('ol.geom.flat.center', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('does not care about holes', function() {
|
it('does not care about holes', function() {
|
||||||
var polywithHole = new _ol_geom_MultiPolygon_([[
|
var polywithHole = new MultiPolygon([[
|
||||||
[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]],
|
[[0, 0], [0, 5], [5, 5], [5, 0], [0, 0]],
|
||||||
[[1, 1], [1, 4], [4, 4], [4, 1], [1, 1]]
|
[[1, 1], [1, 4], [4, 4], [4, 1], [1, 1]]
|
||||||
]]);
|
]]);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_geom_SimpleGeometry_ from '../../../../../src/ol/geom/SimpleGeometry.js';
|
import _ol_geom_SimpleGeometry_ from '../../../../../src/ol/geom/SimpleGeometry.js';
|
||||||
import _ol_geom_flat_transform_ from '../../../../../src/ol/geom/flat/transform.js';
|
import _ol_geom_flat_transform_ from '../../../../../src/ol/geom/flat/transform.js';
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ describe('ol.geom.flat.transform', function() {
|
|||||||
|
|
||||||
it('transforms a Simple Geometry to 2D', function() {
|
it('transforms a Simple Geometry to 2D', function() {
|
||||||
|
|
||||||
var multiPolygonGeometry = new _ol_geom_MultiPolygon_([
|
var multiPolygonGeometry = new MultiPolygon([
|
||||||
[[[-80.736061, 28.788576000000006, 0],
|
[[[-80.736061, 28.788576000000006, 0],
|
||||||
[-80.763557, 28.821799999999996, 0],
|
[-80.763557, 28.821799999999996, 0],
|
||||||
[-80.817406, 28.895123999999996, 0],
|
[-80.817406, 28.895123999999996, 0],
|
||||||
@@ -69,7 +69,7 @@ describe('ol.geom.flat.transform', function() {
|
|||||||
|
|
||||||
describe('ol.geom.flat.transform.translate', function() {
|
describe('ol.geom.flat.transform.translate', function() {
|
||||||
it('translates the coordinates array', function() {
|
it('translates the coordinates array', function() {
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_([
|
var multiPolygon = new MultiPolygon([
|
||||||
[[[0, 0, 2], [0, 1, 2], [1, 1, 2], [1, 0, 2], [0, 0, 2]]],
|
[[[0, 0, 2], [0, 1, 2], [1, 1, 2], [1, 0, 2], [0, 0, 2]]],
|
||||||
[[[2, 2, 3], [2, 3, 3], [3, 3, 3], [3, 2, 3], [2, 2, 3]]]]);
|
[[[2, 2, 3], [2, 3, 3], [3, 3, 3], [3, 2, 3], [2, 2, 3]]]]);
|
||||||
var flatCoordinates = multiPolygon.getFlatCoordinates();
|
var flatCoordinates = multiPolygon.getFlatCoordinates();
|
||||||
@@ -86,7 +86,7 @@ describe('ol.geom.flat.transform', function() {
|
|||||||
|
|
||||||
describe('ol.geom.flat.transform.rotate', function() {
|
describe('ol.geom.flat.transform.rotate', function() {
|
||||||
it('rotates the coordinates array', function() {
|
it('rotates the coordinates array', function() {
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_([
|
var multiPolygon = new MultiPolygon([
|
||||||
[[[0, 0, 2], [0, 1, 2], [1, 1, 2], [1, 0, 2], [0, 0, 2]]],
|
[[[0, 0, 2], [0, 1, 2], [1, 1, 2], [1, 0, 2], [0, 0, 2]]],
|
||||||
[[[2, 2, 3], [2, 3, 3], [3, 3, 3], [3, 2, 3], [2, 2, 3]]]]);
|
[[[2, 2, 3], [2, 3, 3], [3, 3, 3], [3, 2, 3], [2, 2, 3]]]]);
|
||||||
var flatCoordinates = multiPolygon.getFlatCoordinates();
|
var flatCoordinates = multiPolygon.getFlatCoordinates();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
|
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
it('can be constructed with a null geometry', function() {
|
it('can be constructed with a null geometry', function() {
|
||||||
expect(function() {
|
expect(function() {
|
||||||
return new _ol_geom_MultiPolygon_(null);
|
return new MultiPolygon(null);
|
||||||
}).not.to.throwException();
|
}).not.to.throwException();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
var multiPolygon;
|
var multiPolygon;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
multiPolygon = new _ol_geom_MultiPolygon_(null);
|
multiPolygon = new MultiPolygon(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can append polygons', function() {
|
it('can append polygons', function() {
|
||||||
@@ -37,7 +37,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
var multiPolygon;
|
var multiPolygon;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
multiPolygon = new _ol_geom_MultiPolygon_([]);
|
multiPolygon = new MultiPolygon([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can append polygons', function() {
|
it('can append polygons', function() {
|
||||||
@@ -59,7 +59,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
describe('#scale()', function() {
|
describe('#scale()', function() {
|
||||||
|
|
||||||
it('scales a multi-polygon', function() {
|
it('scales a multi-polygon', function() {
|
||||||
var geom = new _ol_geom_MultiPolygon_([[
|
var geom = new MultiPolygon([[
|
||||||
[[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]]
|
[[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]]
|
||||||
]]);
|
]]);
|
||||||
geom.scale(10);
|
geom.scale(10);
|
||||||
@@ -68,7 +68,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('accepts sx and sy', function() {
|
it('accepts sx and sy', function() {
|
||||||
var geom = new _ol_geom_MultiPolygon_([[
|
var geom = new MultiPolygon([[
|
||||||
[[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]]
|
[[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]]
|
||||||
]]);
|
]]);
|
||||||
geom.scale(2, 3);
|
geom.scale(2, 3);
|
||||||
@@ -77,7 +77,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('accepts an anchor', function() {
|
it('accepts an anchor', function() {
|
||||||
var geom = new _ol_geom_MultiPolygon_([[
|
var geom = new MultiPolygon([[
|
||||||
[[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]]
|
[[-1, -2], [1, -2], [1, 2], [-1, 2], [-1, -2]]
|
||||||
]]);
|
]]);
|
||||||
geom.scale(3, 2, [-1, -2]);
|
geom.scale(3, 2, [-1, -2]);
|
||||||
@@ -91,7 +91,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
var multiPolygon;
|
var multiPolygon;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
multiPolygon = new _ol_geom_MultiPolygon_([
|
multiPolygon = new MultiPolygon([
|
||||||
[[[0, 0], [0, 2], [1, 1], [2, 0]]],
|
[[[0, 0], [0, 2], [1, 1], [2, 0]]],
|
||||||
[[[3, 0], [4, 1], [5, 2], [5, 0]]]
|
[[[3, 0], [4, 1], [5, 2], [5, 0]]]
|
||||||
]);
|
]);
|
||||||
@@ -135,8 +135,8 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
var cw2 = [[-140, -60], [-140, 60], [140, 60], [140, -60], [-140, -60]];
|
var cw2 = [[-140, -60], [-140, 60], [140, 60], [140, -60], [-140, -60]];
|
||||||
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
|
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
|
||||||
var ccw2 = [[-140, -60], [140, -60], [140, 60], [-140, 60], [-140, -60]];
|
var ccw2 = [[-140, -60], [140, -60], [140, 60], [-140, 60], [-140, -60]];
|
||||||
var right = new _ol_geom_MultiPolygon_([[ccw, cw], [ccw2, cw2]]);
|
var right = new MultiPolygon([[ccw, cw], [ccw2, cw2]]);
|
||||||
var left = new _ol_geom_MultiPolygon_([[cw, ccw], [cw2, ccw2]]);
|
var left = new MultiPolygon([[cw, ccw], [cw2, ccw2]]);
|
||||||
|
|
||||||
it('returns coordinates as they were constructed', function() {
|
it('returns coordinates as they were constructed', function() {
|
||||||
expect(right.getCoordinates()).to.eql([[ccw, cw], [ccw2, cw2]]);
|
expect(right.getCoordinates()).to.eql([[ccw, cw], [ccw2, cw2]]);
|
||||||
@@ -167,7 +167,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
|
|
||||||
it('returns the expected result', function() {
|
it('returns the expected result', function() {
|
||||||
var simplifiedGeometry = multiPolygon.getSimplifiedGeometry(1);
|
var simplifiedGeometry = multiPolygon.getSimplifiedGeometry(1);
|
||||||
expect(simplifiedGeometry).to.be.an(_ol_geom_MultiPolygon_);
|
expect(simplifiedGeometry).to.be.an(MultiPolygon);
|
||||||
expect(simplifiedGeometry.getCoordinates()).to.eql([
|
expect(simplifiedGeometry.getCoordinates()).to.eql([
|
||||||
[[[0, 0], [0, 2], [2, 0]]],
|
[[[0, 0], [0, 2], [2, 0]]],
|
||||||
[[[3, 0], [5, 2], [5, 0]]]
|
[[[3, 0], [5, 2], [5, 0]]]
|
||||||
@@ -196,7 +196,7 @@ describe('ol.geom.MultiPolygon', function() {
|
|||||||
describe('#getInteriorPoints', function() {
|
describe('#getInteriorPoints', function() {
|
||||||
|
|
||||||
it('returns XYM multipoint with intersection width as M', function() {
|
it('returns XYM multipoint with intersection width as M', function() {
|
||||||
var geom = new _ol_geom_MultiPolygon_([
|
var geom = new MultiPolygon([
|
||||||
[[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]],
|
[[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]],
|
||||||
[[[1, 1], [1, 2], [2, 2], [2, 1], [1, 1]]]
|
[[[1, 1], [1, 2], [2, 2], [2, 1], [1, 1]]]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
|
|||||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../src/ol/geom/Point.js';
|
import Point from '../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_interaction_Draw_ from '../../../../src/ol/interaction/Draw.js';
|
import _ol_interaction_Draw_ from '../../../../src/ol/interaction/Draw.js';
|
||||||
@@ -727,7 +727,7 @@ describe('ol.interaction.Draw', function() {
|
|||||||
var features = source.getFeatures();
|
var features = source.getFeatures();
|
||||||
expect(features).to.have.length(1);
|
expect(features).to.have.length(1);
|
||||||
var geometry = features[0].getGeometry();
|
var geometry = features[0].getGeometry();
|
||||||
expect(geometry).to.be.a(_ol_geom_MultiPolygon_);
|
expect(geometry).to.be.a(MultiPolygon);
|
||||||
var coordinates = geometry.getCoordinates();
|
var coordinates = geometry.getCoordinates();
|
||||||
expect(coordinates).to.have.length(1);
|
expect(coordinates).to.have.length(1);
|
||||||
|
|
||||||
@@ -759,7 +759,7 @@ describe('ol.interaction.Draw', function() {
|
|||||||
var features = source.getFeatures();
|
var features = source.getFeatures();
|
||||||
expect(features).to.have.length(1);
|
expect(features).to.have.length(1);
|
||||||
var geometry = features[0].getGeometry();
|
var geometry = features[0].getGeometry();
|
||||||
expect(geometry).to.be.a(_ol_geom_MultiPolygon_);
|
expect(geometry).to.be.a(MultiPolygon);
|
||||||
var coordinates = geometry.getCoordinates();
|
var coordinates = geometry.getCoordinates();
|
||||||
expect(coordinates).to.have.length(1);
|
expect(coordinates).to.have.length(1);
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCol
|
|||||||
import LineString from '../../../../../src/ol/geom/LineString.js';
|
import LineString from '../../../../../src/ol/geom/LineString.js';
|
||||||
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_VectorContext_ from '../../../../../src/ol/render/VectorContext.js';
|
import _ol_render_VectorContext_ from '../../../../../src/ol/render/VectorContext.js';
|
||||||
@@ -121,7 +121,7 @@ describe('ol.render.canvas.Immediate', function() {
|
|||||||
var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent);
|
var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent);
|
||||||
sinon.spy(context, 'drawMultiPolygon');
|
sinon.spy(context, 'drawMultiPolygon');
|
||||||
|
|
||||||
var geometry = new _ol_geom_MultiPolygon_([[[[1, 2], [3, 4], [5, 6], [1, 2]]]]);
|
var geometry = new MultiPolygon([[[[1, 2], [3, 4], [5, 6], [1, 2]]]]);
|
||||||
context.drawGeometry(geometry);
|
context.drawGeometry(geometry);
|
||||||
expect(context.drawMultiPolygon.calledOnce).to.be(true);
|
expect(context.drawMultiPolygon.calledOnce).to.be(true);
|
||||||
expect(context.drawMultiPolygon.firstCall.calledWithExactly(geometry)).to.be(true);
|
expect(context.drawMultiPolygon.firstCall.calledWithExactly(geometry)).to.be(true);
|
||||||
@@ -234,7 +234,7 @@ describe('ol.render.canvas.Immediate', function() {
|
|||||||
strokeStyle: '#00FFFF'
|
strokeStyle: '#00FFFF'
|
||||||
};
|
};
|
||||||
|
|
||||||
var multiPolygonGeometry = new _ol_geom_MultiPolygon_([[[
|
var multiPolygonGeometry = new MultiPolygon([[[
|
||||||
// first polygon
|
// first polygon
|
||||||
[-80.736061, 28.788576000000006, 0], // moveTo()
|
[-80.736061, 28.788576000000006, 0], // moveTo()
|
||||||
[-80.763557, 28.821799999999996, 0], // lineTo()
|
[-80.763557, 28.821799999999996, 0], // lineTo()
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_canvas_TextReplay_ from '../../../../../src/ol/render/canvas/TextReplay.js';
|
import _ol_render_canvas_TextReplay_ from '../../../../../src/ol/render/canvas/TextReplay.js';
|
||||||
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
|
import _ol_style_Text_ from '../../../../../src/ol/style/Text.js';
|
||||||
@@ -26,7 +26,7 @@ describe('ol.render.canvas.TextReplay', function() {
|
|||||||
|
|
||||||
it('renders multipolygon labels only when they fit', function() {
|
it('renders multipolygon labels only when they fit', function() {
|
||||||
var replay = new _ol_render_canvas_TextReplay_(1, [-180, -90, 180, 90], 0.02, 1, true);
|
var replay = new _ol_render_canvas_TextReplay_(1, [-180, -90, 180, 90], 0.02, 1, true);
|
||||||
var geometry = new _ol_geom_MultiPolygon_([
|
var geometry = new MultiPolygon([
|
||||||
[[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]],
|
[[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]],
|
||||||
[[[1, 1], [1, 2], [2, 2], [2, 1], [1, 1]]]
|
[[[1, 1], [1, 2], [2, 2], [2, 1], [1, 1]]]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
|
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ describe('ol.render.Feature', function() {
|
|||||||
|
|
||||||
describe('#getFlatInteriorPoints()', function() {
|
describe('#getFlatInteriorPoints()', function() {
|
||||||
it('returns correct points and caches them', function() {
|
it('returns correct points and caches them', function() {
|
||||||
var polygon = new _ol_geom_MultiPolygon_([
|
var polygon = new MultiPolygon([
|
||||||
[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]],
|
[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]],
|
||||||
[[[10, 0], [10, 10], [20, 10], [20, 0], [10, 0]]]
|
[[[10, 0], [10, 10], [20, 10], [20, 0], [10, 0]]]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCol
|
|||||||
import LineString from '../../../../../src/ol/geom/LineString.js';
|
import LineString from '../../../../../src/ol/geom/LineString.js';
|
||||||
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js';
|
import _ol_render_webgl_CircleReplay_ from '../../../../../src/ol/render/webgl/CircleReplay.js';
|
||||||
@@ -32,7 +32,7 @@ describe('ol.render.webgl.Immediate', function() {
|
|||||||
point = new Point([0, 0]);
|
point = new Point([0, 0]);
|
||||||
multiPoint = new MultiPoint([[0, 0]]);
|
multiPoint = new MultiPoint([[0, 0]]);
|
||||||
polygon = new Polygon([[[0, 0], [5, 5], [5, 0], [0, 0]]]);
|
polygon = new Polygon([[[0, 0], [5, 5], [5, 0], [0, 0]]]);
|
||||||
multiPolygon = new _ol_geom_MultiPolygon_([[[[0, 0], [5, 5], [5, 0], [0, 0]]]]);
|
multiPolygon = new MultiPolygon([[[[0, 0], [5, 5], [5, 0], [0, 0]]]]);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#setStyle', function() {
|
describe('#setStyle', function() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {getUid} from '../../../../../src/ol/index.js';
|
import {getUid} from '../../../../../src/ol/index.js';
|
||||||
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
|
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_webgl_PolygonReplay_ from '../../../../../src/ol/render/webgl/PolygonReplay.js';
|
import _ol_render_webgl_PolygonReplay_ from '../../../../../src/ol/render/webgl/PolygonReplay.js';
|
||||||
import _ol_render_webgl_polygonreplay_defaultshader_ from '../../../../../src/ol/render/webgl/polygonreplay/defaultshader.js';
|
import _ol_render_webgl_polygonreplay_defaultshader_ from '../../../../../src/ol/render/webgl/polygonreplay/defaultshader.js';
|
||||||
@@ -64,7 +64,7 @@ describe('ol.render.webgl.PolygonReplay', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sets the buffer data', function() {
|
it('sets the buffer data', function() {
|
||||||
var multiPolygon = new _ol_geom_MultiPolygon_([
|
var multiPolygon = new MultiPolygon([
|
||||||
[[[1000, 2000], [1200, 2000], [1200, 3000]]],
|
[[[1000, 2000], [1200, 2000], [1200, 3000]]],
|
||||||
[[[4000, 2000], [4200, 2000], [4200, 3000]]]
|
[[[4000, 2000], [4200, 2000], [4200, 3000]]]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCol
|
|||||||
import LineString from '../../../../../src/ol/geom/LineString.js';
|
import LineString from '../../../../../src/ol/geom/LineString.js';
|
||||||
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import Point from '../../../../../src/ol/geom/Point.js';
|
import Point from '../../../../../src/ol/geom/Point.js';
|
||||||
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../../src/ol/geom/Polygon.js';
|
||||||
import _ol_render_canvas_LineStringReplay_ from '../../../../../src/ol/render/canvas/LineStringReplay.js';
|
import _ol_render_canvas_LineStringReplay_ from '../../../../../src/ol/render/canvas/LineStringReplay.js';
|
||||||
@@ -237,7 +237,7 @@ describe('ol.render.canvas.ReplayGroup', function() {
|
|||||||
var multilinestring = new _ol_Feature_(new MultiLineString(
|
var multilinestring = new _ol_Feature_(new MultiLineString(
|
||||||
[linestring.getGeometry().getCoordinates(), linestring.getGeometry().getCoordinates()]));
|
[linestring.getGeometry().getCoordinates(), linestring.getGeometry().getCoordinates()]));
|
||||||
var polygon = feature1;
|
var polygon = feature1;
|
||||||
var multipolygon = new _ol_Feature_(new _ol_geom_MultiPolygon_(
|
var multipolygon = new _ol_Feature_(new MultiPolygon(
|
||||||
[polygon.getGeometry().getCoordinates(), polygon.getGeometry().getCoordinates()]));
|
[polygon.getGeometry().getCoordinates(), polygon.getGeometry().getCoordinates()]));
|
||||||
var geometrycollection = new _ol_Feature_(new _ol_geom_GeometryCollection_(
|
var geometrycollection = new _ol_Feature_(new _ol_geom_GeometryCollection_(
|
||||||
[point.getGeometry(), linestring.getGeometry(), polygon.getGeometry()]));
|
[point.getGeometry(), linestring.getGeometry(), polygon.getGeometry()]));
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Point from '../../../../src/ol/geom/Point.js';
|
|||||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||||
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
|
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||||
import _ol_render_canvas_ReplayGroup_ from '../../../../src/ol/render/canvas/ReplayGroup.js';
|
import _ol_render_canvas_ReplayGroup_ from '../../../../src/ol/render/canvas/ReplayGroup.js';
|
||||||
import _ol_renderer_vector_ from '../../../../src/ol/renderer/vector.js';
|
import _ol_renderer_vector_ from '../../../../src/ol/renderer/vector.js';
|
||||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||||
@@ -145,7 +145,7 @@ describe('ol.renderer.vector', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('does render the multipolygon', function() {
|
it('does render the multipolygon', function() {
|
||||||
feature.setGeometry(new _ol_geom_MultiPolygon_(
|
feature.setGeometry(new MultiPolygon(
|
||||||
[[[[0, 0], [1, 1], [1, 0], [0, 0]]]]));
|
[[[[0, 0], [1, 1], [1, 0], [0, 0]]]]));
|
||||||
var polygonReplay = replayGroup.getReplay(
|
var polygonReplay = replayGroup.getReplay(
|
||||||
style.getZIndex(), 'Polygon');
|
style.getZIndex(), 'Polygon');
|
||||||
|
|||||||
Reference in New Issue
Block a user