2

I created lightning component for a map, Im using Leaflet library to display map and points on it , on desktop ( mouse devices) it works well ( click, pan, zoom ), but on touch screen it does not work when I open the map on real ipad, I have this error message:

TypeError:Can only call MouseEvent.initMouseEvent on instances of MouseEvent throws at https://{my domin}.lightning.force.com/auraFW/javascript/rNSAVNTno4PUWiQm9PXAFg/aura_prod_compat.js:825:143

when I open it on chrome ipad simulation , I have this error message : (it was lightning App)

Uncaught TypeError: Illegal invocation throws at https://{my domin}.lightning.force.com/auraFW/javascript/rNSAVNTno4PUWiQm9PXAFg/aura_prod.js:824:138

I dont think it is leaflet issue because leaflet examples on their website works fine on mobile

please help

2
  • can you post your code here Commented Nov 2, 2017 at 4:49
  • 1
    code does not have anything about mouse interaction, these mouse events for map point click and map pan are default in leaflet library
    – sundus
    Commented Nov 2, 2017 at 7:35

2 Answers 2

1

I found the answer: add this option to map object: tap:false

  map =  L.map(mapElem,{tap:false});

and it will be solved, because it seems there is a conflict between tap implementation in leaflet and tap (click) implementation in salesforce

0

Worked for me, too. Many thanks. I added tap:false into the map initialisation:

var map = L.map(mapDiv, {zoomControl: false, tap:false}).setView([51.506246, -0.086292], 14);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .