Ticket #1457 (closed bug: invalid)

Opened 5 years ago

Last modified 5 years ago

No image is displayed when switching base layer

Reported by: openlayers Owned by: crschmidt
Priority: minor Milestone: 2.6 Release
Component: Layer.FixedZoomLevels Version: SVN
Keywords: Cc: abejenaru@…
State: Complete

Description

Check the Spherical Mercator example and try chosing a different base layer. Although the image tiles seem to be loading, they are not displayed.

SVN: 6569

Attachments

fixed.patch Download (0.6 KB) - added by crschmidt 5 years ago.
1457.patch Download (1.9 KB) - added by crschmidt 5 years ago.
1457.2.patch Download (1.9 KB) - added by crschmidt 5 years ago.

Change History

Changed 5 years ago by bartvde

This is because the Google Layer does not have a minResolution and maxResolution, they are both null, so the calculateInRange won't work.

Changed 5 years ago by crschmidt

Is this new? I don't remember anything changing here recently... Perhaps this is the result of my recent display() changes, I suppose?

Changed 5 years ago by crschmidt

  • owner set to crschmidt
  • status changed from new to assigned

I've confirmed this is due to my recent layer changes. I think that the fact that the fixedzoomlevels subclasses don't have a min/max resolution set (and therefore no valid calculateInRange()) is a bug we should fix, rather than reverting my fix and changing it some other way.

I'll own this one, and fix it soon.

Changed 5 years ago by crschmidt

Changed 5 years ago by crschmidt

Patch attached. Seems to fix the problem for me. Anyone else want to try it anad confirm that it works for their application?

Changed 5 years ago by crschmidt

  • milestone set to 2.6 Release

Serious regression. Moving to 2.6.

Changed 5 years ago by crschmidt

Changed 5 years ago by crschmidt

  • state set to Review

1457.patch adds a test. This test:

  • Succeeds before change to Layer.js
  • Fails on trunk
  • Succeeds with patch.

This is a test of functionality, rather than a unit test: This is okay with me, but I can write more tests for calculateInRange if people care.

WIth test, marking for Review.

Changed 5 years ago by crschmidt

Changed 5 years ago by crschmidt

Move the change inside the 'if' loop: if this.RESOLUTIONS == null, then we would have gotten an error. So, fix that.

Changed 5 years ago by tschaub

  • state changed from Review to Commit
  • component changed from general to Layer.FixedZoomLevels

looks good

Changed 5 years ago by crschmidt

  • status changed from assigned to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [6572]) FixedZoomLevels subclassese don't propertly set min/max resolution, so calculateInRange always returns false, so the layers can never be displayed (due to recent code): Fix calculateInRange by setting min/max res. r=tschaub, (Closes #1457)

Changed 5 years ago by openlayers

  • status changed from closed to reopened
  • resolution fixed deleted

Still not OK.

Check the VE example: the base layer sets "minZoomLevel: 4, maxZoomLevel: 6", but instead of displaying a 3 unit zoom scale, it shows a 14 units bar (from minZoomLevel 4 to MAX_ZOOM_LEVEL 17).

Actually, I think that the MAX_ZOOM_LEVEL should be 16 for VirtualEarth, as there are only 16 entries in the RESOLUTIONS array; furthermore, after FixedZoomLevels::initResolutions() minResolution is undefined, as being RESOLUTIONS[17].

Changed 5 years ago by crschmidt

  • status changed from reopened to closed
  • resolution set to invalid

This is a totally different issue, unrelated to this ticket.

It has also been the case since 2.2:  http://dev.openlayers.org/releases/OpenLayers-2.2/examples/ve.html

Please create a new ticket for that issue.

Note: See TracTickets for help on using tickets.