new View2D
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
options |
olx.View2DOptions |
<optional> |
View2D options. |
- Source:
- view2d.js, line 95
Observable Properties
| Name | Type | Settable | Event | Description |
|---|---|---|---|---|
center |
ol.Coordinate | yes | change:center |
the center of the view |
projection |
ol.proj.Projection | yes | change:projection |
the projection of the view |
resolution |
number | yes | change:resolution |
the resolution of the view |
rotation |
number | yes | change:rotation |
the rotation of the view |
Methods
-
calculateExtent
Stability: experimental -
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 242
Returns:
Extent.
- Type
- ol.Extent
-
constrainResolution
Stability: experimental -
Get the constrained the resolution of this view.
Parameters:
Name Type Argument Description resolutionnumber | undefined Resolution.
deltanumber <optional>
Delta. Default is
0.directionnumber <optional>
Direction. Default is
0.- Source:
- view2d.js, line 201
Returns:
Constrained resolution.
- Type
- number | undefined
-
constrainRotation
Stability: experimental -
Get the constrained rotation of this view.
Parameters:
Name Type Argument Description rotationnumber | undefined Rotation.
deltanumber <optional>
Delta. Default is
0.- Source:
- view2d.js, line 216
Returns:
Constrained rotation.
- Type
- number | undefined
-
fitExtent
Stability: experimental -
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 419
-
getZoom
Stability: experimental -
Get the current zoom level. Return undefined if the current resolution is undefined or not a "constrained resolution".
- Source:
- view2d.js, line 393
Returns:
Zoom.
- Type
- number | undefined
-
setCenter
Stability: experimental -
Set the center of the current view.
Parameters:
Name Type Description centerol.Coordinate | undefined Center.
- Source:
- view2d.js, line 447
-
setProjection
Stability: experimental -
Set the projection of this view. Warning! This code is not yet implemented. Function should not be used.
Parameters:
Name Type Description projectionol.proj.Projection | undefined Projection.
- Source:
- view2d.js, line 462
-
setResolution
Stability: experimental -
Set the resolution for this view.
Parameters:
Name Type Description resolutionnumber | undefined Resolution.
- Source:
- view2d.js, line 476
-
setRotation
Stability: experimental -
Set the rotation for this view.
Parameters:
Name Type Description rotationnumber | undefined Rotation.
- Source:
- view2d.js, line 490
-
setZoom
Stability: experimental -
Zoom to a specific zoom level.
Parameters:
Name Type Description zoomnumber Zoom level.
- Source:
- view2d.js, line 504
OpenLayers 3