GeoUrlTemplateImageryProvider

new Cesium.GeoUrlTemplateImageryProvider()

吉奥UrlTemplateImageryProvider,继承UrlTemplateImageryProvider,构造函数参数与UrlTemplateImageryProvider一致。
Name Type Default Description
options.antiPreMultiplyAlpha Boolean false optional 是否取消预乘,默认false。如果为true的话,可以解决渲染栅格瓦片黑边的问题。
Author:
  • liuhonglei
Examples:
// 天地图墨卡托
var tdt = new Cesium.GeoUrlTemplateImageryProvider({
		  url: "http://{s}.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=e90d56e5a09d1767899ad45846b0cefd",
		  subdomains: ['t0','t1','t2','t3','t4','t5','t6','t7']
	   });
       viewer.imageryLayers.addImageryProvider(tdt);
// 天地图经纬度直投
var tdt = new Cesium.GeoUrlTemplateImageryProvider({
	      url: "http://{s}.tianditu.com/DataServer?T=img_c&x={x}&y={y}&l={z}&tk=e90d56e5a09d1767899ad45846b0cefd",
		  subdomains: ['t0','t1','t2','t3','t4','t5','t6','t7'],
		  tilingScheme: new Cesium.GeoGeographicTilingScheme()
	   });
       viewer.imageryLayers.addImageryProvider(tdt);
// ArcGIS建议方案(经纬度)
var tilingScheme = new Cesium.GeoGeographicTilingScheme({
            viewer: viewer,
            resolutions: [0.07614275218656896, 0.03807137609328448, 0.01903568804664224, 0.00951784402332112,
            0.00475892201166056, 0.00237946100583028, 0.00118973050291514, 5.9486525145757E-4],
            origin: [-400.0, 400],
            extent: [73.441277, 18.159829, 135.08693, 53.561771],
            matrixWidth: 28,
            matrixHeight: 20,
            identifier: 0
        });
        var urlTemplateImageryProvider = new Cesium.GeoUrlTemplateImageryProvider({
            url: new Cesium.Resource({
                // proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
                url: "https://192.168.100.231:6443/arcgis/rest/services/MapService_4326/China/MapServer/tile/{z}/{y}/{x}"
            }),
            tilingScheme: tilingScheme,
            maximumLevel: tilingScheme.maximumLevel,
            rectangle: tilingScheme.dataRectangle
        });
        viewer.imageryLayers.addImageryProvider(urlTemplateImageryProvider);
// ArcGIS建议方案(高斯坐标-无带号)
var tilingScheme = new Cesium.GeoProjectedTilingScheme({
            viewer: viewer,
            resolutions: [16.933367200067735, 8.466683600033868, 4.233341800016934, 2.116670900008467, 
                1.0583354500042335, 0.5291677250021167, 0.26458386250105836, 0.13229193125052918],
            origin: [-5123200.0, 1.00021E7],
            extent: [546325.4733999966, 4640460.086300001, 553366.0957999966, 4646337.4473],
            matrixWidth: 1310,
            matrixHeight: 1237,
            identifier: 0
        });
        var urlTemplateImageryProvider = new Cesium.GeoUrlTemplateImageryProvider({
            url: new Cesium.Resource({
                // proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
                url: "https://192.168.100.231:6443/arcgis/rest/services/MapService_Local/shenyang1/MapServer/tile/{z}/{y}/{x}"
            }),
            tilingScheme: tilingScheme,
            maximumLevel: tilingScheme.maximumLevel,
            rectangle: tilingScheme.dataRectangle
        });
        viewer.imageryLayers.addImageryProvider(urlTemplateImageryProvider);
// ArcGIS建议方案(高斯坐标-有带号)
var tilingScheme = new Cesium.GeoProjectedTilingScheme({
            viewer: viewer,
            resolutions: [16.933367200067735, 8.466683600033868, 4.233341800016934, 2.116670900008467, 
                1.0583354500042335, 0.5291677250021167, 0.26458386250105836, 0.13229193125052918],
            origin: [3.58768E7, 1.00021E7],
            extent: [4.15463254734E7, 4640460.086300001, 4.15533660958E7, 4646337.4473],
            matrixWidth: 1310,
            matrixHeight: 1237,
            identifier: 0
        });
        var urlTemplateImageryProvider = new Cesium.GeoUrlTemplateImageryProvider({
            url: new Cesium.Resource({
                // proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
                url: "https://192.168.100.231:6443/arcgis/rest/services/MapService_Local/shenyang2/MapServer/tile/{z}/{y}/{x}"
            }),
            tilingScheme: tilingScheme,
            maximumLevel: tilingScheme.maximumLevel,
            rectangle: tilingScheme.dataRectangle
        });
        viewer.imageryLayers.addImageryProvider(urlTemplateImageryProvider);
// Globe切片(高斯坐标-无带号)
var tilingScheme = new Cesium.GeoProjectedTilingScheme({
            viewer: viewer,
            globeScaleDenominators: [72223.96373402284, 36111.98186703892, 18055.99093349196, 9027.99546674598, 4513.99773337299],
            origin: [-2.00375083427892E7, 2.00375083427892E7],
            extent: [546325.4733999966, 4640460.086300001, 553366.0957999966, 4646337.4473],
            matrixWidth: 4210,
            matrixHeight: 3148,
            identifier: 13
        });
        var urlTemplateImageryProvider = new Cesium.GeoUrlTemplateImageryProvider({
            url: new Cesium.Resource({
                // proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
                url: "http://192.168.100.231:8889/sy_shp_without_daihao/DataServer?T=tile&X={x}&Y={y}&L={z}"
            }),
            tilingScheme: tilingScheme,
            maximumLevel: tilingScheme.maximumLevel,
            rectangle: tilingScheme.dataRectangle
        });
        viewer.imageryLayers.addImageryProvider(urlTemplateImageryProvider);

Extends

  • UrlTemplateImageryProvider

Methods

staticCesium.GeoUrlTemplateImageryProvider.getInstanceByCapabilities(options)

通过传入较少的参数获得对象实例
Name Type Description
options Object 参数选项:
Name Type Description
viewer Viewer optional 三维球对象
url Resource | String 服务地址
parameters Object optional 传递给服务的附加参数
Example:
var providerPromise = Cesium.GeoUrlTemplateImageryProvider.getInstanceByCapabilities({
 viewer: viewer,
 url: 'https://192.168.100.231:6443/arcgis/rest/services/MapService_Local/shenyang1/MapServer/tile/{z}/{y}/{x}', //arcgis服务
 // url: 'http://192.168.100.231:8889/sy_shp_without_daihao/wmts?tilematrix={z}&layer=sy_xh_123&style=sy_xh_123&tilerow={y}&tilecol={x}&tilematrixset=sy_xh_123_Matrix_0&format=image%2Ftile&service=WMTS&version=1.0.0&request=GetTile'  //globe服务
});
providerPromise.then(function(provider) {
 viewer.imageryLayers.addImageryProvider(provider);
});