[OpenLayers-Users] Scalability, particularly LayerSwitcher and Permalink

Christopher Schmidt crschmidt at metacarta.com
Wed Mar 28 07:15:49 EDT 2007


On Wed, Mar 28, 2007 at 01:29:43AM -0400, Brian Pitts wrote:
> Hi,
>     I'm working on a project that will have at least dozens of layers. 
> The number of layers will definitely grow over time. Have other users 
> been in this situation? I have questions about how OpenLayers can handle 
> this.
> 
> It seems that only a moderate number of layers would fit in a 
> LayerSwitcher. There doesn't seem to be an facility for searching or 
> sorting layers, grouping them, etc. My thought is to create a new 
> layer-switching widget that would live outside the map's div.

Good. A more complete (and therefore, complex) layer switcher/legend is
definitely a requirement for a number of applications. If we can make it
generalized so that lots of people can use it, it would definitely be
aweome.

> If most of the layers aren't marked visible at any given moment, should 
> I experience performance problems with a large number of layers defined?

You shouldn't. I can't say "You won't", because we did have an anecodtal
report recently that layers when first added to the map were being
loaded even though they weren't visible. However, any problems you do
find should be considered bugs, as this is a target use case we want to
hit.

> The Permalink code seems to assume that the set of layers remains 
> static. If someone generated a permalink today, and I added a new layer 
> tomorrow, they would find the map in a different state when they 
> returned using the permalink. My thought is to modify the Permalink code 
> to include the names of visible layers rather than boolean visibility 
> values.

The problem with this is that names are long. Long names mean long URLs,
which are bad for pastability reasons, as well as for URL length issues:
If you've got two dozen layers, and each has 20 characters in it, you
end up getting into the realm where a URL can't be pasted into IRC, and
possibly you'll eventually run into problems where IE will not load the
entire URL.

Also, many applications which don't have a LayerSwitcher will copy paste
the layer names... so they aren't unique.

This isn't to say that the change isn't neccesary for you: It's possible
it is. (It's also possible that so long as you always add layers to the
end, you could survive without it.) In any case, I'd prefer to see the
permalink not change to *only* support this method of naming: a control
option could switch behaviors.

Looking forward to any feedback,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list