<body>
<div id="map"></div>
<script>
var map=new ol.Map({
target:"map",
layer:[],
view:new ol.View({
center:[0,0],
zoom:2
})
//control:new control.defaults().extend([
// new ol.control.FullScreen()
// ])
})
var tilelayer=new ol.layer.Tile({
source:new ol.source.OSM()
});
map.addLayer(tilelayer);
var overviewMapControl=new ol.control.OverviewMap({
layer:[
new ol.layer.Tile({
source:new ol.source.OSM({
"url":"http://{a-c}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png"
})
})
],
collapseLabel:"\u00BB",//鹰眼展开时功能按钮上的标识
label:"\u00AB",//鹰眼折叠时功能按钮上的标识
collapsed:false//初始为展开显示方式
});
var fullScreen=new ol.control.FullScreen();//openlayer 3 仅支持IE最新版本(IE 11+)
map.addControl(fullScreen);
map.addControl(overviewMapControl);
转载于:https://www.cnblogs.com/mina-huojian66/p/6004316.html