mapbox / leaflet-omnivore

universal format parser for Leaflet & Mapbox.js
https://www.mapbox.com/mapbox.js/example/v1.0.0/omnivore-gpx/
Other
651 stars 126 forks source link

Different behaviour in minified code #61

Closed lukenorman closed 8 years ago

lukenorman commented 9 years ago

When I parse a KML file, there appears to be different behaviour with the minified version of leaflet omnivore. The minified code doesn't attach the Placemark ID to the resulting geoJSON layer, but it works correctly in the non-minified code.

Given a variable kml containing a kml file string, the following code demonstrates the different behaviour. It returns undefined with minified code, but correctly returns the ID otherwise.

var kmlLayer = omnivore.kml.parse(kml); var firstLayer = kmlLayer.getLayers()[0]; console.log(firstLayer.feature.id);

tmcw commented 9 years ago

It's likely this upstream bug - we'll need to update uglifyjs versions