-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
80 lines (64 loc) · 2.26 KB
/
index.html
File metadata and controls
80 lines (64 loc) · 2.26 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
<link rel="stylesheet" href="tedletrash.github.io/script/leaflet.css">
<script src="https://unpkg.com/leaflet@1.9.2/dist/leaflet.js"></script>
<div id='map' style="width:100%;height:100%" ></div>
<script>
var map = L.map('map',{
crs: L.CRS.Simple,
// center: [[0.0, 0.0]]
});
// List of all our defaults styles names
const styles = ['satellite', 'atlas', 'road' ];
const baselayers = {};
// Creating one tile layers for each style
styles.forEach((style) =>
baselayers[style] = L.tileLayer(
`tiles/${style}/{z}-{x}_{y}.png`, {
foo: 'bar',
attribution: '<a href="https://cybricode.com">Mateo MROZEK</a>',
maxZoom: 7,
minZoom: 4,
tileSize: 256,
}
)
);
// Set the default layer when you open the map
baselayers['atlas'].addTo(map);
// Associating each style name to its tile layer
L.control.layers(baselayers).addTo(map);
var satellite = L.tileLayer('tiles/satellite/{z}-{x}_{y}.png?{foo}', {
foo: 'bar',
attribution: '<a href="https://cybricode.com">Mateo MROZEK</a>',
maxZoom: 7,
minZoom: 4,
tileSize: 256,
}).addTo(map);
console.log(satellite);
// var mapBounds = new L.LatLngBounds([
// L.latLng(0,0),
// L.latLng(10,10)
// ]);
// map.fitBounds(mapBounds);
// var h = satellite.options.tileSize * 3,
// w = satellite.options.tileSize * 2;
// var southWest = map.unproject([0, h], 0);
// var northEast = map.unproject([w, 0], 0);
// mapBounds = L.LatLngBounds(southWest, northEast);
// console.log(mapBounds);
// map.fitBounds(mapBounds);
// var sol = L.latLng([ 0, 0 ]);
// L.marker(sol).addTo(map);
map.setView( [-44, 44], 1); // ELEMENT A UTILISER POUR POSITIONNER LE POINTER !!!!!!
//L.marker([-47.75, 42.9375]).addTo(map); // BORDURE BAS DROITE
L.marker([-47.75, 42.9375]).addTo(map)
.bindPopup('<b>moi c est yoda</b><br />je suis gay.').openPopup();
//Coordinate Finder
var marker = L.marker([0, 0], {
draggable: true,
}).addTo(map);
marker.bindPopup('LatLng Marker').openPopup();
marker.on('dragend', function(e) {
marker.getPopup().setContent(marker.getLatLng().toString()).openOn(map);
});
// var game_1_x = -4000.00 - 230;?
// var game_1_y = 8000.00 + 420;
</script>