HTML fmt
This commit is contained in:
parent
2329eadae4
commit
6445883f00
82
index.html
82
index.html
@ -1,48 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Honestly stolen from BlackSharkDen</title>
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
|
||||
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
|
||||
<link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
<style>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Honestly stolen from BlackSharkDen</title>
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
|
||||
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
|
||||
<link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
<style>
|
||||
body { margin: 0; padding: 0; }
|
||||
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
|
||||
#info {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin: 0px auto;
|
||||
width: 50%;
|
||||
padding: 10px;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
color: #222;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<pre id="info"></pre>
|
||||
<script>
|
||||
var map = new maplibregl.Map({
|
||||
container: 'map',
|
||||
style: 'https://api.maptiler.com/maps/topo-v2/style.json?key=<replace-me>',
|
||||
center: [42, 42],
|
||||
zoom: 7
|
||||
});
|
||||
|
||||
#info {
|
||||
display: block;
|
||||
position: relative;
|
||||
margin: 0px auto;
|
||||
width: 50%;
|
||||
padding: 10px;
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
color: #222;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<pre id="info"></pre>
|
||||
<script>
|
||||
var map = new maplibregl.Map({
|
||||
container: 'map',
|
||||
style: 'https://api.maptiler.com/maps/topo-v2/style.json?key=<replace-me>',
|
||||
center: [42, 42],
|
||||
zoom: 7
|
||||
});
|
||||
|
||||
map.on('load', function () {
|
||||
map.on('load', function () {
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function MGRSString (Lat, Long) {
|
||||
function MGRSString (Lat, Long) {
|
||||
//if (Lat < -80) return 'Too far South' ; if (Lat > 84) return 'Too far North' ;
|
||||
|
||||
var c = 1 + Math.floor ((Long+180)/6);
|
||||
@ -76,14 +75,13 @@ function MGRSString (Lat, Long) {
|
||||
aa = Math.floor (aa%100000); aa = pad (aa);
|
||||
ab = Math.floor (ab%100000); ab = pad (ab);
|
||||
return c + ad + ' ' + af + ah + ' ' + aa + ' ' + ab;
|
||||
};
|
||||
};
|
||||
|
||||
map.on('mousemove', function (e) {
|
||||
map.on('mousemove', function (e) {
|
||||
var coordinate = e.lngLat.wrap();
|
||||
document.getElementById('info').innerHTML = MGRSString(coordinate.lat, coordinate.lng);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user