[Openstreetmap-dev] Workings of maps.civicactions.net

Tom Carden tom at tom-carden.co.uk
Mon Jul 18 20:30:04 BST 2005


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.





More information about the dev mailing list