[Chameleon] Querying dynamic built layers
Eric Bridger
eric at gomoos.org
Wed Mar 16 14:14:37 EST 2005
There is a work around that I have used for this type of thing using
mapscript (Perl). I call $point->draw() and then create a single point
line shape from that point (setting the $shape->index to my numeric key
value and call $layer-addFeature($shape). This adds the point as a
feature to the layer and it is queryable and should return the index you
used. There is a Perl example of this here:
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?PerlMapScriptExamples42ex1
BUT there is a problem with this approach when using Chameleon. In
Chameleon the map object is cached in your session and I've found that
all features added to the map are retained between map draws.
You might be able to get around this by calling $map->removeLayer() but
I have not tested this.
On Wed, 2005-03-16 at 13:05, Ken Sanderson wrote:
> Hello all.
>
> I have setup a script that queries a database and retrieves a bunch of
> points. I then create a layer object that I added to the map object for
> these points. Each of these points shows up on the map, each has a
> label, and I have used the new change to the index property to add an
> index value for each point, sequentially. All works, no errors.
>
> I 'thought' that I could just add the template value and then this layer
> would be queryable using the query tool. Obviously it will not return
> any data other than the shape_index and other inherient values, but for
> now thats all I wanted to check.
>
> However this is not the case. The query returns the layer in the list of
> layers that didnt return results, but never returns any values.
>
> Any ideas why this is?
>
More information about the Chameleon
mailing list