-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathindex.html
169 lines (147 loc) · 4.56 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>
<head>
<meta charset='utf-8' />
<title>Drone Image comparisons</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='story.geojson'></script>
<script src='boundary.geojson'></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.48.0/mapbox-gl.js'></script>
<script src='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-compare/v0.1.0/mapbox-gl-compare.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.48.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-compare/v0.1.0/mapbox-gl-compare.css' rel='stylesheet' type='text/css' />
<style>
body {
overflow: hidden;
margin:0; padding:0;
}
body * {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
header {
position: absolute;
display: block;
top: 0;
left: 0;
right: 0;
text-transform: uppercase;
background: rgba(147, 147, 147, 0.8);
text-align: center;
color: #fff;
z-index: 12;
}
.logo {
position: absolute;
right: 0;
bottom: 0;
height: 100%;
}
.map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.custom-control {
color: #000;
background: #fff;
padding: 8px 32px;
border-radius: 4px;
margin: 8px;
}
#ZMIIcon,#iconMau,#iconMalindi {
background-image: url('ZMIDrop.svg');
background-size: cover;
width: 50px;
height: 71px;
cursor: pointer;
}
.mapboxgl-ctrl-top-right {
position: absolute;
z-index: 12;
}
.mapboxgl-ctrl-top-left {
position: absolute;
z-index: 99;
}
</style>
</head>
<body>
<div class="prose">
<header class="bg-darken75 color-white h-auto-mm h60">
<div class='flex-parent flex-parent--space-between-main w-full'>
<div class="flex-child ml240 mt24 mb12"><h3>Drone Image comparisons</h3></div>
</div>
</header>
</div>
<div id='before' class='map'></div>
<div id='after' class='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoibnVhbGFjb3dhbiIsImEiOiJPLXBKU0pVIn0.vvBTkh_wd3dHhu6Y_llAOA';
var beforeMap = new mapboxgl.Map({
container: 'before',
style: 'mapbox://styles/mapbox/satellite-v9',
center: [39.189643, -6.161926],
zoom: 17
});
class BeforTitle {};
BeforTitle.prototype.onAdd = function(beforeMap) {
this.beforeMap = beforeMap;
this.div = document.createElement('div');
this.div.className = 'custom-control';
this.div.textContent = 'Before';
return this.div;
};
beforeMap.addControl(new BeforTitle(),'top-left');
var afterMap = new mapboxgl.Map({
container: 'after',
style: 'mapbox://styles/pratikyadav/cjldke8fv3c3r2row6hvk5k7z',
center: [39.189643, -6.161926],
zoom: 17
});
class AfterTitle {};
AfterTitle.prototype.onAdd = function(afterMap) {
this.afterMap = afterMap;
this.div = document.createElement('div');
this.div.className = 'custom-control';
this.div.textContent = 'After (ZMI Data)';
return this.div;
};
afterMap.addControl(new AfterTitle(),'top-right');
var map = new mapboxgl.Compare(beforeMap, afterMap, {
// Set this to enable comparing two maps by mouse movement:
// mousemove: true
});
afterMap.addControl(new mapboxgl.NavigationControl());
afterMap.on('load', function () {
afterMap.addLayer({
'id': 'boundary',
'type': 'line',
'source': {
'type': 'geojson',
'data': boundary},
'layout': {},
'paint': {
'line-color': '#f00',
}
});
});
var popupZMI = new mapboxgl.Popup({ offset: 25 }).setText('ZMI Processed Data');
var ZMIIcon = document.createElement('div');
ZMIIcon.id = 'ZMIIcon';
new mapboxgl.Marker(ZMIIcon).setLngLat([39.191554, -6.161926]).setPopup(popupZMI).addTo(afterMap);
var popupMau = new mapboxgl.Popup({ offset: 25 }).setText('The stadiaum now has been modified and put some light around it');
var iconMau = document.createElement('div');
iconMau.id = 'iconMau';
new mapboxgl.Marker(iconMau).setLngLat([39.19742166996002,-6.170331658365528]).setPopup(popupMau).addTo(afterMap);
var popupMalindi = new mapboxgl.Popup({ offset: 25 }).setText('The stadiaum now has been modified and built in modern way');
var iconMalindi = document.createElement('div');
iconMalindi.id = 'iconMalindi';
new mapboxgl.Marker(iconMalindi).setLngLat([39.195876717567444,-6.1588808523931045]).setPopup(popupMalindi).addTo(afterMap);
</script>
</body>
</html>