shpjs将.zip文件转成geoJson
创始人
2024-05-30 04:02:47

一、npm install shpjs

二、import shp from 'shpjs'

三、

async setLayerSource() {

const geoJsonData = await shp(dataUrl)

}

一直报错:是因为Buffer这个插件一直没找到

 Uncaught Error: nodebuffer is not supported by this browser

解决办法

npm install node-polyfill-webpack-plugin

vue.config.js

const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')

module.exports = {

configureWebpack: (config) => {

config.plugins.push(new NodePolyfillPlugin())

}

}

相关内容

热门资讯

中证A500ETF摩根(560... 8月22日,截止午间收盘,中证A500ETF摩根(560530)涨1.19%,报1.106元,成交额...
A500ETF易方达(1593... 8月22日,截止午间收盘,A500ETF易方达(159361)涨1.28%,报1.104元,成交额1...
何小鹏斥资约2.5亿港元增持小... 每经记者|孙磊    每经编辑|裴健如 8月21日晚间,小鹏汽车发布公告称,公司联...
中证500ETF基金(1593... 8月22日,截止午间收盘,中证500ETF基金(159337)涨0.94%,报1.509元,成交额2...
中证A500ETF华安(159... 8月22日,截止午间收盘,中证A500ETF华安(159359)涨1.15%,报1.139元,成交额...