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'
@@ -121,6 +122,15 @@ export default class EditorMap extends Component<Props, State> {
121
122
componentDidMount ( ) {
122
123
window . addEventListener ( 'resize' , this . _onResize )
123
124
this . setState ( { willMount : false } )
125
+
126
+ // From https://github.com/Leaflet/Leaflet.draw/issues/695#issuecomment-281663243
127
+ // Prevents creating a new leaflet draw point on drag
128
+ var originalOnTouch = L . Draw . Polyline . prototype . _onTouch ;
129
+ L . Draw . Polyline . prototype . _onTouch = function ( e ) {
130
+ if ( e . originalEvent . pointerType != "mouse" ) {
131
+ return originalOnTouch . call ( this , e ) ;
132
+ }
133
+ } ;
124
134
}
125
135
126
136
componentWillUnmount ( ) {
You can’t perform that action at this time.
0 commit comments