open-geo-words
Version:
Convert coordinates into user-friendly three words
57 lines (50 loc) • 1.31 kB
HTML
<html lang="en">
<head>
<link rel="stylesheet"
href="ol.css" type="text/css">
<style>
body,
html {
padding: 0px;
margin: 0px;
}
.map {
height: 100vh;
width: 100%;
}
.info {
position: absolute;
left: 0px;
bottom: 0px;
padding: 7px 15px;
white-space: pre;
background: rgba(0, 0, 0, 0.7);
color: white;
font-family: monospace;
line-height: 1.5em;
}
</style>
<script src="ol.js"></script>
<title>OpenLayers Example</title>
</head>
<body>
<div id="map" class="map"></div>
<div id="info" class="info"></div>
<script type="text/javascript">
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM(),
}),
],
view: new ol.View({
center: ol.proj.transform([-73.9712, 40.7831], 'EPSG:4326', 'EPSG:3857'),
zoom: 13,
}),
});
</script>
<script src="dist/index.js"></script>
</body>
</html>