
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
leaflet-better-filelayer
Advanced tools
Load spatialized files into leaflet using the HTML FileReader API
This is a Leaflet plugin for loading your spatialized data into leaflet based on leaflet-omnivore and Leaflet.FileLayer plugins. This plugin was made looking for a convenient and easy to use plugin for loading external spatial files to leaflet.
It currently supports:
npm install leaflet-better-filelayer
npm install leaflet-better-filelayer@1.0.1
Checkout the Demo
Checkout the Demo with external button
Below gif show an example of loading a separated shapefile using drag and drop.
Note: Internally, the plugin groups .shp, .dbf, .shx and .prj with the same name.

import { BetterFileLayer } from "leaflet-better-filelayer";
const map = new Map('map');
const bfl = new BetterFileLayer();
map.addControl(bfl);
And

If you are developing a web application and you want to use your own html button outside the map container, you can use the following code:
// Note: The input have to be type "file"
// Example: <input type="file" accept=".gpx,.kml,.geojson,.json" multiple />
const options = {
button: document.getElementById('my-button'), // Your input HTML reference
}
const bfl = new BetterFileLayer(options).addTo(map);
After that, the plugin will bind an "on change" event on this button, waiting for files.
You can see the example here
Note: The Drag and Drop event listener will bind it self automatically
Install the development dependencies
npm install --save-dev
Start Vite development mode
npm run dev
Open localhost:3000 in your browser and start editing index.html.
To run unity tests:
npm run test
npm run style && npm run lint
See License for more details
FAQs
Load spatialized files into leaflet using the HTML FileReader API
The npm package leaflet-better-filelayer receives a total of 140 weekly downloads. As such, leaflet-better-filelayer popularity was classified as not popular.
We found that leaflet-better-filelayer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.