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 sizeol.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 resolutionnumber | undefined Resolution.
deltanumber <optional>
(Optional) Delta.
directionnumber <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 rotationnumber | undefined Rotation.
deltanumber <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 extentol.Extent Extent.
sizeol.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 centerol.Coordinate | undefined Center.
- Source:
- view2d.js, line 417
-
setProjection
-
Set the projection of this view.
Parameters:
Name Type Description projectionol.Projection | undefined Projection.
- Source:
- view2d.js, line 430
-
setResolution
-
Set the resolution for this view.
Parameters:
Name Type Description resolutionnumber | undefined Resolution.
- Source:
- view2d.js, line 443
-
setRotation
-
Set the rotation for this view.
Parameters:
Name Type Description rotationnumber | undefined Rotation.
- Source:
- view2d.js, line 456
-
setZoom
-
Zoom to a specific zoom level.
Parameters:
Name Type Description zoomnumber Zoom level.
- Source:
- view2d.js, line 469