-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtile_schema.html
69 lines (59 loc) · 1.45 KB
/
tile_schema.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>Canvas Tiles</title>
<script src="ol/v4.4.1/ol.js"></script>
<!-- style -->
<link rel="stylesheet" href="ol/v4.4.1/ol.css">
<style type="text/css">
/* for full page map */
html, body {
margin: 0;
height: 100%;
font-family: 'Open Sans', sans-serif;
font-size: 12px;
}
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div id="map" class="map"></div>
<script>
var osmSource = new ol.source.OSM();
// OSM BR
var osm_br = new ol.source.XYZ({
url: 'https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png'
});
var map = new ol.Map({
layers: [
new ol.layer.Tile({
source: osm_br
}),
new ol.layer.Tile({
source: new ol.source.TileDebug({
projection: 'EPSG:3857',
tileGrid: osm_br.getTileGrid()
})
})
],
target: 'map',
controls: ol.control.defaults({
attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
collapsible: false
})
}),
view: new ol.View({
center: ol.proj.transform(
[-2.15, 48.50], 'EPSG:4326', 'EPSG:3857'),
zoom: 8
})
});
</script>
</body>
</html>