Problem in integrating this plugin with shpjs
See original GitHub issueI have installed the shpjs package using npm,
npm -i shpjs --save
I copied lealfet.shapefile.js and made some changes as follows:
import * as shp from 'shpjs'
/* global cw, shp */
L.Shapefile = L.GeoJSON.extend({
options: {
importUrl: shp
},
....
var shapefile = function(a, b, c) {
return new L.Shapefile(a, b, c);
};
module.export = shapefile;
Later I tried importing the leaflet.shapefile
as shown in my page1.ts file,
const l1 = require('../../assets/leaflet.shpfile.js');
…
shp(reader.result).then(function (geojson) { //More info: https://github.com/calvinmetcalf/shapefile-js
l1.shapefile(geojson).addTo(this.map);//More info: https://github.com/calvinmetcalf/leaflet.shapefile
});
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.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Loading shapefile data into shp (leaflet plugin) says TypeError
I just get a map with the below error has informed. I am not sure which leaflet package to use shpjs or L.shapefile...
Read more >Need help with some dependencies #6282 - GitHub
Hi! I'm trying to migrate from CRA to Vite, but I'm a bit stucked with some external dependencies. One of them is shpjs: ......
Read more >react-leaflet-shapefile - npm package - Snyk
No known security issues ... eslint-plugin-react ... React component build on top of React-Leaflet that integrate leaflet.shapefile functionality.
Read more >Error: nodebuffer is not supported by this platform
So the solution for me was to just add nodePolyfillWebpackPlugin to my quasar.config.js chainWebpack method. One more thing. I already had an ...
Read more >Custom dependencies - MapStore - GeoSolutions
Mapstore has some custom dependencies in order to fix bugs not integrated in the official libraries yet. All these customized libraries are available...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
probably the first way is better in your case
Closing the issue, as it is not related to this. 😃 Thanks again