[Chameleon] Identify information object

Bart van den Eijnden BEN at Syncera-ITSolutions.NL
Wed Jun 1 04:13:35 EDT 2005


Hi Jacob,

it just creates a copy of the layer on which the query is performed, and then changes the colors etc. to a selection color on the fly. Using a FILTER statement it only displays the feature selected by the user.

I have also attached a screendump. The selection is in blue.

Best regards,
Bart

Bart van den Eijnden
Syncera-ITSolutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl

>>> "Jacob Delfos" <jacob.delfos at maunsell.com> 06/01/05 10:00am >>>
Hi Bart,

I had it set up at first with a manually specified mapfile, but in our setup that was a bit of a security issue. Also, I wanted it to be more flexible to implement in general.

How did you actually create a dynamic highlight layer? Does your approach create a lot of overhead if 10,000s of records are searched, or if 100s of results are returned?

Have a look at http://geo.maunsell.com/chameleondemo/index.phtml , so you know roughly what it does. It's a very ugly demo, but sort of works. Ideally, after a query, all  objects would be highlighted until a new query is done. Could I just save a copy of every result to a shapefile, and load that as a dynamic layer?

regards,

Jacob


-----Original Message-----
From: Bart van den Eijnden [mailto:BEN at Syncera-ITSolutions.NL] 
Sent: 1 June 2005 15:42
To: chameleon at lists.maptools.org; jacob.delfos at maunsell.com 
Subject: Re: [Chameleon] Identify information object

Hi Jacob,

I have followed a slightly different approach to do this:

1) I created a generic WFSSearch widget which provides a dialog for the user in an iframe to search on one or more attributes. The widget communicates with Mapserver WFS to search, but it actually uses the same MAP file as the Chameleon app (configured for WFS ofcourse). Eg:

<cwc2 type="WFSSearch" styleresource="NavButtons"  popupstyleresource="TextButtons" PopupWidth="460" PopupHeight="550" Toolbar="false" Status="false" Menubar="false" Image="icons/icon_search.png" ImageTip="Zoek adres" onlineresource="http://localhost:8080/cgi-bin/mapserv.exe?map=/ms4w/apps/westland/map/stragisweb.map" title="Zoek adres" typename="ACN" namespace_prefix="stragisweb" targetframe="DynamicFrame" filteritem="ACN" zoomwidth="50">
        <searchField propertyname="STRAAT_NEN" label="Straat" />
        <searchField propertyname="PLAATS_NEN" label="Woonplaats" />
        <image state="normal"/>
        <image state="selected"/>
        <image state="hover"/>
      </cwc2>

2) I extended the JSAPI in order to being able to highlight items based on a FILTERITEM and FILTER. In my aproach it only highlights 1 item  (by adding a dynamic highlight layer) and zooms to it, but it could be extended to highlight more items since it uses Mapserver's FILTER.

Best regards,
Bart

Bart van den Eijnden
Syncera-ITSolutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl 

>>> "Jacob Delfos" <jacob.delfos at maunsell.com> 06/01/05 06:12am >>>
Paul,

Is there a way to manually add objects to a query result?
My widget searches by attribute, but I am not using the query mechanism. Reason is I want more control over what is queryable or not, and what is returned (also because we use customisations with different levels of information depending on who is logged in), so I don't want to depend on the "template" mechanism. Also, I don't want to be limited to a current map-extent (even though I guess I could get around that). 

Could I use the "layerObj" class, and use "addfeature" for each shape in the iteration? Sorry for my ignorance, just that I haven't worked with dynamic layers before.... I need need to find a simple way to highlight shape objects on the fly.

regards,

Jacob




-----Original Message-----
From: chameleon-bounces at lists.maptools.org [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of Paul Spencer
Sent: 31 May 2005 22:34
To: Jonathon Coombes; 'chameleon at lists.maptools.org' 
Subject: Re: [Chameleon] Identify information object

Jonathon,



Jonathon Coombes wrote:
> On Mon, 2005-05-30 at 22:27 -0400, Paul Spencer wrote:
> 
>>You can use the following attributes on CWC2 type="Query" to add this 
>>functionality
>>
>>highlightresults="true"
> 
> 
> Hi Paul,
> 
> Thanks for the quick reply. The above details make sense.
> 
> 
>>if you want the result to stay highlighted until cleared (you need a 
>>ClearQueryResults widget in this case) set:
>>
>>persistentresults="true"
>>
>>otherwise, the highlight will disappear on the next map draw
> 
> 
> Again, this makes sense.
> 
> However, I have one slight problem. How would I use the functionality
> of a Query widget, in a customised widget like the LocateByAttribute
> that was mentioned a week ago? Do I have to go to a mapserver level
> for something like this? Do I create a subclass of the main class
> and inherit from Query? 
> 
> What would be the recommended approach for this?

I think this would be a new widget.  The query widget is a 
point-and-click widget whereas I think you are describing a widget that 
the user would enter some text and pick an attribute to search, and the 
code would highlight the result(s)

I would do this by creating a new widget (or using something posted on 
this list) not based on Query at all (since no direct map interaction is 
required).  It would take the user input and perform a queryByAttribute 
then save the query results using saveQuery ... the query results should 
be saved in the same location that drawmap.php would look for them.

To do this will be considerable effort for someone new to Chameleon, 
unfortunately.

Cheers

Paul

> 
> Regards
> Jonathon
> 
> 
>>Jonathon Coombes wrote:
>>
>>>Hi,
>>>
>>>In the mapscript demos in the past, when you clicked on a feature
>>>within your map, it highlighted it red. Is this possible within
>>>Chameleon widgets? That is, when I select a feature or click within
>>>an object of a certain layer, it will be altered or enhanced in some
>>>way?
>>>
>>>Regards
>>>Jonathon
>>

-- 
+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/| 
+-----------------------------------------------------------------+
_______________________________________________
Chameleon mailing list
Chameleon at lists.maptools.org 
http://lists.maptools.org/mailman/listinfo/chameleon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chameleon.png
Type: image/png
Size: 25074 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/chameleon/attachments/20050601/9db6b544/chameleon-0001.png


More information about the Chameleon mailing list