Remove goog.isDef from controls (-278 B)

This commit is contained in:
Tim Schaub
2015-09-18 18:28:47 +09:00
parent 007194a18f
commit a096ec5bf7
11 changed files with 88 additions and 97 deletions
+5 -4
View File
@@ -1,5 +1,6 @@
goog.provide('ol.control');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.control.Attribution');
goog.require('ol.control.Rotate');
@@ -20,23 +21,23 @@ goog.require('ol.control.Zoom');
*/
ol.control.defaults = function(opt_options) {
var options = goog.isDef(opt_options) ? opt_options : {};
var options = opt_options ? opt_options : {};
var controls = new ol.Collection();
var zoomControl = goog.isDef(options.zoom) ?
var zoomControl = ol.isDef(options.zoom) ?
options.zoom : true;
if (zoomControl) {
controls.push(new ol.control.Zoom(options.zoomOptions));
}
var rotateControl = goog.isDef(options.rotate) ?
var rotateControl = ol.isDef(options.rotate) ?
options.rotate : true;
if (rotateControl) {
controls.push(new ol.control.Rotate(options.rotateOptions));
}
var attributionControl = goog.isDef(options.attribution) ?
var attributionControl = ol.isDef(options.attribution) ?
options.attribution : true;
if (attributionControl) {
controls.push(new ol.control.Attribution(options.attributionOptions));