.. _workshop-contents: GeoMoose Workshop ================= About this workshop ------------------- - Learn how to install GeoMoose, add data to the application, and customize the look and feel. - This workshop assumes the use of MS4W as the installation platform. GeoMoose is Linux/UNIX/OS-X friendly and is, in fact, developed on Linux but the install on Linux is out of the scope of this workshop. Who is this workshop for? ------------------------- - Anyone wanting to have a WebGIS application for their users. - "GIS Admins" - People who have data and want to serve it on the web. - Developers who don't want to repeat themselves. Installing MS4W --------------- Getting started with MS4W ------------------------- MapServer for Windows (MS4W) will install the base files required by GeoMoose along with an Apache service to actually serve GeoMoose. Once installed, navigate to localhost for more detail Also, full description of optional packages in the installer are found on ms4w.com. Requirements: - A computer running Windows 7 or newer. - A copy of MS4W. `Download Here. `__ Install MS4W ------------ **Double click the ms4w-3.2.7-setup.exe icon.** Ensure the checkbox for **GeoMoose 3.2.0 is checked.** .. figure:: ../quickstarts/ms4w/ms4w-setup-1.png :alt: ms4w setup screen 1 ms4w setup screen 1 Select "C:\\" ------------- The MapServer for Windows installer will prompt for a path. GeoMoose is set up and expects to run from the default path (``C:\ms4w\apps\gm3\htdocs\``), so please leave it set to ``C:\``. This will also make all future updates and enhancements to the application simpler. .. figure:: ../quickstarts/ms4w/ms4w-setup-2.png :alt: ms4w setup screen 2 ms4w setup screen 2 Keep it real, Keep it Port 80 ----------------------------- Lastly, MapServer for Windows will ask to specify the Apache port. There is no reason to change this unless port 80 is already in use. Also, if you install another web service in the future that uses port 80, you may want to reconfigure it to run a different port. .. figure:: ../quickstarts/ms4w/ms4w-setup-3.png :alt: ms4w setup screen 3 ms4w setup screen 3 Open MS4W! ---------- You can validate the ms4w installation by navigating to `localhost `__, where you will be greeted by the MS4W MapServer introduction and features. .. figure:: ../quickstarts/ms4w/ms4w-success.png :alt: working ms4w working ms4w Find the GeoMoose listing ------------------------- GeoMoose will now show up on the MS4W `localhost `__ page under applications .. figure:: ../quickstarts/ms4w/geomoose-success-1.png :alt: geomoose listing geomoose listing Click a link to launch the Desktop or Mobile version of GeoMoose. Look at that! ------------- .. figure:: ../quickstarts/ms4w/geomoose-success-2.png :alt: geomoose desktop geomoose desktop Time to play ------------ Learning the insides of GeoMoose -------------------------------- GeoMoose vocabulary ------------------- - GeoMoose - Javascript SDK - Mapbook XML - Main configuration file. - Has ``map-source`` entries. - Defines the catalog and toolbar. - Mapfile - OSGeo MapServer configuration files. - 'Application JS' or ``app.js`` - File that defines the actual application behaviour. - 'Application HTML' - Usually ``index.html``, defines the look and feel of the application, includes all the Javascript files. Visual of GeoMoose app structure -------------------------------- .. figure:: ./gm3_structure.png :alt: GeoMoose Application Structure GeoMoose Application Structure *Darker shading indicates the degree of affect for files during a GeoMoose 3 upgrade.* What does the app look like? ---------------------------- .. figure:: ./images/desktop-directory-listing.png :alt: GeoMoose Application Directory GeoMoose Application Directory Starting a fresh GeoMoose Application ------------------------------------- - Goto ``C:\ms4w\apps\gm3\htdocs``. - Copy ``desktop/`` to ``workshop/``. - Open the new http://localhost/gm3/workshop/ Adding a MapServer source ------------------------- What is MapServer? ~~~~~~~~~~~~~~~~~~ - Lightweight, OGC standards compliant, CGI-based map rendering engine. - Configured with "Mapfiles" - *GeoMoose provides shortcuts for working with MapServer as a WMS using its type="mapserver" map-sources*. Batteries are included with Firestations ---------------------------------------- - The firestations layer is included with the GeoMoose 3 Demo Data. - Open ``C:\ms4w\apps\gm3\htdocs\workshop\mapbook.xml`` - Add the following after line 5: .. code:: xml ./demo/firestations/firestations.map - This will add the ``firestations`` source with a ``fire_stations`` layer. The firestations.map file ------------------------- ``firestations.map`` can be found installed on ``C:\ms4w\apps\gm3-demo-data\demo\firestations\firestations.map.`` Mapfile "preamble" ~~~~~~~~~~~~~~~~~~ :: MAP # Include commonly re-used GeoMoose parameters INCLUDE '../../geomoose_globals.map' # The web section defines more metadata for the map # that can be used with OGC services. WEB METADATA 'ows_title' 'County Firestations' INCLUDE '../../common_metadata.map' END END firestations.map - Layer definition ----------------------------------- :: LAYER NAME 'fire_stations' STATUS ON METADATA 'ows_title' 'Fire Stations' 'ows_include_items' 'all' 'gml_include_items' 'all' 'ows_exclude_items' 'SHAPE_area,SHAPE_len' 'gml_exclude_items' 'SHAPE_area,SHAPE_len' END TYPE POINT DATA 'firestations' PROJECTION 'init=epsg:26915' END CLASS NAME 'Fire Stations' STYLE COLOR 254 0 0 SYMBOL 'star' SIZE 8 END END TOLERANCE 10 TEMPLATE 'dummy' END # End of Layer firestations.map - End of the map! ---------------------------------- :: END # End of Map Add Firestations to the catalog ------------------------------- - GeoMoose separates the difference between the source-data with ```` es and presentation with the use of the ````. - In ``mapbook.xml`` goto line 445 and add the following on the next line: .. code:: xml - This will add the ``fire_stations`` layer of the ``firestations`` source to the catalog with the label "Firestations". -------------- - "Hard" Reload the Browser or clear-the-cache and reload. *Pro tip: Chrome can be very aggressive at caching AJAX loaded XML.* - The catalog should now have a 'Firestations' layer at the top! .. figure:: ./images/firestations-in-catalog.png :alt: Firestations in the catalog Firestations in the catalog Adding identify to Firestations ------------------------------- - WMS has the GetFeatureInfo request which GeoMoose will use to fetch feature data. - For a layer to work with identify it needs to have a ``