Add rotate control to defaults.
This commit is contained in:
@@ -683,6 +683,7 @@ olx.control.ControlOptions.prototype.target;
|
||||
* logo: (boolean|undefined),
|
||||
* logoOptions: (olx.control.LogoOptions|undefined),
|
||||
* zoom: (boolean|undefined),
|
||||
* rotateOptions: (olx.control.RotateOptions|undefined)}}
|
||||
* zoomOptions: (olx.control.ZoomOptions|undefined)}}
|
||||
* @todo api
|
||||
*/
|
||||
@@ -724,6 +725,13 @@ olx.control.DefaultsOptions.prototype.logoOptions;
|
||||
olx.control.DefaultsOptions.prototype.zoom;
|
||||
|
||||
|
||||
/**
|
||||
* Rotate options.
|
||||
* @type {olx.control.RotateOptions|undefined}
|
||||
*/
|
||||
olx.control.DefaultsOptions.prototype.rotateOptions;
|
||||
|
||||
|
||||
/**
|
||||
* Zoom options.
|
||||
* @type {olx.control.ZoomOptions|undefined}
|
||||
|
||||
@@ -3,6 +3,7 @@ goog.provide('ol.control');
|
||||
goog.require('ol.Collection');
|
||||
goog.require('ol.control.Attribution');
|
||||
goog.require('ol.control.Logo');
|
||||
goog.require('ol.control.Rotate');
|
||||
goog.require('ol.control.Zoom');
|
||||
|
||||
|
||||
@@ -25,6 +26,14 @@ ol.control.defaults = function(opt_options) {
|
||||
controls.push(new ol.control.Zoom(zoomControlOptions));
|
||||
}
|
||||
|
||||
var rotateControl = goog.isDef(options.rotate) ?
|
||||
options.rotate : true;
|
||||
if (rotateControl) {
|
||||
var rotateControlOptions = goog.isDef(options.rotateOptions) ?
|
||||
options.rotateOptions : undefined;
|
||||
controls.push(new ol.control.Rotate(rotateControlOptions));
|
||||
}
|
||||
|
||||
var attributionControl = goog.isDef(options.attribution) ?
|
||||
options.attribution : true;
|
||||
if (attributionControl) {
|
||||
|
||||
Reference in New Issue
Block a user