apply patch-3531-A0.diff from trac ticket #3531
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>OpenLayers Client Zoom 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="clientzoom.js"></script>
|
||||
<style>
|
||||
.olControlAttribution {
|
||||
bottom: 5px;
|
||||
}
|
||||
#map {
|
||||
width: 512px;
|
||||
height: 512px;
|
||||
}
|
||||
#docs {
|
||||
width: 512px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body onload="init();">
|
||||
<h1 id="title">Client Zoom</h1>
|
||||
<div id="tags">
|
||||
client zoom continuous zooming
|
||||
</div>
|
||||
<p id="shortdesc">
|
||||
|
||||
This example demonstrates the <strong>"client zoom"</strong>
|
||||
functionality, where OpenLayers stretches the layer div if the
|
||||
current resolution isn't supported by that layer's tile server.
|
||||
|
||||
</p>
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
<div id="docs">
|
||||
|
||||
<p>
|
||||
|
||||
This map is configured with 22 resolutions, while the OSM tile
|
||||
server supports only the first 19 resolutions. When the zoom
|
||||
level is 19, 20 or 22 "client zoom" is applied on the OSM
|
||||
layer, i.e. the OSM layer div is stretched as necessary.
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
The map's initial zoom is 18. So if you zoom in using the zoom
|
||||
bar's "+" button you'll see that "client zoom" is applied.
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
The map is even configured with <code>fractionalZoom</code> set
|
||||
to true. So "client zoom" also applies if you choose arbitrary
|
||||
zoom levels using the slider of the zoom bar, or shift-drag
|
||||
boxes to zoom to arbitrary extents.
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
Enabling "client zoom" on a layer is done through the
|
||||
<code>serverResolutions</code> option. See the <a
|
||||
href="clientzoom.js" target="_blank"> clientzoom.js source</a>
|
||||
to see how this is done.
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,43 @@
|
||||
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
|
||||
),
|
||||
controls: [],
|
||||
fractionalZoom: true
|
||||
});
|
||||
|
||||
var osm = new OpenLayers.Layer.OSM(null, null, {
|
||||
resolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
|
||||
19567.87923828125, 9783.939619140625, 4891.9698095703125,
|
||||
2445.9849047851562, 1222.9924523925781, 611.4962261962891,
|
||||
305.74811309814453, 152.87405654907226, 76.43702827453613,
|
||||
38.218514137268066, 19.109257068634033, 9.554628534317017,
|
||||
4.777314267158508, 2.388657133579254, 1.194328566789627,
|
||||
0.5971642833948135, 0.25, 0.1, 0.05],
|
||||
serverResolutions: [156543.03390625, 78271.516953125, 39135.7584765625,
|
||||
19567.87923828125, 9783.939619140625,
|
||||
4891.9698095703125, 2445.9849047851562,
|
||||
1222.9924523925781, 611.4962261962891,
|
||||
305.74811309814453, 152.87405654907226,
|
||||
76.43702827453613, 38.218514137268066,
|
||||
19.109257068634033, 9.554628534317017,
|
||||
4.777314267158508, 2.388657133579254,
|
||||
1.194328566789627, 0.5971642833948135],
|
||||
transitionEffect: 'resize'
|
||||
});
|
||||
|
||||
map.addLayers([osm]);
|
||||
map.addControls([
|
||||
new OpenLayers.Control.Navigation(),
|
||||
new OpenLayers.Control.Attribution(),
|
||||
new OpenLayers.Control.PanZoomBar()
|
||||
]);
|
||||
map.setCenter(new OpenLayers.LonLat(659688.852138, 5710701.2962197), 18);
|
||||
}
|
||||
Reference in New Issue
Block a user