-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
43 lines (42 loc) · 1.34 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<title>lk25</title>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script src="https://maptilercdn.s3.amazonaws.com/klokantech.js"></script>
<script>
var map;
var mapMinZoom = 11;
var mapMaxZoom = 16;
var mapBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(46.929649, 9.539910),
new google.maps.LatLng(46.985765, 9.656996));
var mapGetTile = function(x,y,z) {
return z + "/" + x + "/" + y + ".png";
}
function init() {
var opts = {
streetViewControl: false,
mapTypeId: 'maptiler',
backgroundColor: "rgb(255,255,255)",
center: new google.maps.LatLng(0,0),
zoom: 11,
mapTypeControlOptions: { mapTypeIds: ['maptiler'] }
}
map = new google.maps.Map(document.getElementById("map"), opts);
var maptiler = new klokantech.MapTilerMapType(map, mapGetTile, mapBounds, mapMinZoom, mapMaxZoom);
maptiler.name = "MapTiler";
map.mapTypes.set('maptiler', maptiler);
map.fitBounds(mapBounds);
}
</script>
<style>
html, body, #map { width:100%; height:100%; margin:0; padding:0; }
</style>
</head>
<body onload="init()">
<div id="map">A map generated with <a href="http://www.maptiler.com/">MapTiler</a></div>
</body>
</html>