-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (52 loc) · 2.21 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=2.0">
<title>Display a map in Cesium JS</title>
<script src="https://cesium.com/downloads/cesiumjs/releases/1.98/Build/Cesium/Cesium.js"></script>
<style>
@import url(https://cesium.com/downloads/cesiumjs/releases/1.98/Build/Cesium/Widgets/widgets.css);
body {
margin: 0;
padding: 0;
}
#cesiumContainer {position: absolute; top: 0; right: 0; bottom: 0; left: 0;}
</style>
</head>
<body>
<div id="cesiumContainer">
<a href="https://www.maptiler.com" style="position:absolute;right:10px;bottom:10px;z-index:999;"><img src="https://api.maptiler.com/resources/logo.svg" alt="MapTiler logo"></a>
</div>
</body>
<script>
const key = 'Is7ctpkWifOgD3aIVT81';
const viewer = new Cesium.Viewer('cesiumContainer', {
animation: false,
baseLayerPicker: false,
navigationHelpButton: false,
sceneModePicker: false,
homeButton: false,
geocoder: false,
fullscreenButton: false,
timeline: false,
imageryProvider: new Cesium.UrlTemplateImageryProvider({
url: `https://api.maptiler.com/maps/uk-openzoomstack-road/256/{z}/{x}/{y}.png?key=Is7ctpkWifOgD3aIVT81`,
minimumLevel: 0,
maximumLevel: 20,
credit: new Cesium.Credit("\u003ca href=\"https://www.maptiler.com/copyright/\" target=\"_blank\"\u003e\u0026copy; MapTiler\u003c/a\u003e \u003ca href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\"\u003e\u0026copy; OpenStreetMap contributors\u003c/a\u003e", true)
}),
terrainProvider: new Cesium.CesiumTerrainProvider({
url: `https://api.maptiler.com/tiles/terrain-quantized-mesh-v2/?key=${key}`,
credit: new Cesium.Credit("\u003ca href=\"https://www.maptiler.com/copyright/\" target=\"_blank\"\u003e\u0026copy;MapTiler\u003c/a\u003e \u003ca href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\"\u003e\u0026copy; OpenStreetMap contributors\u003c/a\u003e", true),
requestVertexNormals: true
}),
});
viewer.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(-3.4367501, 51.8840224, 4500),
orientation: {
pitch: Cesium.Math.toRadians(-20)
}
});
</script>
</html>