leaflet.mousecoordinatesystems
Version:
A Coordinate Mouse Viewer for Leaflet
37 lines (28 loc) • 1.2 kB
HTML
<html>
<head>
<meta charset="utf-8">
<title>Leaflet MGRS Overlay Demo</title>
<link rel="stylesheet" href="bower_components/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="dist/leaflet.mousecoordinate.css" />
<style type="text/css">
html, body { width: 100%; height: 100%; margin: 0; }
#map { width: 100%; height: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script src="bower_components/leaflet/dist/leaflet.js"></script>
<script src="dist/leaflet.mousecoordinate.js"></script>
<script type="text/javascript">
map = new L.Map('map');
// create the tile layer with correct attribution
var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 20, attribution: osmAttrib});
map.setView(new L.LatLng(59,5),6);
map.addLayer(osm);
L.control.mouseCoordinate({gpsLong: true, utm:true,utmref:true,gps: true,nac: true}).addTo(map);
</script>
</body>
</html>