Closed gmarshall56 closed 3 years ago
you could just use https://github.com/calvinmetcalf/leaflet.shapefile which would allow you to do
const base = '../../../public/shapefiles/JNC/testJNC.zip';
const shpfile = L.shapefile(base, {onEachFeature:function popUp(f,l){
var out = [];
if (f.properties){
for(var key in f.properties){
out.push(key+": "+f.properties[key]);
}
l.bindPopup(out.join("<br />"));
}
}}).addTo(map);
Hello again:
I am trying to use this shape-js file in my react functional component.
import { shp } from 'shpjs/dist/shp';
Here is my code:
Would this be the correct way of implementing and using the shapefile-js in a react component? Thanks for your time. Sorry if this is a stupid question. I'm learning React as well as using Leaflet in React.