@@ -270,11 +270,13 @@ export class InteractionManager {
270270 onTouchMove = ( touchEvent : TouchEvent ) => {
271271 // event.preventDefault();
272272
273- this . mapPositionToPoint (
274- this . mouse ,
275- touchEvent . touches [ 0 ] . clientX ,
276- touchEvent . touches [ 0 ] . clientY
277- ) ;
273+ if ( touchEvent . touches . length > 0 ) {
274+ this . mapPositionToPoint (
275+ this . mouse ,
276+ touchEvent . touches [ 0 ] . clientX ,
277+ touchEvent . touches [ 0 ] . clientY
278+ ) ;
279+ }
278280
279281 const event = new InteractiveEvent (
280282 this . treatTouchEventsAsMouseEvents ? 'mousemove' : 'touchmove' ,
@@ -331,11 +333,13 @@ export class InteractionManager {
331333 } ;
332334
333335 onTouchStart = ( touchEvent : TouchEvent ) => {
334- this . mapPositionToPoint (
335- this . mouse ,
336- touchEvent . touches [ 0 ] . clientX ,
337- touchEvent . touches [ 0 ] . clientY
338- ) ;
336+ if ( touchEvent . touches . length > 0 ) {
337+ this . mapPositionToPoint (
338+ this . mouse ,
339+ touchEvent . touches [ 0 ] . clientX ,
340+ touchEvent . touches [ 0 ] . clientY
341+ ) ;
342+ }
339343
340344 this . update ( ) ;
341345
@@ -368,11 +372,13 @@ export class InteractionManager {
368372 } ;
369373
370374 onTouchEnd = ( touchEvent : TouchEvent ) => {
371- this . mapPositionToPoint (
372- this . mouse ,
373- touchEvent . touches [ 0 ] . clientX ,
374- touchEvent . touches [ 0 ] . clientY
375- ) ;
375+ if ( touchEvent . touches . length > 0 ) {
376+ this . mapPositionToPoint (
377+ this . mouse ,
378+ touchEvent . touches [ 0 ] . clientX ,
379+ touchEvent . touches [ 0 ] . clientY
380+ ) ;
381+ }
376382
377383 this . update ( ) ;
378384
0 commit comments