Skip to content

Commit

Permalink
fix: use movestart, moveend instead of dragstart dragend to block til…
Browse files Browse the repository at this point in the history
…ed feature layer requests (related to #832)
  • Loading branch information
robinbourianes-kalisio committed Mar 20, 2024
1 parent 32bb1ec commit 0198fdb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions map/client/leaflet/TiledFeatureLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ const TiledFeatureLayer = L.GridLayer.extend({
getEvents () {
const events = L.GridLayer.prototype.getEvents.call(this)

// dragstart sets userIsDragging flag
const onDragStart = events.dragstart
events.dragstart = (event) => {
// movestart sets userIsDragging flag
const onMoveStart = events.movestart
events.movestart = (event) => {
this.userIsDragging = true
if (onDragStart) onDragStart.call(this, event)
if (onMoveStart) onMoveStart.call(this, event)
}

// dragstart clears userIsDragging flag
const onDragEnd = events.dragend
events.dragend = (event) => {
// moveend clears userIsDragging flag
const onMoveEnd = events.moveend
events.moveend = (event) => {
this.userIsDragging = false
if (onDragEnd) onDragEnd.call(this, event)
if (onMoveEnd) onMoveEnd.call(this, event)
}

// zoomstart records zoomStartLevel
Expand Down

0 comments on commit 0198fdb

Please sign in to comment.