[Geomoose-users] Geomoose

Brent Fraser bfraser at geoanalytic.com
Tue Jul 28 12:50:41 PDT 2015


Janet,
   Here's a snippet from the doc I've been working on.  maybe it will help.


    Adding Search

If you want to be able search a data source on attribute values, you 
will need to:

 1.

    Add input tags to a search service in the mapbook

 2.

    Add METADATA objects for the LAYER in the Mapserver .map file

 3.

    Create a Mapserver template file to display the results


 1.

    Add input tags to mapbook

The easiest way is just to edit the demo mapbook search_parcels service:


<service name="search_parcels" title="Search" clear-highlight="true">

<url>php/query.php</url>

<step type="input">

<input type="hidden" name="layer0"     value="my_source/my_layer"/>

<input type="hidden" name="template0"  value="itemquery"/>


<input type="select" name="fieldname0" title="Search By:">

<option value="ID">Parcel ID</option>

<option value="STATUS">Status</option>

</input>

<input type="hidden" name="comparitor0" value="eq-str"/>

<input type="user"   name="value0" title=""/>

</step>

      </service>


Note the “0” at the end of the name values; it groups them together for 
processing.  The option value tags are the column name in your shapefile.


 2.

    Add METADATA objects

In the map file for the map-source, add objects to the LAYER’s METADATA 
object to indicate the name of the template to use for displaying the 
output of the search. You will create the

METADATA

'itemquery' 'templates/search_result.html'

'itemquery-filter' '/.*[qstring].*/i'

END # of METADATA

The entry in the itemquery object is a path relative to the location of 
the Mapserver .map file.


 3.

    Create A Mapserver Template

The templates can be simple or complicated depending on what you want to 
do with the search results.  Here’s an example of one that will zoom to 
the parcel when the link is clicked:


<!-- MapServer Template -->

<b>Parcel ID:</b> <a data-pin="[ID]" id="gm-parcel-[ID]" 
class='sprite-control sprite-control-find-selected' style="padding-left: 
22px" parcel-shape="[shpxy precision=5]" 
href="javascript:GeoMOOSE.zoomToPointsList(dojo.byId('gm-parcel-[ID]').getAttribute('parcel-shape'), 
'EPSG:4326');">[ID]</a><br/>

<b>Status:</b> [STATUS]<br/>

<hr/>


Note the “EPSG:4326:” is used because my data is in a Geographic 
coordinate system.  If your data is projected, use the same EPSG 
definition you used in your Mapserver .map file.




Best Regards,
Brent Fraser

On 7/22/2015 12:56 PM, Janet Maina wrote:
> Hey, I have tried to work with geomoose and I was able to load my 
> shapefile.
> My search is not working and have tried all the possible ways.
> please explain all the files i need to change.
>
> (Assume I have a field called LRNO )
>
> Regards Janet
>
>
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geomoose-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20150728/02b7c18a/attachment-0001.html>


More information about the Geomoose-users mailing list