Agree it should ask for 0,0 four times. Fixed in newer algorithm. :D


On Sun, Aug 4, 2013 at 11:23 PM, Joshua Bell <notifications@github.com>wrote:

> In map.js:
>
> > -        dh = this.tilesize * tmult;
> > -
> > -        this.drawTile(x, y, tscale,
> > -                      (cw / 2) + dx, (ch / 2) + dy, dw, dh,
> > -                      z, this._rd_cb);
> > -      }
> > +      // Spiral outwards so requests for central
> > +      // images are serviced first
> > +    cx = l + (r - l) / 2; // find the center tile location x and y
> > +    cy = t + (b - t) / 2;
> > +
> > +      // work out and down from the center for the base quadrant
> > +    for (y = 0; y <= (b - t) / 2; y += 1) {  // build up tile offsets from the center y and then x
> > +        for (x = 0; x <= (r - l) / 2; x += 1) {
> > +            // to spiral around the center, produce a quadrant offset coefficient to be applied to the base quadrant numbers
> > +            for (quadrant = 1; quadrant <= 4; quadrant += 1) { // 1 is lower right, 2 upper right, counter-clockwise
>
> Does this end up requesting the tile at x=0, y=0 4 times?
>
> The Network tab in Chrome's DevTools can show you exactly how many network
> requests were made. You could also add debugging output into drawTile and
> compare before/after the patch.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/inexorabletash/travellermap/pull/3/files#r5572060>
> .
>