Changes between Version 1 and Version 2 of MapServerTutorial


Ignore:
Timestamp:
04/07/08 05:20:31 (17 years ago)
Author:
pagameba
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapServerTutorial

    v1 v2  
    44== Introduction ==
    55
    6 This tutorial describe how build a web-based mapping application using the Fusion and MapServer. It assumes you are familiar with MapServer and it PHP extension.
     6This tutorial describes how build a web-based mapping application using the Fusion and MapServer. It assumes you are familiar with MapServer and it PHP extension.
    77
    88== Essential Concepts ==
    99
    10 It is very important that you understand how MapServer works. If you are not familiar with MapServer and creating MapFile, please review the MapServer documentation ([http://mapserver.gis.umn.edu/docs]).
     10It is very important that you understand how !MapServer works. If you are not familiar with !MapServer and creating !Map Files, please review the !MapServer documentation ([http://mapserver.gis.umn.edu/docs]).
    1111
    12 Fusion is all about creating a web application. You will need some familiarity with HTML, JavaScript and CSS.
     12Fusion is all about creating a web application. You will need some familiarity with HTML, !JavaScript and CSS.
    1313
    14 The primary development language for building Fusion applications is JavaScript, but if you need to add server-side functionality using the PHP/MapScript extension of MapServer, then a knowledge of PHP is also required.
     14The primary development language for building Fusion applications is !JavaScript, but if you need to add server-side functionality using the PHP/!MapScript extension of !MapServer, then a knowledge of PHP is also required.
    1515
    1616Fusion makes extensive use of static and dynamically generated HTML. You need to be familiar with the Document Object Model (DOM) implemented by various browsers, and the subtle differences between the browsers in how scripting with the DOM works. Although it is possible to use Fusion without any DOM scripting, it is likely that most applications will need to use some scripting to achieve their desired functionality.
    1717
    18 Fusion makes extensive use of CSS to achieve its look and feel in a minimally intrusive way. The design principle behind much of the structure of the user interface components of Fusion is to let the browser do as much of the work as possible with its native layout engine. This is the most efficient and natural design for web pages, and reduces the amount of javascript code that needs to be executed by the client's browser. You will need to thoroughly understand CSS design and implementation concepts in order to fully customize the Fusion interface, but to use the default look and feel of Fusion with moderate customization does not require advanced CSS knowledge.
     18Fusion makes extensive use of CSS to achieve its look and feel in a minimally intrusive way. The design principle behind much of the structure of the user interface components of Fusion is to let the browser do as much of the work as possible with its native layout engine. This is the most efficient and natural design for web pages, and reduces the amount of !JavaScript code that needs to be executed by the client's browser. You will need to thoroughly understand CSS design and implementation concepts in order to fully customize the Fusion interface, but to use the default look and feel of Fusion with moderate customization does not require advanced CSS knowledge.
    1919
    2020== Tutorial Prerequisites ==
    2121
    2222 * '''Fusion''': [http://trac.osgeo.org/fusion/wiki/GetIt]
    23  * '''MapServer gmap-ms46 sample data''': [http://dl.maptools.org/dl/]
     23 * '''!MapServer gmap-ms46 sample data''': [http://dl.maptools.org/dl/]
    2424 * [http://trac.osgeo.org/fusion/attachment/wiki/MapServerTutorialFr/icons-demo.zip?format=raw Icons]
    2525
    2626== Installation ==
    2727
    28 Installing Fusion is very simple. Off course, i assume you have a functionnal web server with MapServer installed. Once you have downloaded Fusion and gmap-ms46, next step is to extract them. In my example, '''/opt/fgs/www/htdocs/''' is my web folder.
     28Installing Fusion is very simple. Of course, this assumes you have a functionnal web server with !MapServer installed. Once you have downloaded Fusion and gmap-ms46, next step is to extract them. In this example, '''/opt/fgs/www/htdocs/''' is the web server's document root.
    2929{{{
    3030$ unzip fusion-1.0.4.zip -d /opt/fgs/www/htdocs/
     
    3232}}}
    3333
    34 Fusion and MapServer data are installed for the demo.
     34Now Fusion and the !MapServer data are installed for the tutorial.
    3535
    3636== Configuration ==
    3737
    38 We will now configure Fusion. There is only one file for the general configuration of Fusion: '''config.json'''. In this file, you can modify the script language use by Fusion (only PHP is supported at the moment) and some web paths will depend on the server configuration. For this tutorial, i did not modify because those default was correct. However, you should verify if the web paths for MapServer and the temporary directory are correct. The default directory for temporary files is set to '''"/tmp"'''. Be sure that your php configuration have the same path. (php5.ini should have a line like: session.save_path = "/tmp")
     38We will now configure Fusion. There is only one file for the general configuration of Fusion: '''config.json'''. In this file, you can modify the script language use by Fusion (only PHP is supported at the moment) and some web paths will depend on the server configuration. For this tutorial,we will not modify them because the default are correct. However, you should verify if the web paths for !MapServer and the temporary directory are correct. The default directory for temporary files is set to '''"/tmp"'''. Be sure that your php configuration have the same path. (php5.ini should have a line like: session.save_path = "/tmp")
    3939{{{
    4040...
     
    4444}}}
    4545
     46'''Note: on windows, you need to specify the {{{.exe}}} extension on mapserv, i.e. {{{/cgi-bin/mapserv.exe}}}'''
     47
    4648== Fusion Application ==
    4749
     
    4951
    5052 * a Map widget
    51  * a Zoom In widget
    52  * a Zoom Out widget
    53  * a Pan widget
    54  * a Legend widget
     53 * a [wiki:Widgets/Zoom Zoom In] widget
     54 * a [wiki:Widgets/Zoom Zoom out] widget
     55 * a [wiki:Widgets/Pan Pan] widget
     56 * a [wiki:Widgets/Legend Legend] widget
    5557
    56 These widgets must be described in a xml file named ApplicationDefinition. This file describe the configuration of a Fusion application: mapfile, ressource, widgets. This file will contain a MapFile tag for MapServer and all desired widgets (Widget tag) inside the tag WidgetSet (see the ApplicationDefinition page for a more complete description).
     58These widgets must be described in a xml file named ApplicationDefinition. This file describe the configuration of a Fusion application: mapfile, resources, and widgets. This file will contain a MapFile tag for !MapServer and all desired widgets (Widget tag) inside the tag [wiki:ApplicationDefinition/WidgetSet WidgetSet].
    5759
    5860First, create a directory for the application and extract the icons downloaded inside this directory. These icons will be used by the widgets.
     
    6264}}}
    6365
    64 Still in this directory, create a new file named '''ApplicationDefinition.xml''' and copy the following content inside:
     66Still in this directory, create a new file named '''!ApplicationDefinition.xml''' and copy the following content inside:
    6567{{{
    6668<?xml version="1.0" encoding="UTF-8"?>
     
    142144}}}
    143145
    144 Don't forget to modify the path of the mapfile (MapFile tag). If you check the file, you will notice there is a Widget tag for all functionality with its options. Most of which are not required for this tutorial. Create now a HTML template page named '''index.html''' for Fusion.
     146Don't forget to modify the path of the mapfile (!MapFile tag). If you check the file, you will notice there is a Widget tag for all functionality with its options, most of which are not required for this tutorial. Create now a HTML template page named '''index.html''' for Fusion.
    145147{{{
    146148<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">