Remove goog.isDef from interaction

This commit is contained in:
Marc Jansen
2015-09-22 10:20:38 +02:00
committed by Tim Schaub
parent c56ee19763
commit 293c65088d

View File

@@ -107,8 +107,8 @@ ol.interaction.Interaction.prototype.setMap = function(map) {
*/
ol.interaction.Interaction.pan = function(map, view, delta, opt_duration) {
var currentCenter = view.getCenter();
if (goog.isDef(currentCenter)) {
if (goog.isDef(opt_duration) && opt_duration > 0) {
if (currentCenter) {
if (opt_duration && opt_duration > 0) {
map.beforeRender(ol.animation.pan({
source: currentCenter,
duration: opt_duration,
@@ -149,14 +149,14 @@ ol.interaction.Interaction.rotateWithoutConstraints =
if (goog.isDefAndNotNull(rotation)) {
var currentRotation = view.getRotation();
var currentCenter = view.getCenter();
if (goog.isDef(currentRotation) && goog.isDef(currentCenter) &&
goog.isDef(opt_duration) && opt_duration > 0) {
if (currentRotation !== undefined && currentCenter &&
opt_duration && opt_duration > 0) {
map.beforeRender(ol.animation.rotate({
rotation: currentRotation,
duration: opt_duration,
easing: ol.easing.easeOut
}));
if (goog.isDef(opt_anchor)) {
if (opt_anchor) {
map.beforeRender(ol.animation.pan({
source: currentCenter,
duration: opt_duration,
@@ -220,14 +220,14 @@ ol.interaction.Interaction.zoomWithoutConstraints =
if (goog.isDefAndNotNull(resolution)) {
var currentResolution = view.getResolution();
var currentCenter = view.getCenter();
if (goog.isDef(currentResolution) && goog.isDef(currentCenter) &&
goog.isDef(opt_duration) && opt_duration > 0) {
if (currentResolution !== undefined && currentCenter &&
opt_duration && opt_duration > 0) {
map.beforeRender(ol.animation.zoom({
resolution: currentResolution,
duration: opt_duration,
easing: ol.easing.easeOut
}));
if (goog.isDef(opt_anchor)) {
if (opt_anchor) {
map.beforeRender(ol.animation.pan({
source: currentCenter,
duration: opt_duration,