OpenLayers 3 example client for a local Mapsforge Tile Server installation (https://github.com/develar/mapsforge-tile-server).
Created
January 24, 2015 12:12
-
-
Save nrenner/70a07723355f483d640b to your computer and use it in GitHub Desktop.
Mapsforge Tile Server - OL3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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