SkillAgentSearch skills...

Leaflet.shapefile

Shapefile in Leaflet

Install / Use

/learn @calvinmetcalf/Leaflet.shapefile
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

leaflet.shapefile

requires shapefile-js plus if you want it to be done in a worker, you'll need catiline.

usage:

new L.Shapefile(arrayBuffer or url[,options][,importUrl]);

L.shapefile(arrayBuffer or url[,options][,importUrl]);

Options are passed to L.Geojson as is. First argument is either an array buffer of a zipped shapefile, the url to a zipped shapefile, or the url to file.shp (this assumes file.dbf exists). The importUrl parameter allows you to change where a worker loads in shp.js when using catiline and defaults to shp.js.

To easily try this out using your own shapefile, see the demo at leaflet.calvinmetcalf.com, where you can drag-and-drop your own shapefile and have it displayed on the map.

View on GitHub
GitHub Stars264
CategoryDevelopment
Updated1mo ago
Forks120

Languages

JavaScript

Security Score

95/100

Audited on Feb 9, 2026

No findings