-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest3.html
More file actions
46 lines (39 loc) · 1.24 KB
/
test3.html
File metadata and controls
46 lines (39 loc) · 1.24 KB
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
<html>
<head>
<title>Page Dimensions</title>
<script>
function getPageDimensions() {
var width = window.innerWidth;
var height = window.innerHeight;
console.log('Page width: ' + width);
console.log('Page height: ' + height);
}
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/openlayers/6.5.0/ol.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/openlayers/6.5.0/ol.js"></script>
</head>
<body onload="getPageDimensions()">
<h1>Page Dimensions</h1>
<a href="City-list.js" download>点击这里下载报告</a>
</body>
<script>
import Map from 'ol/Map'; // 引入 Map 类
import View from 'ol/View'; // 引入 View 类
import TileLayer from 'ol/layer/Tile'; // 引入 TileLayer 类
import XYZ from 'ol/source/XYZ'; // 引入 XYZ 类
new Map({
target: 'map', // 将地图添加到具有 ID "map" 的 div 元素中
layers: [
new TileLayer({
source: new XYZ({
url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' // 添加 OpenStreetMap 图层
})
})
],
view: new View({
center: [0, 0], // 设置地图中心为经度 0,纬度 0
zoom: 2 // 设置缩放级别为 2
})
});
</script>
</html>