How to load a local shape or geojson file in to leaflet in Asymmetrik/ngx-leaflet?

805 Views Asked by At

I am using Asymmetrik/ngx-leaflet to build a map based application which can load and view external shape files. Is there any way to show local shape files?

1

There are 1 best solutions below

0
On

It looks like there's a Leaflet plugin for shapefiles. I don't know if it's up to date, but you might start there.

There's also a tutorial on how to integrate third party plugins with @asymmetrik/ngx-leaflet.

Read through the examples to get a sense of how to get the plugin loaded into your Angular app. Then, you probably just need to create your shapefile layer and add it to the layers array that is bound to ngx-leaflet just like any other layer.