Skip to content

Instantly share code, notes, and snippets.

@nrenner
Created January 24, 2015 12:12
Show Gist options
  • Save nrenner/70a07723355f483d640b to your computer and use it in GitHub Desktop.
Save nrenner/70a07723355f483d640b to your computer and use it in GitHub Desktop.
Mapsforge Tile Server - OL3
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="http://openlayers.org/en/v3.1.1/css/ol.css" type="text/css">
<style>
body {
margin: 0;
}
html, body, .map {
height: 100%;
width: 100%;
}
</style>
<script src="http://openlayers.org/en/v3.1.1/build/ol.js" type="text/javascript"></script>
<title>mapsforge-tile-server OpenLayers 3</title>
</head>
<body>
<div id="map" class="map"></div>
<script type="text/javascript">
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM({url: 'http://localhost:6090/{z}/{x}/{y}.png'})
})
],
view: new ol.View({
center: ol.proj.transform([9.86, 50.99], 'EPSG:4326', 'EPSG:3857'),
zoom: 6
})
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment