forked from wangfeilong321/ExamplesforCesium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tianditu.html
66 lines (60 loc) · 2.9 KB
/
tianditu.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<head>
<title>TianDiTu</title>
<link href="../Build/Cesium/Widgets/widgets.css" rel="stylesheet">
<script type="text/javascript" src="./js/require.min.js" data-main="./js/main"></script>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
function onload(Cesium) {
// var viewer = new Cesium.Viewer('cesiumContainer', {
// imageryProvider : 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
// }),
// baseLayerPicker : false
// });
//var url = 'http://{s}.tianditu.com/img_w/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer=img&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles';
// var viewer = new Cesium.Viewer('cesiumContainer', {
// imageryProvider : new Cesium.WebMapTileServiceImageryProvider({
// url :url,
// layer : 'img',
// style : 'default',
// format : 'tiles',
// tileMatrixSetID : 'w',
// credit : new Cesium.Credit('天地图全球影像服务'),
// subdomains : ['t0','t1','t2','t3','t4','t5','t6','t7'],
// maximumLevel : 18
// }),
// baseLayerPicker : false
// });
var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider : new Cesium.WebMapTileServiceImageryProvider({
url : 'http://t0.tianditu.com/img_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer=img&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles',
layer : 'img',
style : 'default',
format : 'tiles',
tileMatrixSetID : 'c',
credit : new Cesium.Credit('天地图全球影像服务'),
subdomains : ['t0','t1','t2','t3','t4','t5','t6','t7'],
maximumLevel : 15,
tilingScheme : new Cesium.GeographicTilingScheme(),
tileMatrixLabels:['1','2','3','4','5','6','7']
}),
baseLayerPicker : false
});
var test = new Cesium.ArcGisMapServerImageryProvider({
url : 'http://atlasmaps.esri.com/arcgis/rest/services/Esri/USA_Population_Density/MapServer',
enablePickFeatures : false
});
var imageryLayers = viewer.imageryLayers;
imageryLayers.addImageryProvider(test);
};
</script>
</body>