File tree 1 file changed +10
-0
lines changed
lib/editor/components/map
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 3
3
import React , { Component } from 'react'
4
4
import { Map , ZoomControl , FeatureGroup , GeoJSON } from 'react-leaflet'
5
5
import { shallowEqual } from 'react-pure-render'
6
+ import L from 'leaflet'
6
7
7
8
import * as activeActions from '../../actions/active'
8
9
import * as editorActions from '../../actions/editor'
@@ -98,6 +99,15 @@ type State = {
98
99
zoomToTarget : boolean
99
100
}
100
101
102
+ // From https://github.com/Leaflet/Leaflet.draw/issues/695#issuecomment-281663243
103
+ // Prevents creating a new leaflet draw point on drag
104
+ const originalOnTouch = L . Draw . Polyline . prototype . _onTouch
105
+ L . Draw . Polyline . prototype . _onTouch = function ( e ) {
106
+ if ( e . originalEvent . pointerType !== 'mouse' ) {
107
+ return originalOnTouch . call ( this , e )
108
+ }
109
+ }
110
+
101
111
export default class EditorMap extends Component < Props , State > {
102
112
state = {
103
113
width : 200 ,
You can’t perform that action at this time.
0 commit comments