1、加载ArcGIS MapServer
var pipeLayer=new ol.layer.Tile({ extent: [11827395.404512288,3049293.321033439,11830835.070785211,3051032.263426973], source: new ol.source.TileArcGISRest({ url: baseMapUrl+'arcgis/rest/services/给水管网/MapServer', params: { 'LAYERS': 'show:0,1' } }), name:'pipeLayer', label:'管网', group:'给水管网' }); pipeLayer.getSource().updateParams({LAYERS:'show:1'});
2、显示控件
controls: ol.control.defaults({ attribution:false, rotate:false }).extend([ new ol.control.FullScreen({ className:"mapFullScreen"})]);