首先需要安装好openlayer
npm install ol
在vue项目的src目录下新建map.js
导入所需的openlayer模块
import 'ol/ol.css';
import {
Map, View} from 'ol';
import TileLayer from 'ol/layer/Tile';
import XYZSource from 'ol/source/XYZ';
首先需要安装好openlayer
npm install ol
在vue项目的src目录下新建map.js
导入所需的openlayer模块
import 'ol/ol.css';
import {
Map, View} from 'ol';
import TileLayer from 'ol/layer/Tile';
import XYZSource from 'ol/source/XYZ';