HOW TO SETUP MOOSE DEMO APPLICATION GUIDE

 

TABLE OF CONTENTS

1.      INTRODUCTION

1.1              MOOSE COMPONENTS

2.      INSTALLATION AND SETUP

2.1  SOURCE CODE AND DATA

2.2  DIRECTORY STRUCTURE

3    SOFTWARE REQUIREMENTS

3.1WEB SERVER

3.1.1 IIS

3.2 MAP SERVER

4    SOURCE CODE MODIFICATIONS

4.1 JAVASCRIPT CONFIGURATION LIBRARY

4.2 XML MAPBOOK DEMO FILE

4.3 MAP FILES

5    TESTING

5.1 DEBUGGING

 

 


 

1.    INTRODUCTION

Moose is the City of Saint Paul - Public Works Department's web-based mapping interface. Moose is a client-side software that uses a variety of JavaScript, XML, and DHTML technologies to interface with other web-clients. The primary target of Moose, is for integration with the University of Minnesota's MapServer, but it is not dependent on it for operation.  MOOSE was recently released as an Open Source project by the City of St. Paul, MN.

 

1.1          Moose Components

The Moose interface is configured by two primary components in the source code which are the Mapbook and JavaScript Config library.  The mapbook is an XML file that contains the listing of available Maps (Layers), Views (Pre-defined "Zoom To"s), and Services (external programs). The MapBook XML Format has four Children Types.  Please refer to the Mapbook reference guide for a description of configuration options.  The Config JavaScript library is used to set global variables used by other JavaScript libraries.

 

There is a third component to MOOSE which is the map engine configuration.  In the case of this how to document we are assuming you are using MapServer.  MapServer has it’s own configuration files that are required to control the map layers.  We assume you are familiar with MapServer and know how to setup a MapServer application.  More information on setting up MapServer can be found at http://mapserver.gis.umn.edu/new_users.

2.    INSTALLATION AND SETUP

The installation and setup requires the download of source code and data for the Moose demo application guide. Additionally, users are required to setup the directory structure on the local hard drive to store the downloaded source code and map files.

 

2.1    Source Code Download

The source code consists of the HTML, XML, CSS and JavaScript required by the MOOSE interface.  As part of the download users also get GIS data and MapServer mapfiles to use for a demo application. Users should download these as shown in the steps:

 

·         Open an internet browser with the url: http://geomoose.sourceforge.net/index.html

Click the ‘Download’ link. Next, click on the ‘SourceForge Download Page’ link.

·         A sourceforge.net browser will appear providing an entry level link - green box. Click on this ‘green box’ and select the ‘moose-0.6.tar.gz’ link from the new window.

·         A new webpage will appear, select the Seattle Washington mirror by clicking the ‘download’ link. The download should begin shortly, if not, click the url displayed, or as shown:

http://superb-west.dl.sourceforge.nnet/sourceforge/geomoose/moose-0.6.tar.gz

·         Select the ‘Save’ button and browse to the desired location to save the zipfile.

·         Select the ‘Open’ button after the download process has completed. Next, select the ‘Extract’ button for the computer software zipfile application window. Browse to the directory: c:\Inetpub\wwwroot by clicking on My Computer from the right-panel and select the ‘Extract’ button again. The contents of the zipfile should extract as shown below:

 

+Inetpub

+wwwroot

+moose3

+html

+maps

 

2.2    Directory Structure Setup

Using windows explorer, copy and paste all files located under the ‘html’ folder to the ‘Moose3’ located under the C:\Inetpub\wwwroot. The structure of the Moose3 directory should appear as shown:

 

·         Select all the files located under the html directory and copy and paste to the moose3 directory.

 

·         Create a new folder “temp_mapserv” for the ouput images to be written to and stored in as shown

-Local Disk (C:)

+Inetpub

     +wwwroot

              +moose3

+maps

+temp_mapserv

 

3   SOFTWARE REQUIREMENTS

The software requirements for the Moose demo application require that users have a Web Server and MapServer software functioning. The Web Server software can be Internet Information Services (IIS) or Apache. MapServer installations may vary, for information pertaining to specific MapServer installations, see the provided url: http://mapserver.gis.umn.edu/

 

3.1 Web Server Setup

The Web Server Setup requires that the Moose3 folder was created in Step 1.2(a) and populated with the download source data. To setup the parameters for enabling IIS or Apache please refer to sections 2.1(a) and 2.1(b):

 

3.1.1 Example Using Micrsoft Internet Information Server 5.0 (IIS)

The IIS Setup requires that the Moose3 folder was created in Step 1.2(a) and populated with the download source data. To setup the parameters for enabling IIS to access this folder follow the steps provided:

·         Open the IIS console by clicking the ‘Start’ button, click the ‘Programs’ option, select the ‘Administrative Tools’, and check ‘Internet Information Service’.

     Note: If IIS is not operating, users will have to follow the IIS installation and setup procedures by visiting the provided url: http://www.webwizguide.com/asp/tutorials/installing_iis_winXP_pro.asp

·         Open the properties of the ‘Moose3’ folder by left-clicking the folder and right-clicking the properties option.  Modify ‘Execute Permissions’ from ‘Scripts’ to ‘Scripts and Executables’. Verify that the ‘Read’ option is checked.

·         Open the ‘temp_mapserv’ folder by left-clicking the folder and right-clicking the properties option. Verify that the ‘Read’ and ‘Write’ options are checked, and the ‘Execute Permissions’ is set to ‘Scripts only’. The temp_mapserv folder was created in Step 1.2(b) to hold outputted web application images.

 

3.2  MapServer Setup

The MOOSE interface and code requires a mapping engine to generate the images from the GIS data.  As of now MOOSE only supports MapServer.  Users will need to have MapServer running on their server.  The MapServer site provides nice directions for this. http://mapserver.gis.umn.edu/new_users

 

4   SOURCE CODE MODIFICATIONS

The software requirements for the Moose demo application require that users have a Web Server and MapServer software functioning. The Web Server software can be Internet Information Services (IIS) or Apache. MapServer installations may vary, for information pertaining to specific operating system installations, see the provided url: http://mapserver.gis.umn.edu/

 

4.1 JavaScript Configuration Library

Modification of the configuration file parameters will be required to enable the Moose demo application to function using the files stored locally on the user’s hard drive.

Change the map server path parameters of the config.js file located under the Moose3 folder. It is best to keep the paths relative for moving the application.  Note # remarks the existing file, replace with the following line

 

/*

 * Constants to Define the MapServer Call

 */

#varMAPSERVER_PATH = '/gis/mapserver/cgi-bin/mapserv.exe' to as shown:

var MAPSERVER_PATH = 'cgi-bin/mapserv.exe';

var MAPSERVER_HOST = '';

var MAPSERVER_METHOD = 'POST';

 

4.2 Mapbook Demo File

Modification of the demo.xml file parameters will be required to enable the Moose demo application to function using the files stored locally on the user’s hard drive.

Change the map server path parameters of the demo.xml file located under the Moose3 folder. Note # remarks the existing file, replace with the following line

 

<map title="County Map" default="true">

#<file>/usr/local/GIS/moose3/maps/county/county.map</file>

<file>C:\Inetpub\wwwroot\openmnnd\maps\county\county.map</file>

</map>

 

<map title="Municipals Map" default="true">

#<file>/usr/local/GIS/moose3/maps/municipas/municipals.map</file>:

     <file>C:\Inetpub\wwwroot\openmnnd\maps\municipals\municipals.map</file>

</map>

 

<map title="Highway Map" default="true">

#<file>/usr/local/GIS/moose3/maps/highways/highway.map</file>

 <file>C:\Inetpub\wwwroot\openmnnd\maps\highways\highway.map</file>

</map>

 

<map title="State Parks” default="true">

#<file>/usr/local/GIS/moose3/maps/parks/parks.map</file>

<file>C:\Inetpub\wwwroot\openmnnd\maps\parks\parks.map</file>

</map>

    

<map title="2003 LMIC Aerials" default="true">

#<file>/usr/local/GIS/moose3/maps/2003aerials/2003aerials.map</file>

<file>C:\Inetpub\wwwroot\openmnnd\maps\2003aerials\2003aerials.map</file>

</map>

 

<map title="Scale Bar" default="true">

#<file>/usr/local/GIS/moose3/maps/internal/scalebar.map</file>

 <file>C:\Inetpub\wwwroot\openmnnd\maps\internal\scalebar.map</file>

</map>

 

<map title="Selected Point" default="true">

#<file>/usr/local/GIS/moose3/maps/internal/point.map</file>

 <file>C:\Inetpub\wwwroot\openmnnd\maps\internal\point.map</file>

</map>

 

<map title="Internal Use Only" default="true">

#<file>/usr/local/GIS/moose3/maps/internal/polygon.map</file>

 <file>C:\Inetpub\wwwroot\openmnnd\maps\internal\polygon.map</file>

</map>

 

4.3 Map File

Modification of the map file parameters will be required to enable the Moose demo application to function using the files stored locally on the user’s hard drive.

Change the map server IMAGEPATH parameters of the spatial layer .map and internal application files located under the Moose3 folder. Note # remarks the existing file, replace with the following line

 

County Map

                   WEB

                             QUERYFORMAT 'text/xml'

                             BROWSEFORMAT 'text/xml'

                             TEMPLATE '../browse_nolegend.xml'

                             #IMAGEPATH '/tmp/www/'

                             IMAGEPATH "C:\Inetpub\wwwroot\moose3\temp_mapserv\"

                             #IMAGEURL "/"

                             IMAGEURL "temp_mapserv/"

                   END

 

              Municipal Map

                   WEB

                             QUERYFORMAT 'text/xml'

                             BROWSEFORMAT 'text/xml'

                             TEMPLATE '../browse_nolegend.xml'

                             #IMAGEPATH '/tmp/www/'

                             IMAGEPATH "C:\Inetpub\wwwroot\ moose3\temp_mapserv\"

                             #IMAGEURL "/"

                             IMAGEURL "temp_mapserv/"

                   END

 

              Highway Map

                   WEB

                             QUERYFORMAT 'text/xml'

                             BROWSEFORMAT 'text/xml'

                             TEMPLATE '../browse_nolegend.xml'

                             #IMAGEPATH '/tmp/www/'

                             IMAGEPATH "C:\Inetpub\wwwroot\ moose3\temp_mapserv\"

                             #IMAGEURL "/"

                             IMAGEURL "temp_mapserv/"

                   END

 

              Parks Map

                   WEB

                             QUERYFORMAT 'text/xml'

                             BROWSEFORMAT 'text/xml'

                             TEMPLATE '../browse_nolegend.xml'

                             #IMAGEPATH '/tmp/www/'

                             IMAGEPATH "C:\Inetpub\wwwroot\ moose3\temp_mapserv\"

                             #IMAGEURL "/"

                             IMAGEURL "temp_mapserv/"

                   END

 

              Point Map

                   WEB

                             QUERYFORMAT 'text/xml'

                             BROWSEFORMAT 'text/xml'

                             TEMPLATE '../browse_nolegend.xml'

                             #IMAGEPATH '/tmp/www/'

                             IMAGEPATH "C:\Inetpub\wwwroot\ moose3\temp_mapserv\"

                             #IMAGEURL "/"

                             IMAGEURL "temp_mapserv/"

                   END

 

              Polygon Map

                   WEB

                             QUERYFORMAT 'text/xml'

                             BROWSEFORMAT 'text/xml'

                             TEMPLATE '../browse_nolegend.xml'

                             #IMAGEPATH '/tmp/www/'

                             IMAGEPATH "C:\Inetpub\wwwroot\ moose3\temp_mapserv\"

                             #IMAGEURL "/"

                             IMAGEURL "temp_mapserv/"

                   END

 

              Scalebar Map

                   WEB

                             QUERYFORMAT 'text/xml'

                             BROWSEFORMAT 'text/xml'

                             TEMPLATE '../browse_nolegend.xml'

                             #IMAGEPATH '/tmp/www/'

                             IMAGEPATH "C:\Inetpub\wwwroot\ moose3\temp_mapserv\"

                             #IMAGEURL "/"

                             IMAGEURL "temp_mapserv/"

                   END

 

5       TESTING

The software testing enables users to ensure the Moose demo application is functioning correctly. A user should be able to open their web browser and type in the URL of http://localhost/moose3/moose.html or http://domainname/moose3/moose.html

and see the application open in the web browser.  At this same time the debugger window should popup. 

 

The application provides a debugger window displaying a list of layers loaded and errors, if any. When setting up this MOOSE demo application the most common error was an incorrect IMAGEPATH parameter in the mapfiles or to the MapServer CGI file. The imagepath is the location on the hard drive that MapServer is writing temporary images to and that are being accessed by the client’s web browser. 

 

5.1 Debugger

The debugger window provides users detailed information regarding the success and failure of map layer and tool loading. Click on the links in the debugger window to trobleshoot why a layer is not drawing and loading into the MOOSE demo application.

 

Example of debugger window detailing map loading errors

 

Once you have a functioning demo application you can remove the debugger window popping up on the application startup by altering the onLoad JavaScript function in the Body tag of the moose.html file.  The Body tag should have the startDebugger(); and logDebugMessage(); functions removed as shown in the code snippet below:

“<body onresize="onWindowResize(); updateAllLayers();" onload="onWindowResize(); loadDefaults(xmlDoc);">”