1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>Draw Feature Acceptance Test</title>
4 <style type="text/css">
22 <script src="../../lib/OpenLayers.js"></script>
23 <script type="text/javascript">
28 var wms, vector, ctrl;
29 var goodMaxRes = OpenLayers.Map.prototype.maxResolution;
30 var badMaxRes = 0.00000001;
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);
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);
55 map1.setCenter(new OpenLayers.LonLat(0, 0), 3);
56 map2.setCenter(new OpenLayers.LonLat(0, 0), 3);
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;" />
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>