Exercise 4: Customizing the “Zoom To” List

In this exercise we will customize the “zoom to” list. Like most GeoMOOSE configuration, this is set in the mapbook. The mapbook in a XML file (a form of structured text file) that defines various configuration parameters, what map layers are available, how to connect to map data, and what tools are available. More information about the configuration options available in the mapbook is available in the GeoMOOSE documentation. By default, the mapbook is the mapbook.xml file in the conf folder under where ever you installed GeoMOOSE.

  1. Changing the Jump To list:

    Open mapbook.xml in nano:

    nano /srv/geomoose/conf/mapbook.xml
    

    Find the this section:

    <param name="zoomto"><![CDATA[
    {
            "Jump To:" : {
                    "World" : [-20614760.777156,1751325.1919492,-1927436.1053437,7915207.1517617],
                    "Parcel Data" : [-10384069.859924,5538318.529767,-10356632.423788,5563580.927174],
                    "Full State of MN" : [-10742765,5398288,-9920914,6310641]
            }
    }
    ]]></param>
    

    The list here is a Javascript object. This is how the “Jump to” list is defined. We are going to add “New York City” to the top of the list. On the line before "World" ...":

    "New York City" : [-8242894,4965204,-8227290,4994963],
    

    The “,” at the end of the line is very important do not forget it! When you are done the list should look like this:

    <param name="zoomto"><![CDATA[
    {
            "Jump To:" : {
                    "New York City" : [-8242894,4965204,-8227290,4994963],
                    "World" : [-20614760.777156,1751325.1919492,-1927436.1053437,7915207.1517617],
                    "Parcel Data" : [-10384069.859924,5538318.529767,-10356632.423788,5563580.927174],
                    "Full State of MN" : [-10742765,5398288,-9920914,6310641]
            }
    }
    ]]></param>
    
  2. Wrap up: Look at the other parameters available in the <configuration/> section of the mapbook.

  3. Test it: Reload the geomoose page.

../../_images/ex4-finished.png