Adding a WMTS layer and capabilities parser to work with OGC WMTS service implementations. Thanks August Town for this nice contribution. p=august,me r=me (closes #2637)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10388 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
31
examples/wmts.html
Normal file
31
examples/wmts.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>OpenLayers WMTS 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/Firebug/firebug.js"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script src="wmts.js"></script>
|
||||
</head>
|
||||
<body onload="init();">
|
||||
<h1 id="title">Web Map Tile Service (WMTS) Layer</h1>
|
||||
|
||||
<p id="shortdesc">
|
||||
The WMTS layer allows viewing of tiles from a server implementing
|
||||
the OGC Web Map Tile Service (WMTS) standard version 1.0.0.
|
||||
</p>
|
||||
|
||||
<div id="map" class="smallmap"></div>
|
||||
|
||||
<div id="docs">
|
||||
<p>
|
||||
This example uses an OpenLayers.Layer.WMTS layer to display
|
||||
cached tiles over an OSM layer in spherical mercator coordinates.
|
||||
</p><p>
|
||||
See the <a href="wmts.js" target="_blank">
|
||||
wmts.js source</a> to see how this is done.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
40
examples/wmts.js
Normal file
40
examples/wmts.js
Normal file
@@ -0,0 +1,40 @@
|
||||
var map;
|
||||
|
||||
function init() {
|
||||
|
||||
map = new OpenLayers.Map({
|
||||
div: "map",
|
||||
projection: "EPSG:900913",
|
||||
units: "m",
|
||||
maxExtent: new OpenLayers.Bounds(
|
||||
-20037508.34, -20037508.34, 20037508.34, 20037508.34
|
||||
),
|
||||
maxResolution: 156543.0339
|
||||
});
|
||||
|
||||
var osm = new OpenLayers.Layer.OSM();
|
||||
|
||||
// If tile matrix identifiers differ from zoom levels (0, 1, 2, ...)
|
||||
// then they must be explicitly provided.
|
||||
var matrixIds = new Array(26);
|
||||
for (var i=0; i<26; ++i) {
|
||||
matrixIds[i] = "EPSG:900913:" + i;
|
||||
}
|
||||
|
||||
var wmts = new OpenLayers.Layer.WMTS({
|
||||
name: "Medford Buildings",
|
||||
url: "http://v2.suite.opengeo.org/geoserver/gwc/service/wmts/",
|
||||
layer: "medford:buildings",
|
||||
matrixSet: "EPSG:900913",
|
||||
matrixIds: matrixIds,
|
||||
format: "image/png",
|
||||
style: "_null",
|
||||
opacity: 0.7,
|
||||
isBaseLayer: false
|
||||
});
|
||||
|
||||
map.addLayers([osm, wmts]);
|
||||
map.addControl(new OpenLayers.Control.LayerSwitcher());
|
||||
map.setCenter(new OpenLayers.LonLat(-13677832, 5213272), 13);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user