Changeset 7374
- Timestamp:
- 06/18/08 04:57:02 (2 months ago)
- Files:
-
- trunk/openlayers/examples/projected-map.html (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Control/OverviewMap.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Control/ScaleLine.js (modified) (1 diff)
- trunk/openlayers/lib/OpenLayers/Map.js (modified) (1 diff)
- trunk/openlayers/tests/Control/ScaleLine.html (modified) (1 diff)
- trunk/openlayers/tests/Map.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/examples/projected-map.html
r7095 r7374 48 48 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 49 49 map.addControl(new OpenLayers.Control.LayerSwitcher()); 50 map.addControl(new OpenLayers.Control.ScaleLine()); 50 51 } 51 52 </script> trunk/openlayers/lib/OpenLayers/Control/OverviewMap.js
r6810 r7374 496 496 // The base layer for overview map needs to be in the same projection 497 497 // as the base layer for the main map. This should be made more robust. 498 if(this.map. units!= 'degrees') {498 if(this.map.getUnits() != 'degrees') { 499 499 if(this.ovmap.getProjection() && (this.map.getProjection() != this.ovmap.getProjection())) { 500 500 alert(OpenLayers.i18n("sameProjection")); trunk/openlayers/lib/OpenLayers/Control/ScaleLine.js
r6727 r7374 154 154 } 155 155 156 var curMapUnits = this.map. units;156 var curMapUnits = this.map.getUnits(); 157 157 var inches = OpenLayers.INCHES_PER_UNIT; 158 158 trunk/openlayers/lib/OpenLayers/Map.js
r7311 r7374 1764 1764 }, 1765 1765 1766 /** 1767 * APIMethod: getUnits 1768 * 1769 * Returns: 1770 * {Float} The current units of the map. 1771 * If no baselayer is set, returns null. 1772 */ 1773 getUnits: function () { 1774 var units = null; 1775 if (this.baseLayer != null) { 1776 units = this.baseLayer.units; 1777 } 1778 return units; 1779 }, 1780 1766 1781 /** 1767 1782 * APIMethod: getScale trunk/openlayers/tests/Control/ScaleLine.html
r6719 r7374 87 87 t.eq(control.div.firstChild.style.visibility, "visible", "top scale is present."); 88 88 t.eq(control.div.lastChild.style.visibility, "visible", "bottom scale is present."); 89 t.eq(control.div.firstChild.innerHTML, "200 00 km", "top scale has correct text.");90 t.eq(control.div.lastChild.innerHTML, " 20000 mi", "bottom scale has correct text.");89 t.eq(control.div.firstChild.innerHTML, "200 m", "top scale has correct text."); 90 t.eq(control.div.lastChild.innerHTML, "1000 ft", "bottom scale has correct text."); 91 91 map.destroy(); 92 92 } trunk/openlayers/tests/Map.html
r6724 r7374 1001 1001 map.destroy(); 1002 1002 } 1003 1004 function test_Map_getUnits(t) { 1005 t.plan(2); 1006 var map = new OpenLayers.Map("map"); 1007 var units = map.getUnits(); 1008 t.eq(units, null, "getUnits returns null for no base layer"); 1009 1010 var layer = new OpenLayers.Layer("test", { 1011 isBaseLayer: true, 1012 units: 'foo' 1013 }); 1014 map.addLayer(layer); 1015 var units = map.getUnits(); 1016 t.eq(units, 'foo', "getUnits returns the base layer units property"); 1017 layer.destroy(); 1018 map.destroy(); 1019 } 1003 1020 1004 1021 function test_Map_destroy (t) {
