add champs-libres cyclosm tiles + a sandbox for implementing other tiles

This commit is contained in:
nobohan
2021-05-22 13:44:13 +02:00
parent f503c42244
commit 81a7ddbae0
62 changed files with 34754 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="../../lib/leaflet/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="../../lib/leaflet/leaflet.js"></script>
<script src="../../lib/proj4-compressed.js"></script>
<script src="../../src/proj4leaflet.js"></script>
<script src="script.js"></script>
</body>
</html>

View File

@@ -0,0 +1,41 @@
var map = L.map('map').setView([44.97,-93.24], 11);
// MapQuest OSM Tiles
// Attribution (https://gist.github.com/mourner/1804938)
var osmAttr = 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
mqTilesAttr = 'Tiles &copy; <a href="https://www.mapquest.com/"" target="_blank">MapQuest</a> <img src="https://developer.mapquest.com/content/osm/mq_logo.png" />';
L.tileLayer(
'https://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png',
{
attribution: 'Data by <a href="https://openstreetmap.org">OpenStreetMap contributors</a>'
}
)
.addTo(map);
// GeoJSON layer (UTM15)
proj4.defs('EPSG:26915', '+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs');
var geojson = {
'type': 'Feature',
'geometry': {
'type': 'Point',
'coordinates': [481650, 4980105],
},
'properties': {
'name': 'University of Minnesota'
},
'crs': {
'type': 'name',
'properties': {
'name': 'urn:ogc:def:crs:EPSG::26915'
}
}
};
L.Proj.geoJson(geojson, {
'pointToLayer': function(feature, latlng) {
return L.marker(latlng).bindPopup(feature.properties.name);
}
}).addTo(map);

View File

@@ -0,0 +1,10 @@
html, body {
height: 100%;
padding: 0;
margin: 0;
}
#map {
width: 100%;
height: 100%;
}