-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzones.html
176 lines (112 loc) · 3.5 KB
/
zones.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
170
171
172
173
174
175
176
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="leaflet/leaflet.css"/>
<script src="leaflet/leaflet.js"></script>
<script src="zones.js"></script>
<script src="states.js"></script>
<script src="tabletop.js"></script>
<script src="states.js"></script>
<title>India Corona Live Update District</title>
<style>
#map{ height: 550px; }
/*Legend specific*/
.legend {
padding: 6px 8px;
font: 14px Arial, Helvetica, sans-serif;
background: white;
background: rgba(255, 255, 255, 0.8);
/*box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);*/
/*border-radius: 5px;*/
line-height: 24px;
color: #555;
}
.legend h4 {
text-align: center;
font-size: 16px;
margin: 2px 12px 8px;
color: #777;
}
.legend span {
position: relative;
bottom: 3px;
}
.legend i {
width: 18px;
height: 18px;
float: left;
margin: 0 8px 0 0;
opacity: 0.7;
}
.legend i.icon {
background-size: 18px;
background-color: rgba(255, 255, 255, 1);
}
</style>
</head>
<body>
<h2 align="center">ZONE MAP OF INDIA (AS PER 1ST MAY ,2020) </h2>
<p id="date" align="center"></p>
<div id="map"></div>
<br>
<div align="center">
Copyright © All Rights Reserved ® Created By Souvik Sankar Mitra. M.Tech (Geoinformatics) Indian Institute of Remote Sensing. <a href="https://souvikcv.000webhostapp.com/">Visit my personal website</a>
Source = https://www.mohfw.gov.in/
</div>
<script>
var map = L.map('map').setView([23.076748, 78.292226 ], 5);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
function getColor(d) {
return d=="Red Zone" ? '#ff0000' :
d=="Orange Zone" ? '#ffa500' :
d=="Green Zone" ? '#008000' :
'#000000';
}
function style(feature) {
return{
fillColor: getColor(feature.properties.Zone),
weight: 1,
opacity: 1,
color: 'black',
dashArray: '3',
fillOpacity: 0.7
}
}
var zone = L.geoJson(geodist, {
style: style,
onEachFeature: function (feature, layer) {
layer.bindPopup("<p>District :" + feature.properties.dtname +"<br> State: "+feature.properties.stname)
}
}).addTo(map);
function style1(feature)
{
return{
weight: 2,
opacity: 0.9,
color: "black",
fill: false
};
}
var state1 = L.geoJson(geoStates,{
style: style1}).addTo(map);
var legend = L.control({ position: "bottomleft" });
legend.onAdd = function(map) {
var div = L.DomUtil.create("div", "legend");
div.innerHTML += "<h4>Zone Division</h4>";
div.innerHTML += '<i style="background:#ff0000"></i><span>Red Zone</span><br>';
div.innerHTML += '<i style="background: #ffa500"></i><span>Orange Zone</span><br>';
div.innerHTML += '<i style="background: #008000"></i><span>Green Zone</span><br>';
//div.innerHTML += '<i style="background: #0000FF"></i><span>No patient</span><br>';
//div.innerHTML += '<i style="background: #FF4500"></i><span>Residential</span><br>';
//div.innerHTML += '<i style="background: #FFFFFF"></i><span>Ice</span><br>';
//div.innerHTML += '<i class="icon" style="background-image: url(https://d30y9cdsu7xlg0.cloudfront.net/png/194515-200.png);background-repeat: no-repeat;"></i><span>Grænse</span><br>';
return div;
};
legend.addTo(map);
</script>
</body>
</html>