Opened 16 years ago

Closed 16 years ago

#8 closed enhancement (fixed)

Scale returned could be rounded

Reported by: jfournier Owned by: madair
Priority: P2 Milestone: 1.0.5
Component: Widgets Version: 1.0.2
Severity: Minor Keywords:
Cc: Browser: All
External ID: Operating System: All
state: New

Description

In Map.js getScale function :

value returned was 400000.000002. Application was expecting 4000000 (in the legend) I think rounding the scale returned should be done in that function.

Change History (4)

comment:1 by pagameba, 16 years ago

The previously applied patch was r1205. This patch is incorrect because it is valid for scales to have fractional values, so just rounding the scale is not a good idea.

The legend requests legend icon urls by scale range and the fractional value is causing the request to lie just outside of the valid range in this specific case. The code that determines if a scale value is in a scale range should be modified to relax the test by either converting the scale to a specific precision based on the size of the number or to compare numbers within a certain tolerance. OpenLayers has a function for comparing within a tolerance I believe.

comment:2 by pagameba, 16 years ago

Milestone: 1.0.31.0.4

comment:3 by pagameba, 16 years ago

Milestone: 1.0.41.0.5

comment:4 by madair, 16 years ago

Resolution: fixed
Status: newclosed

(In [1389]) closes #8: move scale rounding to the Legend ScaleRange object

Note: See TracTickets for help on using tickets.