[OSM-talk] layers and rendering

Thomas Wood grand.edgemaster at gmail.com
Wed Nov 19 23:55:47 GMT 2008


2008/11/19 David Earl <david at frankieandshadow.com>:
> On 19/11/2008 23:09, Dave Stubbs wrote:
>> The problem is that you either serve the information to the browser,
>> which then slows down hugely, or else you have to render bitmaps for
>> every different layer, and either way you probably require way more
>> server resources.
>>
>> The reason we do it the way it's currently done is that the process
>> scales very well for many people looking at the map (we just keeping
>> sending out the same prerendered image tiles). When everybody is
>> trying to look at a different map, we need about a 1000 times as many
>> servers, which doesn't work so well.
>
> There is a hybrid solution to this which I am sure would work. I've
> mentioned it before on this list. Unfortunately it needs changes to
> OpenLayers to support it (though those changes would be beneficial in
> general as well, I think).
>
> Basically: pre-render highways, areas etc as at present. But pre-render
> POI icons and captions as absolutely positioned HTML elements (text and
> small img's) within tile size clip areas, and overlay the PNG tiles with
> these HTML tiles - which the browser completes the rasterization of. The
> HTML "tiles" can be stored, delivered and overlaid in pretty much the
> same way as other tiles. The missing bit is that openlayers doesn't know
> how to handle them, but it can't be that different positioning divs
> rather than imgs. Since the tiles are pretty simple text, they'll be
> pretty small and the image icons they refer to will be constant and cached.

Or, even better, make GeoJSON 'tiles', pass these out to openlayers,
and let it render the icons using the already existing codebase.
It already knows how to handle them, the tiles would be even smaller in size.

> Then it becomes possible simply by Javascript DOM assignments like
> for (i in pubs) { pubs[i].style.display = "none"; }
> (where pubs is determined from all elements with pub class) to turn them
> on and off. Or you could poke the style itself from javascript to do all
> pubs at once go - once you have an HTML tile, there's lots of different
> ways of approaching the dynamic display part of the problem.

I guess this is the real winner for your method, simple manipulation
of the POI types.

> David

The lenz POI viewer does a similar thing with a html layer, but
doesn't integrate with OL at all (and completely ignores the fact it
exists, right down to getting the current view bbox). The main problem
with it is the high latency it seems to suffer from due to the
on-the-fly data requests.

On this subject, I may test out some POI stuff I've been working on
for another project. I wonder how well it scales up to country-sized
datasets...

-- 
Regards,
Thomas Wood
(Edgemaster)




More information about the talk mailing list