Skip to content

Commit

Permalink
fix: moving marker on mobile with touch event
Browse files Browse the repository at this point in the history
  • Loading branch information
amoncaldas committed Jul 28, 2021
1 parent 609ad07 commit d7bb23a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import constants from '@/resources/constants'
import {LMarker, LPopup } from 'vue2-leaflet'
import appConfig from '@/config/app-config'

import "leaflet.markercluster/dist/MarkerCluster.css";
import "leaflet.markercluster/dist/MarkerCluster.Default.css";
import 'leaflet.markercluster/dist/MarkerCluster.css';
import 'leaflet.markercluster/dist/MarkerCluster.Default.css';

export default {
props: {
Expand Down Expand Up @@ -76,7 +76,7 @@ export default {
return isDraggable
},

/**
/**
* Show the marker popup
*/
showMarkerPopup () {
Expand Down
4 changes: 2 additions & 2 deletions src/fragments/map-view/map-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,10 +898,10 @@ export default {
* @param {*} event
*/
markerMoved (event) {
// only marker changes that are a result of user interaction are treated here.
// Only marker changes that are a result of user interaction are treated here.
// With vue2-leaflet version 2.5.2 the event.originalEvent is not an instance of
// window.PointerEvent anymore and use parent window.MouseEvent instead
if (event.originalEvent instanceof window.MouseEvent) {
if (event.originalEvent instanceof window.MouseEvent || event.originalEvent instanceof window.TouchEvent) {
clearTimeout(this.markerMoveTimeoutId)
this.markerMoveTimeoutId = setTimeout(() => {
this.markerDragEnd(event)
Expand Down

0 comments on commit d7bb23a

Please sign in to comment.