[OpenLayers-Users] Re: Search functionality in
Openlayers/Geoserver
Phil Scadden
p.scadden at gns.cri.nz
Sun Jun 19 17:40:51 EDT 2011
> Step 1: User has to check only one layer(the layer in which he want to
> search) in layerswitcher before searching . But how to get which layer has
> been selected??
IMHO, layerswitcher is too primitive for this. I use a combo box (eg
http://kite.gns.cri.nz/PBE/#MAP:OPAConfig.json) to select the searchable
layer and then user can try point, polygon or text searching. Its
unlikely that all of your layers are seachable.
> Step 2: After knowing the selected layer , Using php search that
> corresponding table for the search string in names column , if it is present
> get the latitude and longitude values. But how to get these values and what
> if they are polygons/lines???
Do you search by what ever means works and then use WFS query to fetch
GML of the found features. Depending on your database, you can just use
WFS to make the query. In the response function from the WFS query, the
"features" object will have the geometry to work on.
Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.
More information about the Users
mailing list