Remove useless test in default controls

This commit is contained in:
Antoine Abt
2014-05-02 14:11:58 +02:00
parent 0bec5b5590
commit 603be52b1a

View File

@@ -21,33 +21,25 @@ ol.control.defaults = function(opt_options) {
var zoomControl = goog.isDef(options.zoom) ?
options.zoom : true;
if (zoomControl) {
var zoomControlOptions = goog.isDef(options.zoomOptions) ?
options.zoomOptions : undefined;
controls.push(new ol.control.Zoom(zoomControlOptions));
controls.push(new ol.control.Zoom(options.zoomOptions));
}
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));
controls.push(new ol.control.Rotate(options.rotateOptions));
}
var attributionControl = goog.isDef(options.attribution) ?
options.attribution : true;
if (attributionControl) {
var attributionControlOptions = goog.isDef(options.attributionOptions) ?
options.attributionOptions : undefined;
controls.push(new ol.control.Attribution(attributionControlOptions));
controls.push(new ol.control.Attribution(options.attributionOptions));
}
var logoControl = goog.isDef(options.logo) ?
options.logo : true;
if (logoControl) {
var logoControlOptions = goog.isDef(options.logoOptions) ?
options.logoOptions : undefined;
controls.push(new ol.control.Logo(logoControlOptions));
controls.push(new ol.control.Logo(options.logoOptions));
}
return controls;