-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
81 lines (68 loc) · 2.66 KB
/
index.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://cesium.com/downloads/cesiumjs/releases/1.63.1/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.63.1/Build/Cesium/Widgets/widgets.css"
rel="stylesheet">
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
#cesiumContainer {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
var extent = Cesium.Rectangle.fromDegrees(12.081814,55.619087,12.090827,55.621862);
Cesium.Camera.DEFAULT_VIEW_RECTANGLE = extent;
Cesium.Camera.DEFAULT_VIEW_FACTOR = 0;
// Grant CesiumJS access to your ion assets
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2NGM3NDNkYy0yZWM0LTQ0ODQtYjFmNS0zMDY4MGIxNDVmYmQiLCJpZCI6MTgyMzEsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NzM1MDc5NTd9.VF54ufCrlaAEna_iHaCn47njpuMz1qgjrone4WnuCuA';
var viewer = new Cesium.Viewer('cesiumContainer', {
geocoder: false,
baseLayerPicker: false,
imageryProvider: new Cesium.MapboxImageryProvider({
mapId: 'mapbox.satellite',
accessToken: 'pk.eyJ1IjoiYmFmZmlvc28iLCJhIjoiY2s2cDNna2ZkMDkxYzNrcWxsOWhnMXpncSJ9.GDRxMk2269dec-HR2TAk-w'
}),
terrainProvider: new Cesium.CesiumTerrainProvider({
url: Cesium.IonResource.fromAssetId(74171)
}),
shadows: true,
terrainShadows: Cesium.ShadowMode.ENABLED,
});
var shadowMap = viewer.shadowMap;
//shadowMap.maxmimumDistance = 10000.0;
var promise = Cesium.IonResource.fromAssetId(74176)
.then(function (resource) {
return Cesium.GeoJsonDataSource.load(resource, {
stroke: Cesium.Color.RED,
fill: new Cesium.Color(1, 1, 1, 0.4),
strokeWidth: 10,
markerSymbol: '?',
clampToGround: true
});
})
.then(function (dataSource) {
return viewer.dataSources.add(dataSource);
})
.then(function (dataSource) {
return viewer.zoomTo(dataSource);
})
.otherwise(function (error) {
console.log(error);
});
</script>
</body>
</html>