|
The project file (or in terms of TimeMap "mapspace file") is XML document which describes the structure of map. It contains the list of layers, describes their renderers, symbology and the sources of data.
1. Define layers and data source for standalone mode.
In this mode applet loads data directly. No dedicated server side is needed.
This is the simplest example of project consists of single layer. The dataset for this layer is ESRI shapefile that is located in the applet code base directory.
Thus, you see that you have to define subelement layer with another subelement dataset.
Dataset may be described. There are four elements for file based datasets:
- #51 - field name for description/notes of feature, search field by default.
- #63 - main web link mask
- #301 - web link mask for search
- #302 - web link mask for list of features.
See for details Web links
Example
It is recommended to store the metadata in the separate file together with
dataset file. It allows to use metadata in many projects. For our example you
have to extract element metadata and save it in file mymap.xml.
To reduce downloading's time you may to compress your data files (shp and dbf)
and metadatafile (xml) with zip. The reference to this dataset will be:
The following example shows how to attach raster image layer.
The metadata elements are the transformation parameters to map raster image. They are similar to ESRI world file parameters.
- #142 X-coordinate of the center of the upper left pixel
- #143 Y-coordinate of the center of the upper left pixel
- #144 Dimension of a pixel in map units in the x-direction
- #145 Dimension of a pixel in map units in the y-direction
2. Using server side.
Using direct loading is easy but it has some inconveniences.
The data must be stored in applet code base (or in its subdirectories).
You can't prevent unauthorized downloading of your map data.
The dataset downloads completely.
Load of data via ALOV server solves these issues. Here is the example how to define dataset to load data via servlet.
direct="no" means that dataset af_provinces.shp loads via servelt.
full="no" means that dataset will be download to client partially - only for current map extent. If full="yes" the data will be downloaded completely at once.
3. Dataset registered in ALOV's Clearinghouse database.
Using the Clearinghouse database is the best way for the centralized storing and
administering of datasets. The dataset described and registered in Clearinghouse database
once can be re-used in many projects. See how to register dataset in Clearinghouse database
here
The definition of datasets in project file from Clearinghouse database is quite simply:
id is unique dataset's ID in Clearinghouse database. First layer is vector, second one is raster.
4. Several layers can use the same dataset. You can define several layers based on the same dataset. The data will be downloaded only once.
|