HOW TO SETUP MOOSE DEMO APPLICATION GUIDE
TABLE OF CONTENTS
1. INTRODUCTION
1.1 MOOSE COMPONENTS
3.1WEB SERVER
3.1.1 IIS
3.2 MAP SERVER
4.1 JAVASCRIPT CONFIGURATION LIBRARY
4.3 MAP FILES
5 TESTING
5.1 DEBUGGING
Moose is the City of
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.
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.
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.
+Inetpub
+wwwroot
+moose3
+html
+maps
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
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/
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:
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
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';
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="
#<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
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
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);">”