[Chameleon] Querying dynamic built layers

Eric Bridger eric at gomoos.org
Wed Mar 16 14:55:32 EST 2005


Are you calling $layer->addFeature() as well?


On Wed, 2005-03-16 at 14:40, Ken Sanderson wrote:
> Thanks Eric for the reply.
> 
> I am not sure I understand the issue with chameleon. I added the layer 
> to the session map object so that it would remain between map draws, 
> basically for the life of the session. How would this conflict with the 
> query attempt?
> 
> Basically I have done the equiv of the perl script you have linked, only 
> I did it with PHP mapscript, now possible thanks to them making index a 
> write-able property for php mapscript.
> 
> So I have a layer loaded to the map, I have points being displayed, with 
>   appropriate labels, I just cant use the query widget on that layer, or 
> rather it always returns 0 records.
> 
> Ken
> 
> Eric Bridger wrote:
> > 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?
> >>
> > 
> > 
> > _______________________________________________
> > Chameleon mailing list
> > Chameleon at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/chameleon
> > 
> 




More information about the Chameleon mailing list