import VectorLayer from "ol/layer/Vector";
import VectorSource from "ol/source/Vector";
import GeoJSON from "ol/format/GeoJSON";
import data from './1.json'
let jsonData = data;
let xysGetVectorLayerFromLocal = () => {
return new VectorLayer({
name: 'oldBaseLayer',
visible: true,
source: new VectorSource({
format: new GeoJSON(),
features: new GeoJSON().readFeatures(jsonData),
}),
})
}
export default xysGetVectorLayerFromLocal
网友评论