Files
openlayers/examples/tilecache.html

63 lines
2.0 KiB
HTML

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OpenLayers TileCache Example</title>
<style type="text/css">
#map {
width: 512px;
height: 512px;
}
</style>
<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"></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>