[OSM-talk] Informationfreeway defaults to sea if tile unloadable, e.g. due to proxy being unreachable

80n 80n80n at gmail.com
Fri Aug 17 10:36:14 BST 2007


On 8/17/07, Tom Hughes <tom at compton.nu> wrote:
>
> In message <8fcd02310708170216o4957d339xe943fba850c759c6 at mail.gmail.com>
>         80n80n at gmail.com wrote:
>
> > I don't know why, but OpenLayers tries to request tiles with addresses
> like
> > y=-1 if you pan outside the normal boundaries of the planet.  If we
> could
> > fix that then it would be possible to serve up a proper 404 tile when
> there
> > really is a 404.
>
> Because that is what your get URL function is returning - we hacked
> the one on the main slippy map to avoid doing so. It only happens when
> you have OpenLayer's normal bounds limitation turned off to allow
> wrapping at low zooms.
>
> The main slippy map now uses this:
>
> function getTileURL(bounds) {
>    var res = this.map.getResolution();
>    var x = Math.round((bounds.left - this.maxExtent.left) / (res *
> this.tileSize.w));
>    var y = Math.round((this.maxExtent.top - bounds.top) / (res *
> this.tileSize.h));
>    var z = this.map.getZoom();
>    var limit = Math.pow(2, z);
>
>    if (y < 0 || y >= limit)
>    {
>      return OpenLayers.Util.getImagesLocation() + "404.png";
>    }
>    else
>    {
>      x = ((x % limit) + limit) % limit;
>
>      return this.url + z + "/" + x + "/" + y + "." + this.type;
>    }
> }



That makes sense.  Cheers.


Tom
>
> --
> Tom Hughes (tom at compton.nu)
> http://www.compton.nu/
>
> _______________________________________________
> talk mailing list
> talk at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20070817/e803ef14/attachment.html>


More information about the talk mailing list