The Home of GeoMOOSE!

Wiki | Tickets | Live Demos | Download

Table Of Contents

Previous topic

How To Add Text to a Tool

Next topic

How To Create a Custom Printing Template

This Page

How To Call a Service at Startup

GeoMOOSE is centered around its services. Services are defined in the mapbook by the <service> tag and they define how GeoMOOSE should communicate with external scripts. There are a number of scenarios in which it is neccessary to call a service on startup. The primary example of this functionality is the ability to zoom to and highlight a feature upon opening the interface.

Given the item query service provided with the demo:

<service name="search_parcels">
        <!-- The URL of the service to call -->

        <!-- most service have one or two "steps" this one is a non-spatial input -->
        <step type="input">

                <!-- the field to search against -->
                <input type="select" name="qitem" title="Search By:">
                        <option value="OWNER_NAME">Owner</option>
                        <option value="PID">Parcel ID</option>

                <!-- this is the actual search string -->
                <input type="user" name="qstring" title=""/>

                <!-- these are the rest of the settings for the service -->
                <input type="hidden" name="layer" value="parcels/all"/>
                <input type="hidden" name="zoom_to_first" value="false"/>
                <input type="hidden" name="highlight" value="true"/>

Using this service there are two important things to note:

  1. The name of the service, “search_parcels”
  2. The inputs of type “user”, these are the inputs that would require the user to enter text. We need to bypass that with parameters for the URL. In this example, the only “user” input is “qstring”.

Calling the URL

To call the service, the url must specify the “call” parameter and the appropriate user-inputs:

  • The “call” parameter specifies the name of the service to call
  • The “qstring” parameter is the same name of the input of type “user” and its value is set to “Johnson”