Changeset 7163
- Timestamp:
- 05/13/08 16:52:01 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control/MousePosition.js
r6727 r7163 41 41 * {Integer} 42 42 */ 43 num digits: 5,43 numDigits: 5, 44 44 45 45 /** … … 145 145 */ 146 146 formatOutput: function(lonLat) { 147 var digits = parseInt(this.num digits);147 var digits = parseInt(this.numDigits); 148 148 var newHtml = 149 149 this.prefix + trunk/openlayers/tests/Control/MousePosition.html
r6724 r7163 4 4 <script type="text/javascript"> 5 5 var map, control; 6 function test_ Control_MousePosition_constructor(t) {6 function test_initialize (t) { 7 7 t.plan( 2 ); 8 8 … … 11 11 t.eq( control.displayClass, "olControlMousePosition", "displayClass is correct" ); 12 12 } 13 function test_ Control_MousePosition_redraw_noLayer_displayProjection(t) {13 function test_redraw_noLayer_displayProjection(t) { 14 14 t.plan(2); 15 15 control = new OpenLayers.Control.MousePosition({'displayProjection': new OpenLayers.Projection("WGS84")}); … … 26 26 t.eq(control.div.innerHTML, "-175.78125, 85.78125", "innerHTML set correctly when triggered."); 27 27 } 28 function test_ MousePosition_destroy(t) {28 function test_destroy(t) { 29 29 t.plan(1); 30 30 … … 39 39 map.destroy(); 40 40 } 41 42 function test_MousePosition_addControl(t) { 41 function test_addControl(t) { 43 42 t.plan(4); 44 43 … … 53 52 map.destroy(); 54 53 } 55 56 function test_Control_MousePosition_redraw_noLayer_displayProjection(t) { 54 function test_redraw_noLayer_displayProjection(t) { 57 55 t.plan(3); 58 56 var control = new OpenLayers.Control.MousePosition(); … … 71 69 map.destroy(); 72 70 } 71 function test_formatOutput(t) { 72 t.plan(1); 73 var control = new OpenLayers.Control.MousePosition({ 74 prefix: 'prefix', 75 suffix: 'suffix', 76 separator: 'separator', 77 numDigits: 3 78 }); 79 var lonlat = new OpenLayers.LonLat(0.75699, 0.37365); 80 var val = control.formatOutput(lonlat); 81 t.eq(val, 'prefix0.757separator0.374suffix', 'formatOutput correctly formats the mouse position output'); 82 } 73 83 </script> 74 84 </head>
