-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_map.html
More file actions
167 lines (133 loc) · 7.73 KB
/
Copy pathtest_map.html
File metadata and controls
167 lines (133 loc) · 7.73 KB
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>
L_NO_TOUCH = false;
L_DISABLE_3D = false;
</script>
<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.3/dist/leaflet.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.0/css/all.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_6973456fda749a00101babb4bf699e2e {
position: relative;
width: 100.0%;
height: 100.0%;
left: 0.0%;
top: 0.0%;
}
.leaflet-container { font-size: 1rem; }
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/1.4.2/Control.FullScreen.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.fullscreen/1.4.2/Control.FullScreen.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.2/leaflet.draw.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.2/leaflet.draw.css"/>
<script src="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet-control-geocoder/dist/Control.Geocoder.css"/>
</head>
<body>
<div class="folium-map" id="map_6973456fda749a00101babb4bf699e2e" ></div>
</body>
<script>
var map_6973456fda749a00101babb4bf699e2e = L.map(
"map_6973456fda749a00101babb4bf699e2e",
{
center: [20.0, 0.0],
crs: L.CRS.EPSG3857,
zoom: 2,
zoomControl: true,
preferCanvas: false,
eeInitialize: true,
addGoogleMap: true,
pluginLatlngpopup: false,
pluginFullscreen: true,
pluginDraw: true,
DrawExport: false,
pluginMinimap: false,
locateControl: false,
searchControl: true,
layersControl: true,
}
);
var tile_layer_fa46238ac640287f08dcbf0ebbb84d46 = L.tileLayer(
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
{"attribution": "Data by \u0026copy; \u003ca target=\"_blank\" href=\"http://openstreetmap.org\"\u003eOpenStreetMap\u003c/a\u003e, under \u003ca target=\"_blank\" href=\"http://www.openstreetmap.org/copyright\"\u003eODbL\u003c/a\u003e.", "detectRetina": false, "maxNativeZoom": 30, "maxZoom": 30, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}
).addTo(map_6973456fda749a00101babb4bf699e2e);
var tile_layer_div_1 = L.tileLayer(
"https://mt1.google.com/vt/lyrs=m\u0026x={x}\u0026y={y}\u0026z={z}",
{"attribution": "Google", "detectRetina": false, "maxNativeZoom": 22, "maxZoom": 22, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}
).addTo(map_6973456fda749a00101babb4bf699e2e);
L.control.fullscreen(
{"forceSeparateButton": false, "position": "topleft", "title": "Full Screen", "titleCancel": "Exit Full Screen"}
).addTo(map_6973456fda749a00101babb4bf699e2e);
var options = {
position: "topleft",
draw: {},
edit: {},
}
// FeatureGroup is to store editable layers.
var drawnItems = new L.featureGroup().addTo(
map_6973456fda749a00101babb4bf699e2e
);
options.edit.featureGroup = drawnItems;
var draw_control_f15f091cdb49cb28a5087e1d494dc3ee = new L.Control.Draw(
options
).addTo( map_6973456fda749a00101babb4bf699e2e );
map_6973456fda749a00101babb4bf699e2e.on(L.Draw.Event.CREATED, function(e) {
var layer = e.layer,
type = e.layerType;
var coords = JSON.stringify(layer.toGeoJSON());
layer.on('click', function() {
alert(coords);
console.log(coords);
});
drawnItems.addLayer(layer);
});
map_6973456fda749a00101babb4bf699e2e.on('draw:created', function(e) {
drawnItems.addLayer(e.layer);
});
L.Control.geocoder(
{"collapsed": true, "defaultMarkGeocode": true, "position": "topleft"}
).on('markgeocode', function(e) {
map_6973456fda749a00101babb4bf699e2e.setView(e.geocode.center, 11);
}).addTo(map_6973456fda749a00101babb4bf699e2e);
map_6973456fda749a00101babb4bf699e2e.fitBounds(
[[20, 0], [20, 0]],
{"maxZoom": 2}
);
map_6973456fda749a00101babb4bf699e2e.fitBounds(
[[52.535262, 13.42378], [52.535262, 13.42378]],
{"maxZoom": 17}
);
var tile_layer_81e79f1d13efca833ceebe9c04732056 = L.tileLayer(
"https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/maps/27d5dddee22246a5a6c1b482ae0fa8f1-24bf5bd41cc423ecc6e3dae1f140d81e/tiles/{z}/{x}/{y}",
{"attribution": "Google Earth Engine", "detectRetina": false, "maxNativeZoom": 24, "maxZoom": 24, "minZoom": 0, "noWrap": false, "opacity": 1.0, "subdomains": "abc", "tms": false}
).addTo(map_6973456fda749a00101babb4bf699e2e);
var layer_control_0ed9461ade351923a9ded93f590865a2 = {
base_layers : {
"openstreetmap" : tile_layer_fa46238ac640287f08dcbf0ebbb84d46,
},
overlays : {
"Google Maps" : tile_layer_div_1,
"Earth Engine [\u0027R\u0027, \u0027G\u0027, \u0027B\u0027]" : tile_layer_81e79f1d13efca833ceebe9c04732056,
},
};
L.control.layers(
layer_control_0ed9461ade351923a9ded93f590865a2.base_layers,
layer_control_0ed9461ade351923a9ded93f590865a2.overlays,
{"autoZIndex": true, "collapsed": true, "position": "topright"}
).addTo(map_6973456fda749a00101babb4bf699e2e);
</script>
</html>