Skip to content

Commit

Permalink
[UPD] Flashing on mobile #1077
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Jun 21, 2024
1 parent b0bce65 commit 1b8aa37
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/interaction/Transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
}
Expand All @@ -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
}

Expand Down

0 comments on commit 1b8aa37

Please sign in to comment.