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