Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This example assumes that the Elgin data is in PostgreSQL, with the connection information in an include file called datashare.inc. This is not entirely standard, but the important part here is the DATA string.

In this example we have included three different layer snippets for:

  • Delays possible
  • Delays unlikely
  • Delays likely

This example assumes that there are the following three manatw symbols "mat at work" in the MapServer symbols file: 

ImageImage NameSnippet for .sym fileImageImage NameSnippet for .sym file
manatw-B.png


Paste code macro
SYMBOL
	NAME 'matatw-B'
	TYPE PIXMAP
	IMAGE 'images/matatw-B.png'
END


roadworks.png


Paste code macro
SYMBOL
	NAME 'roadworks-red'
	TYPE PIXMAP
	IMAGE 'images/roadworks.png'
END


manatw-G.png


Paste code macro
SYMBOL
	NAME 'matatw-G'
	TYPE PIXMAP
	IMAGE 'images/matatw-G.png'
END


roadworks_yellow.png


Paste code macro
SYMBOL
	NAME 'roadworks-yellow'
	TYPE PIXMAP
	IMAGE 'images/roadworks_yellow.png'
END


manatw-F.png


Paste code macro
SYMBOL
	NAME 'matatw-F'
	TYPE PIXMAP
	IMAGE 'images/matatw-F.png'
END


roadworks_orange.png


Paste code macro
SYMBOL
	NAME 'roadworks-orange'
	TYPE PIXMAP
	IMAGE 'images/roadworks_orange.png'
END


We have also included some others if you should wish to use them. To configure iShare to use the attached symbols then you will need to:

  • Save the image(s) to your E:\iShareData\LIVE\_MapServerConfig\CustomSymbols\mapicons\images folder.
  • Add a link to these icons, using the above snippets, in your mapicon_abc.sym file (in the mapicons folder) where abc is what you have called your cut down copy of the mapicon.sym file,
  • Now you may use these in your .map file LAYER as below.

For each Elgin Roadworks layer you wish to display you will need to add a LAYER entry into the .MAP file.

You may copy the following Snippets into your .MAP file using the Map Editor in Studio.

Code Block
languagebash
titleDelays possible LAYER snippet
LAYER
	INCLUDE "datashare.inc"
	DATA "wkb_geometry from (select * from roadworks where impact = 'Delays possible') as foo using srid=27700 using unique ogc_fid"
	METADATA
		"qstring_validation_pattern" "."
	END
	NAME "roadworks_possible"
	STATUS OFF
	TYPE POINT
	UNITS METERS
	CLASS
		NAME "Delays possible"
		STYLE
			SYMBOL "manatw-F"
		END
	END
END


Code Block
languagebash
titleDelays unlikely LAYER snippet
LAYER
	INCLUDE "datashare.inc"
	DATA "wkb_geometry from (select * from roadworks where impact = 'Delays unlikely') as foo using srid=27700 using unique ogc_fid"
	METADATA
		"qstring_validation_pattern" "."
	END
	NAME "roadworks_unlikely"
	STATUS OFF
	TYPE POINT
	UNITS METERS
	CLASS
		NAME "Delays unlikely"
		STYLE
			SYMBOL "manatw-B"
		END
	END
END


Code Block
languagebash
titleDelays likely LAYER snippet
LAYER
	INCLUDE "datashare.inc"
	DATA "wkb_geometry from (select * from roadworks where impact = 'Delays likely') as foo using srid=27700 using unique ogc_fid"
	METADATA
		"qstring_validation_pattern" "."
	END
	NAME "roadworks_likely"
	STATUS OFF
	TYPE POINT
	UNITS METERS
	CLASS
		NAME "Delays likely"
		STYLE
			SYMBOL "manatw-G"
		END
	END
END