forked from Magellium/osmtilemaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ol-example.html
39 lines (36 loc) · 907 Bytes
/
ol-example.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
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css">
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script>
<title>OpenLayers/osmtilemaker preview example</title>
</head>
<body>
<h2>My local tiles</h2>
<div id="map" class="map"></div>
</body>
<style>
.map {
height: 600px;
width: 100%;
}
</style>
<script>
var layer = new ol.layer.Tile({
title: 'OSM',
source: new ol.source.OSM({
url: "http://localhost/local-tiles/{z}/{x}/{y}.png",
crossOrigin: null}),
visible: true,
zIndex: 0
});
var map = new ol.Map({
target: 'map',
layers: [layer],
view: new ol.View({
center: [0,0],
zoom: 3
})
});
</script>
</html>