Create Logger Map Source
Copy your Base.map and give it a new name e.g. Faults.map.
Base Maps
Your standard map layers such as Aerial Photography or OS MasterMap data would normally be configured in a BaseMaps element in your Logger MapSource .xml file e.g.
Example
<DefaultBaseMap>base_ADS</DefaultBaseMap>
<BaseMaps>
<BaseMap>base_ADS</BaseMap>
<BaseMap>base_Aerial</BaseMap>
</BaseMaps>
You will most likely require a layer for performing Location Searching and then you will need your individual Fault reporting layers. As the majority of fault reporting tends to be asset-based you may wish to also add an Assets layer.
Location Search Layer
LAYER
NAME llpg
TYPE POINT
STATUS OFF
DATA "LLPG/ALL.shp"
METADATA
qstring_validation_pattern '.'
ENDFault Reporting Layers
For each fault layer you will need a LAYER section. These layers are postgis layers accessing the data directly from the Astun database; please alter the existing database CONNECTION entry to match the layer requirement for each of the layers you wish to add.
At present Studio does not handle the encrypting of credentials - please refer to the current MapServer documentation to enable this http://mapserver.org/utilities/msencrypt.html.
You can also change the icon that you wish to use to display existing faults on the map for this layer by editing the SYMBOL entry.
Example
LAYER
NAME faults
DEBUG 5
TYPE POINT
STATUS OFF
CONNECTIONTYPE postgis
CONNECTION "user=iShareData password=password dbname=iShareData host=localhost port=5432"
DATA "wkb_geometry from (select * from at_incidents WHERE active > 0) as foo using unique ogc_fid using SRID=27700"
METADATA
qstring_validation_pattern '.'
END
TOLERANCE 0
TOLERANCEUNITS METERS
CLASS
STYLE
SYMBOL "D:\iShareMaps\surreyheath_01\faults\images\doublecircle.png"
END
END
END
The above faults layer will contain all active incidents held in the Astun database if you wish to create a layer to show historic / inactive information then you will need to change the select statement to read:
select * from at_incidents WHERE active = 0
If you wish to show ALL information then you would need the following select statement:
select * from at_incidents
If you wish to add another layer for a different type of fault reporting you would perhaps call the first layer abandonedcars for instance and the second faultystreetlights.
Assets Layer
For each asset layer you will need a LAYER section which should be given the same name as the faults layer but with the suffix 'Assets' and should appear directly BELOW the faults layer in the Layer group's layer list - see screenshot below. The ordering in the .map file is not important.
Example
LAYER
NAME faultsAssets
DEBUG 5
TYPE POINT
STATUS OFF
CONNECTIONTYPE postgis
CONNECTION "user=iShareData password=password dbname=iShareData host=localhost port=5432"
DATA "wkb_geometry from (select * from my_assets) as foo using unique ogc_fid using SRID=27700"
METADATA
qstring_validation_pattern '.'
END
CLASS
STYLE
SYMBOL “rectangle”
OUTLINECOLOR 0 0 0
COLOR 255 255 255
WIDTH 2
SIZE 8
END
END
END