From 96f8a806a6df7cf4ef85e87d07cb2de8ee8235b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 10 Nov 2014 12:48:43 +0100 Subject: [PATCH] Improvement to view docs --- externs/olx.js | 4 +++- src/ol/view.js | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index f7bcedf399..ff38c14653 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -474,7 +474,9 @@ olx.ViewOptions.prototype.constrainRotation; /** - * Enable rotation. Default is `true`. + * Enable rotation. Default is `true`. If `false` a rotation constraint that + * always sets the rotation to zero is used. The `constrainRotation` option + * has no effect if `enableRotation` is `false`. * @type {boolean|undefined} * @api */ diff --git a/src/ol/view.js b/src/ol/view.js index e779d19cee..2a02b6b555 100644 --- a/src/ol/view.js +++ b/src/ol/view.js @@ -77,14 +77,19 @@ ol.ViewHint = { * the "next" resolution. And releasing the fingers after pinch-zooming * snaps to the closest resolution (with an animation). * - * So the *resolution constraint* snaps to specific resolutions. It is + * The *resolution constraint* snaps to specific resolutions. It is * determined by the following options: `resolutions`, `maxResolution`, * `maxZoom`, and `zoomFactor`. If `resolutions` is set, the other three * options are ignored. See documentation for each option for more * information. * - * The *rotation constraint* is currently not configurable. It snaps the - * rotation value to zero when approaching the horizontal. + * The *rotation constraint* snaps to specific angles. It is determined + * by the following options: `enableRotation` and `constrainRotation`. + * By default the rotation value is snapped to zero when approaching the + * horizontal. + * + * The *center constraint* is determined by the `extent` option. By + * default the center is not constrained at all. * * @constructor * @extends {ol.Object}