Changeset 6557
- Timestamp:
- 03/19/08 17:09:53 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control/ScaleLine.js
r6431 r6557 155 155 } 156 156 157 var curMapUnits = this.map.units; 158 var inches = OpenLayers.INCHES_PER_UNIT; 159 157 160 // convert maxWidth to map units 158 var maxSizeData = this.maxWidth * res ;161 var maxSizeData = this.maxWidth * res * inches[curMapUnits]; 159 162 160 163 // decide whether to use large or small scale units 161 164 var topUnits; 162 165 var bottomUnits; 163 if(maxSizeData > 0.1) {166 if(maxSizeData > 100000) { 164 167 topUnits = this.topOutUnits; 165 168 bottomUnits = this.bottomOutUnits; … … 170 173 171 174 // and to map units units 172 var curMapUnits = this.map.units; 173 var inches = OpenLayers.INCHES_PER_UNIT; 174 var topMax = maxSizeData * inches[curMapUnits] / inches[topUnits]; 175 var bottomMax = maxSizeData * inches[curMapUnits] / inches[bottomUnits]; 175 var topMax = maxSizeData / inches[topUnits]; 176 var bottomMax = maxSizeData / inches[bottomUnits]; 176 177 177 178 // now trim this down to useful block length
