安装
npm install leaflet-fullscreen --save
引入
//引入地图全屏缩放小地图 import FullScreen from 'leaflet-fullscreen'; import 'leaflet-fullscreen/dist/leaflet.fullscreen.css'
使用
//this.L 是我的封装
var fullscreenControl = this.L.control.fullscreen(); this.map.addControl(fullscreenControl);