mapscript-query results in different colors for different layers

Daniel FAIVRE daniel.faivre at CAMPTOCAMP.COM
Mon Aug 23 12:33:05 PDT 2004


You can change the color of selected features by using for your layer a
class with an expression which is always false in your mapfile, and
using the script to set its to true for selected features.

Aniway, it's not possible to show your buffer, because you never really
compute the buffer as a new layer, which could be shown. Even if you
could change the querymap color or do something like that, you will not
see a buffer, just selected features in the first layer.
Furthermore, this would be slow to process.

I developped such an application for mapserver by other means: I've used
PostGis. PostGis can compute buffers, merge its, and furnish a result
that could be displayed in mapserver, and reused for "select-by-theme"
queries ;-)

Daniel FAIVRE, camptocamp.com

Monica Socol wrote:

> Hi everyone,
>
> I am trying to construct a buffer… As mapserver does not offer a
> “classic” way of doing it, I have implemented the following steps:
>
> - the user makes a selection first from a layer
>
> - then enters the buffer distance and the target layer
>
> - I take the extents of the selected features, and for each of them
> calculate new extents by adding the buffer and make a new selection on
> the target layer
>
> - finally, I display both the initial selection + the selection from
> the target layer.
>
> It works, but in order to show the buffer, I would like to display the
> selection in yellow, as defined into the QUERYMAP layer into the map
> file, and the buffer in orange or any other color.
>
> The problem is I didn’t find any way to change the color for QUERYMAP
> on-the-fly using mapscript.
>
> Is there any way of doing that?
>
> Thank you very much for any ideas!
>
> Monica
>



More information about the MapServer-users mailing list