/* 1、根据范围(从左下角到右上角) */const Rectangle = new ol.Feature({/*第一个参数:左下角第二个参数: 右上角*/geometry:new ol.geom.Polygon.fromExtent([80,0,110,20])})/* 2、设置样式 */Rectangle.setStyle(new ol.style.Style({fill:new ol.style.Fill({color:'rgba(255,255,255,.7)'}),stroke:new ol.style.Stroke({color:"#333",width:3})}))/* 3、设置数据源 */var source = new ol.source.Vector({features:[Rectangle]})/* 4、创建图层 */var vector = new ol.layer.Vector({source:source})/* 5、将图层添加到地图容器中 */map.addLayer(vector)
