]> dev.renevier.net Git - syp.git/blob - openlayers/tests/manual/draw-feature.html
show number of features on cluster markers
[syp.git] / openlayers / tests / manual / draw-feature.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3     <title>Draw Feature Acceptance Test</title>
4     <style type="text/css">
5     
6         body {
7             font-size: 0.8em;
8         }
9         p {
10             padding-top: 1em;
11         }
12         
13         .map {
14             margin: 1em;
15             float: left;
16             width: 256px;
17             height: 256px;
18         }
19
20     </style>
21
22     <script src="../../lib/OpenLayers.js"></script>
23     <script type="text/javascript">
24  
25         var map1, map2;
26
27         function init(){
28             var wms, vector, ctrl;
29             var goodMaxRes = OpenLayers.Map.prototype.maxResolution;
30             var badMaxRes = 0.00000001;
31
32             map1 = new OpenLayers.Map('map1');
33             wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
34                 "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
35             vector = new OpenLayers.Layer.Vector("vector1");
36             map1.addLayers([wms, vector]);
37             ctrl = new OpenLayers.Control.DrawFeature(vector,
38                 OpenLayers.Handler.Path);
39             map1.addControl(ctrl);
40             ctrl.activate();
41  
42             map2 = new OpenLayers.Map('map2',
43                 {maxResolution: badMaxRes});
44             wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
45                 "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
46                 {maxResolution: goodMaxRes});
47             vector = new OpenLayers.Layer.Vector("vector2",
48                 {maxResolution: goodMaxRes});
49             map2.addLayers([wms, vector]);
50             ctrl = new OpenLayers.Control.DrawFeature(vector,
51                 OpenLayers.Handler.Path);
52             map2.addControl(ctrl);
53             ctrl.activate();
54
55             map1.setCenter(new OpenLayers.LonLat(0, 0), 3);
56             map2.setCenter(new OpenLayers.LonLat(0, 0), 3);
57         }
58
59     </script>
60   </head>
61   <body onload="init()">
62     <div id="map1" class="map"></div>
63     <p><b>Resolution properties set at the map level.</b></p>
64     <p>Points should draw as you draw lines. Click to start
65     drawing and double-click to draw the last point.</p>
66     <br style="clear: both;" />
67
68     <div id="map2" class="map"></div>
69     <p><b>Resolution properties set at the layer level.</b></p>
70     <p>Points should draw as you draw lines. Click to start
71     drawing and double-click to draw the last point.</p>
72   </body>
73 </html>