How To Add Search Capablility For A Layer ========================== GeoMoose contains a search service that allows you to search for features by attribute value and display the results for a specific layer. Adding the search cability for a layer in GeoMoose 2 is a multistep proces. Step 1: Create the search results HTML file ------------------------------------------- The searh results HTML file will be used to format how information is displayed in the searcg results tab. The file follows standard HTML formats and references fields that exist for the serch layer. Below is an example of the HTML for parcels in the demo search_result.html file located in maps\demo\parcels\templates:: [PIN]
[OWNER_NAME]

Please note that this HTML can be used to link to other sites or services using standard HTML like tags as illustrated in the example above. Step 2: Reference the HTML file in your MapSeverver map file ----------------------------------------------------------- The search HTML files must then be referenced in the metadata section in your map file within your layer. The following is an example of how this is done from the parcels.map file in the demo located in maps\demo\parcels. METADATA ' itemquery' 'templates/search_result.html' 'itemquery-filter' '/.*[qstring].*/i' 'qstring_validation_pattern' '.' END You must also include references to the itemquery-filter and qstring_validataion_pattern for this to work. Remember when referencing the HTML's to make sure you have the correct relative paths set. Step 3: Create a new search service in Mapbook.xml -------------------------------------------------- The third step will be to create a new search service for your layer in the mapbook.xml. This is most easily done by copying the search service and pasting it in and then modifying it to meet your needs. The following is what the search service looks like for the parcel layer. <-- create a new service name php/query.php <--- source and layer name for your layer <--- fields you want to search on from your layer <--- comparitors for searching <--- value you will enter <--- additional value search Additional information about the search service and adding services in the mapbook can be found in the mapbook reference. Step 4: Add the service to the toolbar -------------------------------------- Now that the service has been added the user must be able to select it as a tool. This is done by adding the new service to the toolbar section of the mapbook.xml file. The following is an example of what the search parcel service:: To add your new service copy this line and paste it below the existing search tool. Change the serivce name to match yours. The following is a simple example that illustrates how this could be done for a new service to search for taxlots::