Ticket #1478 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

Display only one unit on ScaleLine

Reported by: openlayers Owned by: tschaub
Priority: minor Milestone: 2.8 Release
Component: Control.ScaleLine Version: 2.6 RC1
Keywords: Cc:
State: Complete

Description

I've created Scaleline like this:

new OpenLayers.Control.ScaleLine({bottomOutUnits:'',bottomInUnits:'',maxWidth:150} )

to display km only. Work fine on FF2.0.0.13 (winXP) but map don't load anymore on IE6/7.

I don't know if this usage of Scaleline is "legal" but it could be cool to display only one unit.

Attachments

scaleLine.patch Download (12.3 KB) - added by zspitzer 5 years ago.
scaleLine v2.patch Download (1.0 KB) - added by openlayers 4 years ago.
scaleline.patch Download (2.0 KB) - added by crschmidt 4 years ago.

Change History

Changed 5 years ago by zspitzer

  • type changed from feature to bug

I am seeing this as well, it bombs out in IE in scaleline.js at line 191 at

this.eBottom.style.width = Math.round(bottomPx) + "px";

bottomPx is NaN when the bottom stuff is disabled

I am not sure where i found the documentation on doing it this way, but it is supported in Draw function

Changed 5 years ago by zspitzer

Changed 4 years ago by crschmidt

  • state set to Needs More Work
  • milestone set to 2.8 Release

Zak:

Can you make a patch that doesn't just display the whole file as changed? really hard to review that way...

Changed 4 years ago by openlayers

Changed 4 years ago by crschmidt

Changed 4 years ago by crschmidt

  • status changed from new to closed
  • state changed from Needs More Work to Complete
  • resolution set to fixed

(In [8950]) Fix to display only one unit on scaleline in IE. Previously, this worked in most browsers, but not IE. Includes a test, tested on IE6 and IE7. Patch by zspitzer, r=me, (Closes #1478)

Note: See TracTickets for help on using tickets.