Hello list,
someone might find my sample implementation useful. I did it for Markus B who wanted to use it to illustrate this: http://de.wikipedia.org/wiki/Volksbegehren_%E2%80%9EF%C3%BCr_echten_Nichtrau...
Basically it is a sample implementation for a special purpose map. It displays different layers according to a special tag in the OSM database.
As the selection criteria changed a lot I made the decision to serve it as a vector layer instead of tiles. My decision was mainly based on the ease of development and easier changes to the "style".
In general I think it is a trade-off between the load caused by having the query on each access versus the rendering and storage of tiles that might be rarely requested and thus always rendered because invalidated in the meantime.
So for a map having a lot of view a bitmap layer might be better.
Some highlights are: - vector layer for POIs - passing of current resolution to back-end - layers disabled for some zoom levels - grouping/clustering of features on the back-end - simple editor to change data
You can find the source-code and a link to the running map here:
http://toolserver.org/~stephankn/index.html
It's GPL, so feel free to base your work upon it.
In case someone has a bit more experience with javascript than I do: I would like to have the read function extended. So instead of completely copy-pasting the code I would prefer to have my extension and then call the "base class implementation". As it is completely different with javascript than with c++ I don't know how to do it yet.
I would like even more if the params would evaluate the given value similar to the "context" that is done in other parts. Then passing a callback function would make passing specific parameters a lot easier.
If there are any questions, don't hesitate to ask.
Stephan