cesium---------影像服务

1.支持ArcGIS Online和Server的相关服务(ArcGisMapServerImageryProvider)
var esri = new Cesium.ArcGisMapServerImageryProvider({ url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer', enablePickFeatures: false });
2.在线服务扩展(WebMapTileServiceImageryProvider)
var mtdt = new Cesium.WebMapTileServiceImageryProvider({ url: 'http://t0.tianditu.com/img_w/wmts?', layer: 'img', style: 'default', format: 'tiles', tileMatrixSetID: 'w', credit: new Cesium.Credit('天地图全球影像服务'), maximumLevel: 18 });
3.//自己处理瓦片数据
var globemap = Cesium.createTileMapServiceImageryProvider({
url: ‘sampledata/imagery/ceshi/tiles’ //瓦片地址
});

4.//单个图层服务(SingleTileImageryProvider)
var mapsingle = new Cesium.SingleTileImageryProvider({
url: ‘sampledata/images/globe.jpg’
});
5.多个图层服务
//多图层控制
var imageryLayers = viewer.imageryLayers;
var tdtNoteLayer = imageryLayers.addImageryProvider(tdtNoteLayerProvider);//添加注记图层
imageryLayers.raiseToTop(tdtNoteLayer);//将注记图层置顶
imageryLayers.alpha = 0.3;//改变透明度
imageryLayers.brightness = 1.5;//改变亮度
6.GridImageryProvider(内部网格渲染)
var GridImagery= new Cesium.GridImageryProvider();
var imageryLayers = viewer.imageryLayers;
var GridImageryLayer = imageryLayers.addImageryProvider(GridImagery);//添加注记图层
imageryLayers.raiseToTop(GridImageryLayer);//将注记图层置顶
7.TileCoordinatesImageryProvider(展示瓦片坐标)
var TileCoordinatesImagery = new Cesium.TileCoordinatesImageryProvider();
var imageryLayers = viewer.imageryLayers;
var TileCoordinatesImageryLayer = imageryLayers.addImageryProvider(TileCoordinatesImagery);//添加注记图层
imageryLayers.raiseToTop(TileCoordinatesImageryLayer);//将注记图层置顶
8.baseLayerPicker(图层选择器)
//设置默认地图源
viewer.baseLayerPicker.viewModel.selectedImagery = viewer.baseLayerPicker.viewModel.imageryProviderViewModels[6];
9. 自定义BaseLayerPicker-----添加一个esri自定义数据源过程:

1定义ImageryProvider:
 var esriMap = new Cesium.ArcGisMapServerImageryProvider({
           url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
          enablePickFeatures: false
       });
2设置ProviderViewModel:
 var providerViewModels = [];
       var esriMapModel = new Cesium.ProviderViewModel({
           name: 'esri Maps',
           iconUrl: Cesium.buildModuleUrl('./Widgets/Images/ImageryProviders/esriWorldImagery.png'),
           tooltip: 'ArcGIS 地图服务 \nhttps://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
          creationFunction: function () {
              return esriMap;
           }
       });
       providerViewModels.push(esriMapModel);
特别注意就是里面的creationFunction,创建关联的ImageryProvider。

10.使用自定义数据源设置ProviderViewModel
var providerViewModels = [];
var esriMapModel = new Cesium.ProviderViewModel({
name: ‘esri Maps’,
iconUrl: Cesium.buildModuleUrl(’./Widgets/Images/ImageryProviders/esriWorldImagery.png’),
tooltip: ‘ArcGIS 地图服务 \nhttps://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer’,
creationFunction: function () {
return esriMap;
}
});
providerViewModels.push(esriMapModel);

  1. //在viewer中定义该项
    var viewer = new Cesium.Viewer(‘cesiumContainer’, {
    //baseLayerPicker: false, //是否显示图层选择控件
    imageryProviderViewModels: providerViewModels,//自定义扩展
    });
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 数字20 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读