-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
shapefile
.open(vectorUrl + '.shp?r=' + r, vectorUrl + '.dbf?r=' + r, { encoding: 'utf-8' }) //这里防止乱码,可以用encoding来指定文件的编码。
.then((source) =>
source.read().then(function log(result) {
if (result.done) {
vectorLayer.setSource(vectorSource);
return;
}
// result.value don't hava FID column
let feature = geoJsonFormat.readFeature(result.value);
vectorSource.addFeature(feature);
return source.read().then(log);
}),
)
.catch((error) => console.error(error.stack));
Metadata
Metadata
Assignees
Labels
No labels