1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>OpenLayers Custom Control Point Examle</title>
4 <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5 <link rel="stylesheet" href="style.css" type="text/css" />
6 <script src="../lib/OpenLayers.js"></script>
7 <script type="text/javascript">
14 map = new OpenLayers.Map( $('map') );
16 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
17 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
19 var control = new OpenLayers.Control();
20 OpenLayers.Util.extend(control, {
22 // this Handler.Point will intercept the shift-mousedown
23 // before Control.MouseDefault gets to see it
24 this.point = new OpenLayers.Handler.Point( control,
25 {"done": this.notice},
26 {keyMask: OpenLayers.Handler.MOD_SHIFT});
27 this.point.activate();
30 notice: function (bounds) {
31 document.getElementById('bounds').innerHTML = bounds;
36 map.addControl(control);
37 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
41 <body onload="init()">
42 <h1 id="title">Custom Control Point Example</h1>
48 Demonstrate the addition of a point reporting control to the OpenLayers window.
51 <div id="map" class="smallmap"></div>
52 <div id="bounds"></div>