new Rectangle(coordinates, width, height, optionsopt) [source]
var rectangle = new Rectangle([100, 0], 1000, 500, {
id : 'rectangle0'
});
Parameter | Type | Default | Description |
---|---|---|---|
coordinates
|
Coordinate | northwest of the rectangle | |
width
|
Number | width of the rectangle, in meter | |
height
|
Number | height of the rectangle, in meter | |
options
opt
|
Object | null | options defined in Rectangle |
Extends:
Members
(constant) options
Inherited From:
Properties:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options
|
Object | configuration options
Properties
|
- Inherited From:
- Source:
Methods
getCoordinates() [source]
Get coordinates of rectangle's northwest
Returns:
Coordinate:setCoordinates(nw) [source]
Set a new coordinate for northwest of the rectangle
Parameter | Type | Description |
---|---|---|
nw
|
Coordinate | coordinates of new northwest |
Fires:
Returns:
Rectangle: thisgetWidth() [source]
Get rectangle's width
Returns:
Number:setWidth(width) [source]
Set new width to the rectangle
Parameter | Type | Description |
---|---|---|
width
|
Number | new width |
Fires:
Returns:
Rectangle: thisgetHeight() [source]
Get rectangle's height
Returns:
Number:setHeight(height) [source]
Set new height to rectangle
Parameter | Type | Description |
---|---|---|
height
|
Number | new height |
Fires:
Returns:
Rectangle: thisgetShell() [source]
Gets the shell of the rectangle as a polygon
Returns:
Array.<Coordinate>: - shell coordinatesgetHoles() [source]
Rectangle won't have any holes, always returns null
Returns:
Array.<Object>: an empty array(inherited) getCenterInExtent(extent) [source]
Get center of linestring's intersection with give extent
const extent = map.getExtent();
const center = line.getCenterInExtent(extent);
Parameter | Type | Description |
---|---|---|
extent
|
Extent |
Inherited From:
Returns:
Coordinate: center, null if line doesn't intersect with extent(inherited) hasHoles() [source]
Whether the polygon has any holes inside.
Inherited From:
Returns:
Boolean:(inherited) animateShow(optionsopt, cbopt) [source]
Show the linestring with animation
Parameter | Type | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options
opt
|
Object | null | animation options
Properties
|
||||||||||||
cb
opt
|
function | null | callback function in animation |