Disable rotation for views with enableRotation: false
This commit is contained in:
@@ -2,7 +2,6 @@ goog.provide('ol.View');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.CenterConstraint');
|
||||
goog.require('ol.Constraints');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.ResolutionConstraint');
|
||||
goog.require('ol.RotationConstraint');
|
||||
@@ -169,8 +168,11 @@ ol.View.prototype.applyOptions_ = function(options) {
|
||||
* @private
|
||||
* @type {ol.Constraints}
|
||||
*/
|
||||
this.constraints_ = new ol.Constraints(
|
||||
centerConstraint, resolutionConstraint, rotationConstraint);
|
||||
this.constraints_ = {
|
||||
center: centerConstraint,
|
||||
resolution: resolutionConstraint,
|
||||
rotation: rotationConstraint
|
||||
};
|
||||
|
||||
if (options.resolution !== undefined) {
|
||||
properties[ol.ViewProperty.RESOLUTION] = options.resolution;
|
||||
@@ -528,6 +530,14 @@ ol.View.prototype.getCenter = function() {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Constraints} Constraints.
|
||||
*/
|
||||
ol.View.prototype.getConstraints = function() {
|
||||
return this.constraints_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<number>=} opt_hints Destination array.
|
||||
* @return {Array.<number>} Hint.
|
||||
|
||||
Reference in New Issue
Block a user