Created
September 5, 2013 15:49
-
-
Save ccabanero/6452027 to your computer and use it in GitHub Desktop.
TileStream - Sample code for adding a TileStream cache to Leaflet
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
<html> | |
<head> | |
<title>Sample: Adding TileStream cache to Leaflet</title> | |
<meta charset="utf-8" /> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" /> | |
<!--[if lte IE 8]><link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" /><![endif]--> | |
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script> | |
<script> | |
$(document).ready(function(){ | |
var map = new L.Map('map').setView([9.145, 40.489673], 5); | |
//change and supply your static ip and cache name | |
var tileLayer = L.tileLayer('http://1.2.3.4:8888/v2/MyCacheName/{z}/{x}/{y}.png',{opacity: 0.8}); | |
map.addLayer(tileLayer); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="map" style="width: 1000px; height: 750px"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works! Thank you.