openlayers4如何加载比例尺控件
解决方法:
直接上关键代码,在初始化地图后面添加一=以下代码即可
var scaleLineControl = new ol.control.ScaleLine({
//设置度量单位为米
units: 'metric',
target: 'scalebar',
className: 'ol-scale-line'
});
map.addControl(scaleLineControl);
本文地址:http://yayihouse.com/yayishuwu/chapter/1253