makinacorpus / Leaflet.FileLayer

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

Adding support for capital case file extension. #76

Open eyal88 opened 4 years ago

eyal88 commented 4 years ago

Currently only lowercased file extensions works, even when trying to explicitly allow other cases via formats option like so:

L.Control.fileLayerLoad({
  formats: ['.gpx', '.GPX']
}

Loading filename.GPX for example returns a Unsupported file type (GPX) error.

With this fix, the following configuration supports both .gpx or .GPX:

L.Control.fileLayerLoad({
  formats: ['.gpx']
}