Ticket #910 (closed task: fixed)

Opened 6 years ago

Last modified 6 years ago

Extraneous moveTo() Overridden in Image Tile

Reported by: euzuro Owned by: euzuro
Priority: minor Milestone: 2.5 Release
Component: Tile.Image Version: 2.4
Keywords: Cc:
State:

Description

The moveTo() function is overridden in Tile/Image.js, but on close inspection, this is not necessary.

Why is it overridden? so that it can reproject the bounds of the tile and recalculate the tile's 'url' property.

Which makes sense (as the tile has moved, has new bounds, and will need to load from a new URL)... but on closer inspection, the draw() function on the image tile *always* does the reprojection and the recalculation of the URL before actually requesting the image.

No need to do it twice!

Attachments

moveTo.patch Download (4.1 KB) - added by euzuro 6 years ago.

Change History

Changed 6 years ago by euzuro

Changed 6 years ago by euzuro

  • keywords review added

so when you remove the overridden moveTo() function, it breaks the mergeNewParams() tests for the kamap, mapserver, wms layers.

those tests, it turns out, are testing for the *unnecessarily* re-written url property (because redraw() is called on the layer after the new params are merged, and redraw ends up callng the moveTo() function on the tiles).

So we remove the test for the 'url' property on the tiles.

But everyone knows it would look ugly if we submitted a patch merely removing the tests that we had broken. So! we add a new (better) test, which overrides the redraw() method itself, simply registering a t.ok() that it has passed. What we really want to test is if the layer redraws, not if the tile's have a 'url' property... since when draw() is called on the tiles, they will have one.

all tests pass FF and ie6

please review

Changed 6 years ago by tschaub

  • keywords commit added; review removed

how bonito

please commit!

Changed 6 years ago by euzuro

  • keywords commit removed
  • status changed from new to closed
  • resolution set to fixed

thanks for speedy (gonzales?) review, tim. in with r3928

Note: See TracTickets for help on using tickets.