From 1b8aa37f28ae8baf4a7dd5093a711351f134a837 Mon Sep 17 00:00:00 2001 From: viglino Date: Fri, 21 Jun 2024 13:31:20 +0200 Subject: [PATCH] [UPD] Flashing on mobile #1077 --- src/interaction/Transform.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/interaction/Transform.js b/src/interaction/Transform.js index d2145382..a60260ce 100644 --- a/src/interaction/Transform.js +++ b/src/interaction/Transform.js @@ -130,7 +130,7 @@ var ol_interaction_Transform = class olinteractionTransform extends ol_interacti if (oldMap) { var targetElement = oldMap.getTargetElement() oldMap.removeLayer(this.overlayLayer_) - if (this.previousCursor_ && targetElement) { + if (this.previousCursor_ && targetElement && !('ontouchstart' in window)) { targetElement.style.cursor = this.previousCursor_ } this.previousCursor_ = undefined @@ -538,7 +538,7 @@ var ol_interaction_Transform = class olinteractionTransform extends ol_interacti this.center_ = this.getCenter() || ol_extent_getCenter(extent) // we are now rotating (cursor down on rotate mode), so apply the grabbing cursor var element = evt.map.getTargetElement() - element.style.cursor = this.Cursors.rotate0 + if (!('ontouchstart' in window)) element.style.cursor = this.Cursors.rotate0 this.previousCursor_ = element.style.cursor } else { this.center_ = ol_extent_getCenter(extent) @@ -817,10 +817,11 @@ var ol_interaction_Transform = class olinteractionTransform extends ol_interacti if (this.previousCursor_ === undefined) { this.previousCursor_ = element.style.cursor } - element.style.cursor = c + if (!('ontouchstart' in window)) element.style.cursor = c } else { - if (this.previousCursor_ !== undefined) + if (this.previousCursor_ !== undefined && !('ontouchstart' in window)) { element.style.cursor = this.previousCursor_ + } this.previousCursor_ = undefined } } @@ -833,7 +834,7 @@ var ol_interaction_Transform = class olinteractionTransform extends ol_interacti // remove rotate0 cursor on Up event, otherwise it's stuck on grab/grabbing if (this.mode_ === 'rotate') { var element = evt.map.getTargetElement() - element.style.cursor = this.Cursors.default + if (!('ontouchstart' in window)) element.style.cursor = this.Cursors.default this.previousCursor_ = undefined }