Remove goog.isDef from controls (-278 B)
This commit is contained in:
@@ -24,20 +24,18 @@ goog.require('ol.easing');
|
||||
*/
|
||||
ol.control.Zoom = function(opt_options) {
|
||||
|
||||
var options = goog.isDef(opt_options) ? opt_options : {};
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
var className = goog.isDef(options.className) ? options.className : 'ol-zoom';
|
||||
var className = options.className ? options.className : 'ol-zoom';
|
||||
|
||||
var delta = goog.isDef(options.delta) ? options.delta : 1;
|
||||
var delta = options.delta ? options.delta : 1;
|
||||
|
||||
var zoomInLabel = goog.isDef(options.zoomInLabel) ?
|
||||
options.zoomInLabel : '+';
|
||||
var zoomOutLabel = goog.isDef(options.zoomOutLabel) ?
|
||||
options.zoomOutLabel : '\u2212';
|
||||
var zoomInLabel = options.zoomInLabel ? options.zoomInLabel : '+';
|
||||
var zoomOutLabel = options.zoomOutLabel ? options.zoomOutLabel : '\u2212';
|
||||
|
||||
var zoomInTipLabel = goog.isDef(options.zoomInTipLabel) ?
|
||||
var zoomInTipLabel = options.zoomInTipLabel ?
|
||||
options.zoomInTipLabel : 'Zoom in';
|
||||
var zoomOutTipLabel = goog.isDef(options.zoomOutTipLabel) ?
|
||||
var zoomOutTipLabel = options.zoomOutTipLabel ?
|
||||
options.zoomOutTipLabel : 'Zoom out';
|
||||
|
||||
var inElement = goog.dom.createDom(goog.dom.TagName.BUTTON, {
|
||||
@@ -81,7 +79,7 @@ ol.control.Zoom = function(opt_options) {
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.duration_ = goog.isDef(options.duration) ? options.duration : 250;
|
||||
this.duration_ = options.duration ? options.duration : 250;
|
||||
|
||||
};
|
||||
goog.inherits(ol.control.Zoom, ol.control.Control);
|
||||
@@ -111,7 +109,7 @@ ol.control.Zoom.prototype.zoomByDelta_ = function(delta) {
|
||||
return;
|
||||
}
|
||||
var currentResolution = view.getResolution();
|
||||
if (goog.isDef(currentResolution)) {
|
||||
if (currentResolution) {
|
||||
if (this.duration_ > 0) {
|
||||
map.beforeRender(ol.animation.zoom({
|
||||
resolution: currentResolution,
|
||||
|
||||
Reference in New Issue
Block a user