-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
170 lines (141 loc) · 5.79 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- bootstrap 5 css -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
<!-- mapbox 2.9.1 -->
<script src="https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css" rel="stylesheet" />
<title>Mapbox</title>
<style>
#map {
width: 100%;
height: 80vh;
}
</style>
</head>
<body class="bg-dark">
<div class="container">
<main class="d-flex justify-content-center align-items-center">
<div class="card m-auto mt-1 w-100">
<div class="card-header bg-transparent">
<h3>Mapbox 2.9.1</h3>
</div>
<div class="card-bodyX border p-0 position-relative">
<div id="map"></div>
<pre id="mouse-info"></pre>
<div id="distance" class="distance-container"></div>
<div id="basemap-menu" class="mt-2">
<input id="streets-v11" type="radio" name="rtoggle" value="streets-v11" checked="checked" />
<label for="streets-v11">Streets</label>
<input id="light-v11" type="radio" name="rtoggle" value="light" />
<label for="light-v11">Light</label>
<input id="dark-v11" type="radio" name="rtoggle" value="dark" />
<label for="dark-v11">Dark</label>
<input id="streets-v12" type="radio" name="rtoggle" value="streets" />
<label for="streets-v12">Open Streets</label>
<input id="outdoors-v12" type="radio" name="rtoggle" value="outdoors" />
<label for="outdoors-v12">Outdoors</label>
</div>
<div class="calculation-box">
<p>Click the map to draw a polygon.</p>
<div id="calculated-area"></div>
</div>
</div>
</div>
</main>
</div>
<!-- jquery-3.7.0 -->
<script src="https://code.jquery.com/jquery-3.7.0.min.js"
integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script>
<!-- bootstrap 5 js -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous">
</script>
<script>
const MBT =
"pk.eyJ1IjoibXJhbWVleiIsImEiOiJja3lsM25xcXczMjBxMnFvODgyeWJ1d2JuIn0.fYJTHaXf3mu0cRxoTCYvxA";
mapboxgl.accessToken = MBT;
const map = new mapboxgl.Map({
container: "map",
style: "mapbox://styles/mapbox/streets-v11",
center: [73.555, 31.5255], // starting position
zoom: 7, // starting zoom
pitch: 45,
bearing: -17.6,
antialias: true,
// projection:
// "naturalEarth",
// 'globe',
// "cylindrical",
// "mercator",
});
</script>
<!-- CDN: Load the `mapbox-gl-geocoder` plugin. js -->
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.min.js"></script>
<link rel="stylesheet"
href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v5.0.0/mapbox-gl-geocoder.css" type="text/css" />
<!-- CDN: Load the `mapbox-gl-geocoder` plugin. css -->
<!-- App: geocoder css -->
<link rel="stylesheet" href="css/geocoder.css" />
<script src="js/geocoder.js"></script>
<!-- App: geocoder js -->
<!-- App: generic and must-have constrols -->
<script src="js/general_controls.js"></script>
<!-- App: 3d basemap gallery css -->
<link rel="stylesheet" href="css/basemap_menu.css" />
<script src="js/basemap_menu.js"></script>
<!-- App: 3d basemap gallery js -->
<script src="js/layers.js"></script>
<!-- App: layers js -->
<!-- App: mouse coordinates info css -->
<link rel="stylesheet" href="css/mouse_info.css" />
<script src="js/mouse_info.js"></script>
<!-- App: mouse coordinates info js -->
<!-- App: 3d buildings -->
<script src="js/3d.js"></script>
<!-- CDN: Draw & Distance measure-->
<script src="https://unpkg.com/@turf/turf@6/turf.min.js"></script>
<!-- App: Distance measure css-->
<link rel="stylesheet" href="css/distance-measure.css" />
<script src="js/distance-measure.js"></script>
<!-- App: Distance measure js -->
<!--*******************************
Draw Tool
***********************************-->
<!-- CDN: Draw & Distance measure-->
<!-- <script src="https://unpkg.com/@turf/turf@6/turf.min.js"></script> -->
<!-- CDN: Draw js-->
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.4.0/mapbox-gl-draw.js"></script>
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-draw/v1.4.0/mapbox-gl-draw.css"
type="text/css" />
<!-- CDN: Draw css -->
<!-- App: draw css -->
<link rel="stylesheet" href="css/draw.css" />
<script src="js/draw.js"></script>
<!-- App: draw js -->
<!-- CDN: directions js-->
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v4.1.1/mapbox-gl-directions.js"></script>
<!-- CDN: directions css-->
<link rel="stylesheet"
href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v4.1.1/mapbox-gl-directions.css"
type="text/css" />
<script src="js/directions.js"></script>
<!-- App: directions js -->
<!-- CDN: Export Map css -->
<link href="https://watergis.github.io/mapbox-gl-export/mapbox-gl-export.css" rel="stylesheet" />
<script src="https://watergis.github.io/mapbox-gl-export/mapbox-gl-export.js"></script>
<!-- CDN: Export Map js -->
<script src="js/export_map.js"></script>
<!-- App: directions js -->
<!-- CDN: Legend css -->
<link href='https://watergis.github.io/mapbox-gl-legend/mapbox-gl-legend.css' rel='stylesheet' />
<script src="https://watergis.github.io/mapbox-gl-legend/mapbox-gl-legend.js"></script>
<!-- CDN: Legend js -->
<script src="js/legend.js"></script>
<!-- App: directions js -->
</body>
</html>