File tree 1 file changed +9
-9
lines changed
lib/editor/components/map
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,15 @@ type State = {
99
99
zoomToTarget : boolean
100
100
}
101
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
+
102
111
export default class EditorMap extends Component < Props , State > {
103
112
state = {
104
113
width : 200 ,
@@ -122,15 +131,6 @@ export default class EditorMap extends Component<Props, State> {
122
131
componentDidMount ( ) {
123
132
window . addEventListener ( 'resize' , this . _onResize )
124
133
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
- }
134
134
}
135
135
136
136
componentWillUnmount ( ) {
You can’t perform that action at this time.
0 commit comments