1.版本
2.配置ol-ext
// 1、安装ol-ext
npm i ol-ext
// 2、在main.js中引入样式
import 'ol-ext/dist/ol-ext.min.css';
3.使用LayerSwitcher控件
3.1 先看LayerSwitcher构造函数的参数
selection | enable layer selection when click on the title |
displayInLayerSwitcher | function that takes a layer and return a boolean if the layer is displayed in the switcher, default test the displayInLayerSwitcher layer attribute |
show_progress | show a |