forked from avershinina/HOME_map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
146 lines (141 loc) · 6.85 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Leaflet Map</title>
<!-- External Stylesheets -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<!-- Add the Leaflet JavaScript library -->
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<style>
/* css to customize Leaflet default styles */
.custom .leaflet-popup-tip,
.custom .leaflet-popup-content-wrapper {
background: #e63946;
color: #f1faee;
}
</style>
</head>
<body>
<!-- Our web map and content will go here -->
<div id="map" style="width: 705px; height: 375px"></div>
<script>
// Create variable to hold map element, give initial settings to map
var map = L.map('map',{ center: [51.5, -0.09], zoom: 5});
// Add OpenStreetMap tile layer to map element
L.tileLayer('https://basemap.nationalmap.gov/arcgis/rest/services/USGSImageryTopo/MapServer/tile/{z}/{y}/{x}', {
maxZoom: 200,
minZoom: 1,
attribution: 'Tiles courtesy of the <a href="https://usgs.gov/">U.S. Geological Survey</a>' }).addTo(map);
var redIcon = L.icon({
iconUrl: 'red_marker.png',
iconSize: [50, 50], // size of the icon
iconAnchor: [25, 25], // point of the icon which will correspond to marker's location
popupAnchor: [1, 1] // point from which the popup should open relative to the iconAnchor
});
// specify popup options
var customOptions =
{
'maxWidth': '500',
'className' : 'custom'
}
L.marker([51.5, -0.09], {icon: redIcon}).bindPopup('<b>UK!</b><br>Nice place.</br><iframe width="300" height="169" src="https://www.youtube.com/embed/ghkQoJoipbM?start=3571" frameborder="0" allowfullscreen></iframe>',customOptions).addTo(map);
</script>
<!-- Our web map and content will go here -->
<div id="map2" style="width: 705px; height: 375px"></div>
<script>
// DARK MAP
// Create variable to hold map element, give initial settings to map
var map2 = L.map('map2',{center: [51.5, -0.09], zoom: 2});
// Add OpenStreetMap tile layer to map element
L.tileLayer('https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.png',{
maxZoom: 200,
minZoom: 1,
attribution: '© <a href="https://stadiamaps.com/">Stadia Maps</a>, © <a href="https://openmaptiles.org/">OpenMapTiles</a> © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'}).addTo(map2);
var redIcon = L.icon({
iconUrl: 'red_marker.png',
iconSize: [50, 50], // size of the icon
iconAnchor: [25, 25], // point of the icon which will correspond to marker's location
popupAnchor: [1, 1] // point from which the popup should open relative to the iconAnchor
});
// specify popup options
var customOptions =
{
'maxWidth': '500',
'className' : 'custom'
}
L.marker([51.5, -0.09], {icon: redIcon}).bindPopup('<b>UK!</b><br>Nice place.</br><iframe width="300" height="169" src="https://www.youtube.com/embed/ghkQoJoipbM?start=3571" frameborder="0" allowfullscreen></iframe>',customOptions).addTo(map2);
</script>
<div id="map3" style="width: 705px; height: 375px"></div>
<script>
// ////////////////////////////////////
// Create variable to hold map element, give initial settings to map
var map3 = L.map('map3',{center: [51.5, -0.09], zoom: 2});
// Add OpenStreetMap tile layer to map element
L.tileLayer('https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.png', {
maxZoom: 20,
attribution: '© <a href="https://stadiamaps.com/">Stadia Maps</a>, © <a href="https://openmaptiles.org/">OpenMapTiles</a> © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors'
}).addTo(map3);
var redIcon = L.icon({
iconUrl: 'red_marker.png',
iconSize: [50, 50], // size of the icon
iconAnchor: [25, 25], // point of the icon which will correspond to marker's location
popupAnchor: [1, 1] // point from which the popup should open relative to the iconAnchor
});
// specify popup options
var customOptions =
{
'maxWidth': '500',
'className' : 'custom'
}
L.marker([51.5, -0.09], {icon: redIcon}).bindPopup('<b>UK!</b><br>Nice place.</br><iframe width="300" height="169" src="https://www.youtube.com/embed/ghkQoJoipbM?start=3571" frameborder="0" allowfullscreen></iframe>',customOptions).addTo(map3);
</script>
<div id="map4" style="width: 705px; height: 375px"></div>
<script>
// ////////////////////////////////////
// Create variable to hold map element, give initial settings to map
var map4 = L.map('map4',{center: [51.5, -0.09], zoom: 2});
// Add OpenStreetMap tile layer to map element
L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
maxZoom: 17,
attribution: 'Map data: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
}).addTo(map4);
var redIcon = L.icon({
iconUrl: 'red_marker.png',
iconSize: [50, 50], // size of the icon
iconAnchor: [25, 25], // point of the icon which will correspond to marker's location
popupAnchor: [1, 1] // point from which the popup should open relative to the iconAnchor
});
// specify popup options
var customOptions =
{
'maxWidth': '500',
'className' : 'custom'
}
L.marker([51.5, -0.09], {icon: redIcon}).bindPopup('<b>UK!</b><br>Nice place.</br><iframe width="300" height="169" src="https://www.youtube.com/embed/ghkQoJoipbM?start=3571" frameborder="0" allowfullscreen></iframe>',customOptions).addTo(map4);
</script>
<div id="map5" style="width: 705px; height: 375px"></div>
<script>
// ////////////////////////////////////
// Create variable to hold map element, give initial settings to map
var map5 = L.map('map5',{center: [51.5, -0.09], zoom: 2});
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ',
maxZoom: 16,
}).addTo(map5);
var redIcon = L.icon({
iconUrl: 'red_marker.png',
iconSize: [50, 50], // size of the icon
iconAnchor: [25, 25], // point of the icon which will correspond to marker's location
popupAnchor: [1, 1] // point from which the popup should open relative to the iconAnchor
});
// specify popup options
var customOptions =
{
'maxWidth': '500',
'className' : 'custom'
}
L.marker([51.5, -0.09], {icon: redIcon}).bindPopup('<b>UK!</b><br>Nice place.</br><iframe width="300" height="169" src="https://www.youtube.com/embed/ghkQoJoipbM?start=3571" frameborder="0" allowfullscreen></iframe>',customOptions).addTo(map5);
</script>
</body>
</html>