Changeset 6575 for sandbox/enjahova
- Timestamp:
- 03/21/08 13:59:57 (10 months ago)
- Files:
-
- sandbox/enjahova/openlayers/examples/overviewmap.html (modified) (1 diff)
- sandbox/enjahova/openlayers/examples/panel.html (modified) (1 diff)
- sandbox/enjahova/openlayers/img/layer-switcher-maximize.png (modified) (previous)
- sandbox/enjahova/openlayers/lib/OpenLayers/Control.js (modified) (2 diffs)
- sandbox/enjahova/openlayers/lib/OpenLayers/Control/Panel.js (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/Control/test_Panel.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/list-tests.html (modified) (1 diff)
- sandbox/enjahova/openlayers/tests/test_Control.html (modified) (1 diff)
- sandbox/enjahova/openlayers/theme/FREAC/style.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
sandbox/enjahova/openlayers/examples/overviewmap.html
r5719 r6575 3 3 <title>Overview Map Example</title> 4 4 <script src="../lib/OpenLayers.js" type="text/javascript"></script> 5 <link href="../theme/FREAC/style.css" type="text/css" rel="stylesheet" /> 5 6 <style> 6 7 #map1 { sandbox/enjahova/openlayers/examples/panel.html
r5362 r6575 58 58 var lat = 40; 59 59 var zoom = 5; 60 var map, layer; 61 62 function init(){ 63 map = new OpenLayers.Map( 'map', { controls: [] } ); 64 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 65 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); 66 map.addLayer(layer); 67 68 vlayer = new OpenLayers.Layer.Vector( "Editable" ); 69 map.addLayer(vlayer); 60 var map, layer; 61 62 function init(){ 63 map = new OpenLayers.Map( 'map', { controls: [] } ); 64 map = new OpenLayers.Map( 'map', { controls: [], 'fallThrough':true } ); 65 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 66 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} ); 67 map.addLayer(layer); 68 69 map.addLayer(vlayer); 70 70 71 71 72 zb = new OpenLayers.Control.ZoomBox(); 73 var panel = new OpenLayers.Control.Panel({defaultControl: zb}); 74 panel.addControls([ 75 new OpenLayers.Control.MouseDefaults(), 76 zb, 77 new OpenLayers.Control.DrawFeature(vlayer, OpenLayers.Handler.Path), 78 new OpenLayers.Control.ZoomToMaxExtent() 79 ]); 80 map.addControl(panel); 72 zb = new OpenLayers.Control.ZoomBox(); 73 zb = new OpenLayers.Control.ZoomBox( 74 {title:"Zoom box: Selecting it you can zoom on an area by clicking and dragging."}); 75 var panel = new OpenLayers.Control.Panel({defaultControl: zb}); 76 panel.addControls([ 77 new OpenLayers.Control.MouseDefaults(), 78 new OpenLayers.Control.MouseDefaults( 79 {title:'You can use the default mouse configuration'}), 80 zb, 81 new OpenLayers.Control.DrawFeature(vlayer, OpenLayers.Handler.Path), 82 new OpenLayers.Control.ZoomToMaxExtent() 83 new OpenLayers.Control.DrawFeature(vlayer, OpenLayers.Handler.Path, 84 {title:'Draw a feature'}), 85 new OpenLayers.Control.ZoomToMaxExtent({title:"Zoom to the max extent"}) 86 ]); 87 map.addControl(panel); 81 88 82 89 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); sandbox/enjahova/openlayers/lib/OpenLayers/Control.js
r5719 r6575 85 85 */ 86 86 displayClass: "", 87 87 /** 88 * Property: title 89 * {string} This property is used for showing a tooltip over the 90 * Control. 91 */ 92 title: "", 88 93 /** 89 94 * Property: active … … 173 178 this.div = OpenLayers.Util.createDiv(this.id); 174 179 this.div.className = this.displayClass; 180 if (this.title != "") { 181 this.div.title = this.title; 182 } 175 183 } 176 184 if (px != null) { sandbox/enjahova/openlayers/lib/OpenLayers/Control/Panel.js
r5787 r6575 174 174 var textNode = document.createTextNode(" "); 175 175 controls[i].panel_div = element; 176 if (controls[i].title != "") { 177 controls[i].panel_div.title = controls[i].title; 178 } 176 179 OpenLayers.Event.observe(controls[i].panel_div, "click", 177 180 OpenLayers.Function.bind(this.onClick, this, controls[i])); sandbox/enjahova/openlayers/tests/Control/test_Panel.html
r5719 r6575 47 47 "activated the other tool control, the first one is inactive and the toggle control still active."); 48 48 } 49 49 function test_02_Control_Panel_titles (t) { 50 t.plan(2); 51 var panel = new OpenLayers.Control.Panel(); 52 var toolControl = new OpenLayers.Control.ZoomBox({ 53 title:"Zoom box: Selecting it you can zoom on an area by clicking and dragging." 54 }); 55 panel.addControls([toolControl]); 56 t.eq(panel.controls.length, 1, "added a control to the panel"); 57 t.eq(panel.controls[0].title, toolControl.panel_div.title, "the title is correctly set"); 58 } 59 50 60 function test_Control_Panel_getBy(t) { 51 61 sandbox/enjahova/openlayers/tests/list-tests.html
r5798 r6575 86 86 <li>Control/test_Permalink.html</li> 87 87 <li>Control/test_Scale.html</li> 88 <li>Control/test_ScaleBar.html</li> 88 89 <li>Control/test_ZoomToLastExtent.html</li> 89 90 <li>Control/test_ZoomOut.html</li> sandbox/enjahova/openlayers/tests/test_Control.html
r4676 r6575 23 23 } 24 24 25 function test_Control_title(t) { 26 t.plan( 1 ); 27 var titleText = 'Title test'; 28 control = new OpenLayers.Control({title:titleText}); 29 t.eq( control.title, titleText, "control.title set correctly" ); 30 } 25 31 function test_Control_destroy(t) { 26 32 t.plan(3); sandbox/enjahova/openlayers/theme/FREAC/style.css
r5953 r6575 128 128 .olControlOverviewMapContainer { 129 129 position: absolute; 130 bottom: 0px;130 bottom:170px; 131 131 right: 0px; 132 132 } … … 139 139 140 140 .olControlOverviewMapMinimizeButton { 141 right:0px;142 bottom: 80px;141 bottom:0px; 142 right:0px; 143 143 } 144 144 145 145 .olControlOverviewMapMaximizeButton { 146 right: 0px; 147 bottom: 80px; 148 } 149 146 bottom:0px; 147 right:0px; 148 } 150 149 .olControlOverviewMapExtentRectangle { 151 150 cursor: move; 152 border: 2px dotted red;151 border: 2px dotted #A0D08C; 153 152 } 154 153 .olLayerGeoRSSDescription {
