OpenLayers OpenLayers

Ticket #1497: transition_gutter_test.html

File transition_gutter_test.html, 3.3 kB (added by johnwebbcole, 5 months ago)

example of gutter transitionEffect miss-alignment. mouse wheel zoom in and the roads will start jump off.

Line 
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3     <title>OpenLayers Transitions Example</title>
4     <style type="text/css">
5         #mapDiv {
6             width: 600px;
7             height: 600px;
8             border: 1px solid black;
9         }
10     </style>
11     <script src="../lib/OpenLayers.js"></script>
12     <script type="text/javascript">
13         var map;
14         function init(){
15             map = new OpenLayers.Map('mapDiv', {maxResolution: 'auto'});
16
17             var single_default_effect = new OpenLayers.Layer.WMS(
18                 "WMS untiled default",
19                 "http://labs.metacarta.com/wms/vmap0?",
20                 {layers: 'basic'},
21                 {singleTile: true}
22             );
23             var single_resize_effect = new OpenLayers.Layer.WMS(
24                 "WMS untiled resize",
25                 "http://labs.metacarta.com/wms/vmap0?",
26                 {layers: 'basic'},
27                 {singleTile: true, transitionEffect: 'resize'}
28             );
29             var tiled_default_effect = new OpenLayers.Layer.WMS(
30                 "WMS tiled default ",
31                 "http://labs.metacarta.com/wms/vmap0?",
32                 {layers: 'basic'}
33             );
34             var tiled_resize_effect = new OpenLayers.Layer.WMS(
35                 "WMS tiled resize",
36                 "http://labs.metacarta.com/wms/vmap0?",
37                 {layers: 'basic'},
38                 {transitionEffect: 'resize'}
39             );
40
41             var dm_wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
42                 "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
43                 {layers: "road",
44                  transparent: "true", format: "image/png" },
45                 {transitionEffect: 'resize'});
46
47             var dm_wms_gutter = new OpenLayers.Layer.WMS( "DM Solutions Demo Gutter 15",
48                 "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
49                 {layers: "road",
50                  transparent: "true", format: "image/png" },
51                 {transitionEffect: 'resize', gutter: 15});
52
53             map.addLayers([single_default_effect, single_resize_effect,
54                            tiled_default_effect, tiled_resize_effect, dm_wms, dm_wms_gutter]);
55             map.addControl(new OpenLayers.Control.LayerSwitcher());
56             map.setCenter(new OpenLayers.LonLat(-83.2375, 47.025), 4);
57         }
58     </script>
59   </head>
60   <body onload="init()">
61     <h1 id="title">Transition Example</h1>
62     <p id="shortdesc">
63         Demonstrates the use of transition effects in tiled and untiled layers.
64     </p>
65     <div id="mapDiv"></div>
66     <div id="docs">
67         There are two transitions that are currently implemented: null (the
68         default) and 'resize'.  The default transition effect is used when no
69         transition is specified and is implemented as no transition effect except
70         for panning singleTile layers.  The 'resize' effect resamples the current
71         tile and displays it stretched or compressed until the new tile is available.
72     <ul>
73         <li>The first layer is an untiled WMS layer with no transition effect.</li>
74         <li>The second layer is an untiled WMS layer with a 'resize' effect. </li>
75         <li>The third layer is a tiled WMS layer with no transition effect. </li>
76         <li>The fourth layer is a tiled WMS layer with a 'resize' effect. </li>
77     </ul>
78     </div>
79   </body>
80   </body>
81 </html>