tilecache.html
2.1 KB
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
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers TileCache Example</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
map = new OpenLayers.Map( $('map'));
layer = new OpenLayers.Layer.TileCache("TileCache Layer",
["http://c0.labs.metacarta.com/wms-c/cache/",
"http://c1.labs.metacarta.com/wms-c/cache/",
"http://c2.labs.metacarta.com/wms-c/cache/",
"http://c3.labs.metacarta.com/wms-c/cache/",
"http://c4.labs.metacarta.com/wms-c/cache/"],
"basic",
{
'format': 'image/png',
maxResolution: 180/256 // same as the TileCache config
}
);
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
}
OpenLayers.Util.onImageLoadError = function() {
/**
* For images that don't exist in the cache, you can display
* a default image - one that looks like water for example.
* To show nothing at all, leave the following lines commented out.
*/
//this.src = "../img/blank.gif";
//this.style.display = "";
};
</script>
</head>
<body onload="init()">
<h1 id="title">TileCache Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Demonstrates a TileCache layer that loads tiles from from a web
accessible disk-based cache only.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
This layer should be used for web accessible disk-based caches only.
It is not used to request new tiles from TileCache. Note that you
should specify resolutions explicitly on this layer so that they match
your TileCache configuration.
</div>
</body>
</html>