[mapguide-users] Re: Advanced search of layer using MgFeatureQueryOptions() not working

Steve G steve.golden at morganhill.ca.gov
Wed Jun 1 17:27:28 EDT 2011


I was able to modify search.php to allow for sorting of a specific field, but
because I have multiple searches based on the built-in search tool and some
have different fields to sort on, modifying the search.php doesn't apply
universally to all my searches.  I've thought about the two methods to
resolve this:

1. Is there some additional script I can use that would swap out the sorting
field based on my search criteria or layer searched (if/else with different
sort fields)? (I am a really novice php programmer so I would try to figure
this out if I had the skills)

2. Optionally I tried creating an invoke script in my web layout with the
following:

params = new Array("LOCALE",
"en","CMDINDEX","31","TGT","1","POPUP","0","WIDTH","200","LAYER","MH_Parcels","MAPNAME",parent.mapFrame.GetMapName(),"SESSION",parent.mapFrame.GetSessionId(),"FILTER","ADDRESS
LIKE '%$USER_VARIABLE%'","MR","100",
"COLS","1","CN","ADDRESS","CP","ADDRESS"); pageUrl
="../mapviewerphp/searchprompt.php";parent.formFrame.Submit(pageUrl,params,"taskPaneFrame");

figuring that I can change the reference in searchprompt.php to a custom
search.php (with a unique set ordering) and then have a unique invoke script
for each search (changing searchprompt.php to searchprompt1.php and that
referencing search1.php, searchprompt2.php referencing search2.php, and so
on).  

The invoke script sort of works, but the results show all fields in the
layer, not just the field(s) restricted by COLS=1.  The url property of the
results in the taskpane is:

http://xx.x.x.xxx/mapguide/mapviewerajax/search.php?USERINPUT=mont&CMDINDEX=31&TGT=1&POPUP=0&LAYER=MH_Parcels&MAPNAME=MHMAP_TEST&SESSION=8a8fcada-8c77-11e0-8000-0023ae9c95a3_en_7F0000010AFC0AFB0AFA&FILTER=ADDRESS+LIKE+%27%25%24USER_VARIABLE%25%27&MR=100

so I know that the variable COLS is not getting passed correctly.

If anyone can provide some assistance, I would appreciate it or if there is
a better way of doing this, suggestions are welcomed.  I am a really novice
php programmer, so please bare with me...

-Steve

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Advanced-search-of-layer-using-MgFeatureQueryOptions-not-working-tp4978840p6428942.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list