[OpenLayers-Dev] new Strategy.OptionsByZoom
adube at mapgears.com
Mon Jan 19 16:19:38 EST 2009
Tim Schaub wrote:
> Not sure I get it - but I may have missed the back story.
> Looks like you want to display a different layer (featureType) depending
> on the scale.
> The current solutions are to
> 1) use multiple layers on the client with scale constraints, or
> 2) configure your server to use different data sources depending on scale.
> Can you describe what is wrong with either of the solutions above? The
> first one is particularly easy.
About your solutions :
1) Multiple layers --> At first, that's what I did. They were all hidden
from the layerswitcher and I had a dummy layer controlling their
visibility. That was working well, but then I thought on type of data
should always be displayed in only one layer. I mean, I want to have one
road layer to deal with, not 4 and a dummy one. It's simpler that way,
2) Configure your server --> You're right about my server(s), but not
the ones I do not control. I use mapserver, so I could easily GROUP my 4
layers in my mapfile and request the group name instead of changing
typenames, but what about servers I don't control ?
Well, in the end I just thought "hey, this might be better to have only
one OL.Layer than 5" so I wrote it. Do you think it is ?
More information about the Dev