Closed GaganGowda89 closed 2 years ago
ok why did you you need to change it, what was broken?
I am not sure how to use leaflet.shapefile
in my project. I tried exporting it but was not able to find the right way. I have an ArrayBuffer which is converted from Base64 as you see in the link below
All I need is to fit the ArrayBuffer into shp(buffer)
or leaflet.shapefile(ArrayBuffer)
. I am not sure which to use and not sure whether i am using the right package for my problem. Hope you can suggest. Thanks :)
Hi Calvin, that did not solve my problem. Anyway, i was just curious to ask you, how do i callL.shapefile
using leaflet.shapefile.js
. Am i using this right shp(buffer) or L.shapefile(buffer) doing the same? I meant
shp(file).then(function (geojson) { //More info: https://github.com/calvinmetcalf/shapefile-js
L.geoJSON(geojson).addTo(this.map);//More info: https://github.com/calvinmetcalf/leaflet.shapefile
});
or
const l1 = require('../../assets/leaflet.shpfile.js');
shp(file).then(function (geojson) { //More info: https://github.com/calvinmetcalf/shapefile-js
l1.shapefile(geojson).addTo(this.map);// The call I am making here is wrong.
//or L.shapefile(geojson)<--- How do i call this from the import that i made?
});
probably the first way is better in your case
Closing the issue, as it is not related to this. :) Thanks again
I have installed the shpjs package using npm,
npm -i shpjs --save
I copied lealfet.shapefile.js and made some changes as follows:
Later I tried importing the
leaflet.shapefile
as shown in my page1.ts file,const l1 = require('../../assets/leaflet.shpfile.js');
...I am not sure if I am doing it right. Can you suggest how do I insert ArrayBuffer in either shp(reader) or in L.shapefile.