new SuperMap.Geometry.MultiPolygon(components)
Name | Type | Description |
---|---|---|
components |
Array.<SuperMap.Geometry.Polygon> |
An array of polygons used to generate the MultiPolygon. |
Example
var points1 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0)];
var points2 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0),new SuperMap.Geometry.Point(3,3),new SuperMap.Geometry.Point(10,10)];
var linearRing1 = new SuperMap.Geometry.LinearRing(points1);
var linearRing2 = new SuperMap.Geometry.LinearRing(points2);
var polygon1 = new SuperMap.Geometry.Polygon([linearRing1]);
var polygon2 = new SuperMap.Geometry.Polygon([linearRing2]);
var multiPolygon1 = new SuperMap.Geometry.MultiPolygon([polygon1,polygon2]);
Extends
Members
-
boundsSuperMap.Bounds
-
Bounds of the geometric object.
-
componentsArray.<SuperMap.Geometry>
-
The component parts of this geometry.
-
componentTypesArray.<string>
-
The geometry format array supported by geometry object on the components storage.
- Default Value: ["SuperMap.Geometry.Polygon"]
idstring
The unique identifier of the geometric object.
parentSuperMap.Geometry
This is set when a Geometry is added as component of another geometry
SRIDinterger
Projection coordinate parameter. By this parameter, server will determine whether the geometry object's coordinate reference is as the same as dataset, if not, then change projection before adding into database.
Example
var geometry= new SuperMap.Geometry();
geometry. SRID=4326;
Methods
-
inherited addComponent(component, index){boolean}
Collection.js, line 120 -
Add a geometry to this collection. If the componentTypes is set,the type of the geometry that to be added must on the componentTypes.
Name Type Description component
SuperMap.Geometry The geometry to be added.
index
int optional The position of the insert of a geometric object.
Returns:
Type Description boolean Whether or not to add success. -
inherited addComponents(components)
Collection.js, line 103 -
Add components to this geometry.
Name Type Description components
Array.<SuperMap.Geometry> An array of geometries to add.
Example
var collection = new SuperMap.Geometry.Collection(); collection.addComponents(new SuerpMap.Geometry.Point(10,10));
-
inherited calculateBounds()
Collection.js, line 82 -
Recalculate the bounds by traversing array, Call the extend method when traversing each subitem.
-
inherited clearBounds()
Geometry.js, line 82 -
clear bounds of the geometric object. If the object has a parent class, it also clears the bounds of the parent class geometry object.
-
inherited clone(){SuperMap.Geometry.Collection}
Collection.js, line 52 -
Clone this geometry.
Returns:
Type Description SuperMap.Geometry.Collection An exact clone of this collection. -
inherited destroy()
Collection.js, line 42 -
Destroy this geometry.
-
inherited equals(geometry){boolean}
Collection.js, line 197 -
Determine whether another geometry is equivalent to this one. Geometries are considered equivalent if all components have the same coordinates.
Name Type Description geometry
SuperMap.Geometry The geometry to determined.
Returns:
Type Description boolean Whether the input geometry is equal to the current geometry. -
inherited extendBounds(newBounds)
Geometry.js, line 95 -
Extend the existing bounds to include the new bounds. If geometry's bounds is not yet set, then set a new Bounds.
Name Type Description newBounds
SuperMap.Bounds New bounds.
-
inherited getArea(){number}
Collection.js, line 184 -
Calculate the area of this geometry. Note how this function is overridden in SuperMap.Geometry.Polygon.
Returns:
Type Description number The area of the collection by summing its parts. -
inherited getBounds(){SuperMap.Bounds}
Geometry.js, line 112 -
Gets the boundary of the geometric graphic. If not set, it can be acquired through computing.
Returns:
Type Description SuperMap.Bounds Returns the bounds of the geometry. -
inherited getComponentsString(){string}
Collection.js, line 69 -
Get the components string.
Returns:
Type Description string the components string. -
inherited getVertices(nodes){Array}
Collection.js, line 223 -
Return a list of all points in this geometry.
Name Type Description nodes
boolean optional For lines, only return vertices that are endpoints. If false, for lines, only vertices that are not endpoints will be returned. If not provided, all vertices will be returned.
Returns:
Type Description Array A list of all vertices in the geometry. -
inherited removeComponent(component){boolean}
Collection.js, line 169 -
Remove a component from this geometry.
Name Type Description component
SuperMap.Geometry The component to be removed
Returns:
Type Description boolean Whether or not the component is removed successfully. -
inherited removeComponents(components){boolean}
Collection.js, line 151 -
Remove components from this geometry.
Name Type Description components
Array.<SuperMap.Geometry> The components to be removed.
Returns:
Type Description boolean Whether or not the components is removed successfully. -
inherited setBounds(bounds)
Geometry.js, line 70 -
Set bounds of the geometric object.
Name Type Description bounds
SuperMap.Bounds bounds.