1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>OpenLayers: Control Panel</title>
4 <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5 <link rel="stylesheet" href="style.css" type="text/css" />
6 <style type="text/css">
15 .olControlPanel .olControlMouseDefaultsItemActive {
16 background-color: blue;
17 background-image: url("../theme/default/img/pan_on.png");
19 .olControlPanel .olControlMouseDefaultsItemInactive {
20 background-color: orange;
21 background-image: url("../theme/default/img/pan_off.png");
23 .olControlPanel .olControlDrawFeatureItemActive {
26 background-image: url("../theme/default/img/draw_line_on.png");
28 .olControlPanel .olControlDrawFeatureItemInactive {
31 background-image: url("../theme/default/img/draw_line_off.png");
33 .olControlPanel .olControlZoomBoxItemInactive {
36 background-color: orange;
37 background-image: url("../img/drag-rectangle-off.png");
39 .olControlPanel .olControlZoomBoxItemActive {
42 background-color: blue;
43 background-image: url("../img/drag-rectangle-on.png");
45 .olControlPanel .olControlZoomToMaxExtentItemInactive {
48 background-image: url("../img/zoom-world-mini.png");
52 <script src="../lib/Firebug/firebug.js"></script>
53 <script src="../lib/OpenLayers.js"></script>
54 <script type="text/javascript">
61 map = new OpenLayers.Map( 'map', { controls: [] } );
62 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
63 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
66 vlayer = new OpenLayers.Layer.Vector( "Editable" );
70 zb = new OpenLayers.Control.ZoomBox(
71 {title:"Zoom box: Selecting it you can zoom on an area by clicking and dragging."});
72 var panel = new OpenLayers.Control.Panel({defaultControl: zb});
74 new OpenLayers.Control.MouseDefaults(
75 {title:'You can use the default mouse configuration'}),
77 new OpenLayers.Control.DrawFeature(vlayer, OpenLayers.Handler.Path,
78 {title:'Draw a feature'}),
79 new OpenLayers.Control.ZoomToMaxExtent({title:"Zoom to the max extent"})
81 map.addControl(panel);
83 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
87 <body onload="init()">
88 <h3 id="title">Custom Control.Panel</h3>
90 Create a custom control.panel, styled entirely with
91 CSS, and add your own controls to it.
93 <div id="panel"></div>
94 <div id="map" class="smallmap"></div>