[ka-Map-users] Customizing search system

Alessio Di Lorenzo alessio.dilorenzo at gmail.com
Thu Mar 20 09:11:32 EDT 2008


After a period of working on other things, I started again to work on a
search filter in ka-map.
My objective is to queryByAttributes only a specifical postgis table (or
selected by the user through an appropriate interface, instead the entire

So, I modified the kaSearch.php by substituting the following For cicle:

for ($i = 0; $i < $tot; $i++) {
	$oLayer = $oMap->getLayer($i);

with the following code:

$layer = $_REQUEST['searchlayer'];

$oLayer = $oMap->getLayerByName($layer);

where 'searchlayer' represents the "name" parameter in a dropdown list that
I inserted
in the search form in my index.html:

<form name="search"

	<select name="searchlayer">
		<option value="nome_tabella_1">Alias1</option>
		<option value="nome_tabella_2">Alias2</option>
		<option value="nome_tabella_3">Alias3</option>

<input type="text"...>
<button type="button"

I suppose that the mapscript code hack is correct.
Infact, if I type manually the table name as an argument of the
getLayerByName() method
it works. Otherwise, when I use the $layer variable as an argument of the
same method, it doesn't work.


$oLayer = $oMap -> getLayerByName('my_table_name')  --> works fine 

$oLayer = $oMap -> getLayerByName($layer)  --> doesn't work

The problem is that the value that I want to send from the <select
is not sent to the kaSearch.php file.

I suppose I need to modify the onClick in the html and/or the kaSearch.js in
some way, 
but I'm not an expert in ajax/javascript, so I need some help in this issue.

Thx all in advance


View this message in context: http://www.nabble.com/Customizing-search-system-tp14935121p16177886.html
Sent from the ka-map-users mailing list archive at Nabble.com.

More information about the ka-Map-users mailing list