- Author:
-
Examples:
// wkid: 4326 || 4490
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 geoArcGisMapServerImageryProvider = new Cesium.GeoArcGisMapServerImageryProvider({
url: new Cesium.Resource({
// proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
url: "https://192.168.100.231:6443/arcgis/rest/services/MapService_4326/China/MapServer"
}),
tilingScheme: tilingScheme,
maximumLevel: tilingScheme.maximumLevel,
rectangle: tilingScheme.dataRectangle
});
viewer.imageryLayers.addImageryProvider(geoArcGisMapServerImageryProvider);
// 地方坐标系,wkid: 4550(无带号)
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 geoArcGisMapServerImageryProvider = new Cesium.GeoArcGisMapServerImageryProvider({
url: new Cesium.Resource({
// proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
url: "https://192.168.100.231:6443/arcgis/rest/services/MapService_Local/shenyang1/MapServer"
}),
tilingScheme: tilingScheme,
maximumLevel: tilingScheme.maximumLevel,
rectangle: tilingScheme.dataRectangle
});
viewer.imageryLayers.addImageryProvider(geoArcGisMapServerImageryProvider);
// 地方坐标系,wkid: 4529(有带号)
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 geoArcGisMapServerImageryProvider = new Cesium.GeoArcGisMapServerImageryProvider({
url: new Cesium.Resource({
// proxy: new Cesium.DefaultProxy(Cfg.proxyHostUrl),
url: "https://192.168.100.231:6443/arcgis/rest/services/MapService_Local/shenyang2/MapServer"
}),
tilingScheme: tilingScheme,
maximumLevel: tilingScheme.maximumLevel,
rectangle: tilingScheme.dataRectangle
});
viewer.imageryLayers.addImageryProvider(geoArcGisMapServerImageryProvider);
// export map
var exportMapProvider = new Cesium.GeoArcGisMapServerImageryProvider({
url: 'https://192.168.100.231:6443/arcgis/rest/services/MapService_4326/China/MapServer',
usePreCachedTilesIfAvailable: false,
bboxSR: 4326,
imageSR: 4326,
parameters: {
layerDefs: `{"0": "NAME='湖北'"}`
},
});
viewer.imageryLayers.addImageryProvider(exportMapProvider);