makinacorpus / Leaflet.FileLayer

Loads files locally (GeoJSON, KML, GPX) as layers using HTML5 File API
http://makinacorpus.github.io/Leaflet.FileLayer/
MIT License
270 stars 91 forks source link

Not working on mobile? #33

Closed opoto closed 7 years ago

opoto commented 7 years ago

Although my mobile browsers support the FileReader API (checked with demo at https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL), the Leaflet.FileLayer demo does not work on my mobile. To reproduce:

  1. open http://makinacorpus.github.io/Leaflet.FileLayer/ on Firefox for Android (48.0) of Chrome for Android (52.x)
  2. click filelayer control and pick a gpx file -> file picker closes but nothing is diplayed on the map. No error message.
SBats commented 7 years ago

Hi @opoto and thanks for the feedback. I've just tested it and it works for me on Chrome 52 on an Android (Oxygen OS in my case). I have an issue with Firefox, where the control doesn't even respond. I'll investigate on this.

In the midtime, could you try wih another gpx file ? I've tried with those :

opoto commented 7 years ago

Indeed the problem came from my GPX. With a correct GPX it now works fine both on Firefox and Chrome, at least in my application. To help using your demo on small screens, I would suggest to add following meta tag to index.html: <meta name="viewport" content="width=device-width,height=device-height, user-scalable=no" /> Sorry for the erroneous report, and thanks for this good plugin

SBats commented 7 years ago

Great, thanks for the feedback ! Yeah a more complete demo is coming and we forgot the viewport meta on the actual, you're right. Thank you for pointing it out !