Ticket #2464 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

getResolutionFromScale should return undefined resolution for falsey scale

Reported by: tschaub Owned by:
Priority: minor Milestone: 2.9 Release
Component: Util Version: 2.8
Keywords: Cc:
State: Commit

Description

Currently, OpenLayers.Util.getResolutionFromScale returns Infinity if scale is null or undefined. This causes trouble for code that checks if the returned resolution is truthy.

Attachments

2464.patch Download (2.0 KB) - added by tschaub 3 years ago.
better return for invalid scale

Change History

Changed 3 years ago by tschaub

better return for invalid scale

Changed 3 years ago by tschaub

  • state set to Review

See  Map.js for an example of code that makes assumptions about a truthy resolution derived from OpenLayers.Util.getResolutionFromScale.

Tests pass. Thanks for review.

Changed 3 years ago by ahocevar

  • state changed from Review to Commit

Looks good. Please commit.

Changed 3 years ago by tschaub

  • status changed from new to closed
  • resolution set to fixed

Fixed w/ r10019. Thanks for the review.

Note: See TracTickets for help on using tickets.