-
Notifications
You must be signed in to change notification settings - Fork 14
/
index03.html
105 lines (85 loc) · 1.91 KB
/
index03.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html class="use-all-space">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8" />
<title>My Map</title>
<meta
name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<link
rel="stylesheet"
type="text/css"
href="https://api.tomtom.com/maps-sdk-for-web/cdn/6.x/6.25.1/maps/maps.css"
/>
<style>
table {
float: left;
margin-left: 10px;
margin-right: 10px;
}
td{
height: 30px;
}
div{
margin-top: 30px;
margin-bottom: 30px;
}
#content{
width: 1000px;
margin-left: auto;
margin-right: auto;
}
#map {
width: 800px;
height: 600px;
}
</style>
</head>
<body >
<div id="map" class="map"></div>
<!-- Replace version in the URL with desired library version -->
<script src="https://api.tomtom.com/maps-sdk-for-web/cdn/6.x/6.25.1/maps/maps-web.min.js"></script>
<script>
let center=[121.51517341247079, 25.048362905598577]
var map = tt.map({
key: "xxxxx",
container: "map",
center: center,
zoom: 15,
})
map.on("load", function () {
map.showTrafficFlow()
})
map.on("load", function () {
map.addLayer({
id: "overlay",
type: "fill",
source: {
type: "geojson",
data: {
type: "Feature",
geometry: {
type: "Polygon",
coordinates: [
[
[121.52830511718942,25.047346550124775],
[121.5116114391156,25.047390922072605],
[121.51929328526715,25.044086120447496],
],
],
},
},
},
layout: {},
paint: {
"fill-color": "#db356c",
"fill-opacity": 0.5,
"fill-outline-color": "black",
},
})
})
</script>
</body>
</html>