笔记
在项目中时遇到ol的css和js无法使用,换版本引入新的js和css文件,共两种解决方法:
一.直接使用网络资源
可以直接在js中引入网络资源
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.9.0/build/ol.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.9.0/css/ol.css">