Workings of maps.civicactions.net

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Workings of maps.civicactions.net

Nick Whitelegg-2
Tom, (or anyone else...)

Been looking quickly at the maps.civicactions.net source code but am a bit
puzzled as to how it's working, and in particular, how the server sends
back new map tiles as you pan round the world.

All the server seems to send back to the client when you pan round, as a
response to the XmlHttpRequest, is a stream of data describing latitude,
longitude etc.  This then seems to be to draw a different section of tile
on the div. Nowhere does the server actually appear to send back *new* PNG
tiles when you pan away from the current area.

Am I correct therefore that *all* tiles are downloaded to the client when
the application starts i.e. there's no continual retrieval of PNG images
from the server as the user pans round the world? My interpretation of the
source would suggest so. For a higher resolution map such as OpenStreetMap
or Freemap I can't see how that would be feasible.


Thanks,
Nick



_______________________________________________
Openstreetmap-dev mailing list
[hidden email]
http://bat.vr.ucl.ac.uk/cgi-bin/mailman/listinfo/openstreetmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: Workings of maps.civicactions.net

Tom Carden
Nick Whitelegg wrote:
> Tom, (or anyone else...)
>
> Been looking quickly at the maps.civicactions.net source code but am a bit
> puzzled as to how it's working, and in particular, how the server sends
> back new map tiles as you pan round the world.
>

Strictly speaking the server doesn't send them.  The client knows which
ones to ask for.

> All the server seems to send back to the client when you pan round, as a
> response to the XmlHttpRequest, is a stream of data describing latitude,
> longitude etc.  This then seems to be to draw a different section of tile
> on the div. Nowhere does the server actually appear to send back *new* PNG
> tiles when you pan away from the current area.
>

The new tiles don't get set using XmlHttpRequest.  The relevant line is,
I think 397, where the src gets changed on the images:

img.src = key;

Where key is just the image URL.  It's in the drag handler.

> Am I correct therefore that *all* tiles are downloaded to the client when
> the application starts i.e. there's no continual retrieval of PNG images
> from the server as the user pans round the world? My interpretation of the
> source would suggest so. For a higher resolution map such as OpenStreetMap
> or Freemap I can't see how that would be feasible.
>

You're right.  That wouldn't be feasible.  I don't think that's how this
implementation works (but I could be wrong).

Tom.


_______________________________________________
Openstreetmap-dev mailing list
[hidden email]
http://bat.vr.ucl.ac.uk/cgi-bin/mailman/listinfo/openstreetmap-dev