new View2D
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
options |
ol.View2DOptions |
<optional> |
(Optional) View2D options. |
- Source:
- view2d.js, line 87
Methods
-
calculateExtent
-
Calculate the extent for the given size in pixels, based on the current resolution and the current center.
Parameters:
Name Type Description size
ol.Size Box pixel size.
- Source:
- view2d.js, line 221
Returns:
Extent.
- Type
- ol.Extent
-
constrainResolution
-
Get the constrained the resolution of this view.
Parameters:
Name Type Argument Description resolution
number | undefined Resolution.
delta
number <optional>
(Optional) Delta.
direction
number <optional>
(Optional) Direction.
- Source:
- view2d.js, line 182
Returns:
Constrained resolution.
- Type
- number | undefined
-
constrainRotation
-
Get the constrained rotation of this view.
Parameters:
Name Type Argument Description rotation
number | undefined Rotation.
delta
number <optional>
(Optional) Delta.
- Source:
- view2d.js, line 196
Returns:
Constrained rotation.
- Type
- number | undefined
-
fitExtent
-
Fit the given extent based on the given map size.
Parameters:
Name Type Description extent
ol.Extent Extent.
size
ol.Size Box pixel size.
- Source:
- view2d.js, line 396
-
getZoom
-
Get the current zoom level. Return undefined if the current resolution is undefined or not a "constrained resolution".
- Source:
- view2d.js, line 371
Returns:
Zoom.
- Type
- number | undefined
-
setCenter
-
Set the center of the current view.
Parameters:
Name Type Description center
ol.Coordinate | undefined Center.
- Source:
- view2d.js, line 417
-
setProjection
-
Set the projection of this view.
Parameters:
Name Type Description projection
ol.Projection | undefined Projection.
- Source:
- view2d.js, line 430
-
setResolution
-
Set the resolution for this view.
Parameters:
Name Type Description resolution
number | undefined Resolution.
- Source:
- view2d.js, line 443
-
setRotation
-
Set the rotation for this view.
Parameters:
Name Type Description rotation
number | undefined Rotation.
- Source:
- view2d.js, line 456
-
setZoom
-
Zoom to a specific zoom level.
Parameters:
Name Type Description zoom
number Zoom level.
- Source:
- view2d.js, line 469