Version 2 (modified by 15 years ago) ( diff ) | ,
---|
Proposal to implement Named Styles in MapServer
Mapfile Extensions
- Enable
STYLE
blocks at the topMAP
level- Add a
NAME
directive to theSTYLE
block - Top-level
STYLE
blocks must be named
- Add a
- Provide a "named style" declaration in the
LAYER
block in the form ofLAYER "name"
(in addition to the existingLAYER ... END
syntax)- The
LAYER
object gets instantiated with a copy of the named style from the top level - Referencing a non-existent
STYLE
by name throws an exception
- The
- Add an
EXTENDS "style"
directive to theSTYLE
block- Block styles that inherit from a named style are instantied as a copy of the named style before other declarations in the
STYLE
block are applied
- Block styles that inherit from a named style are instantied as a copy of the named style before other declarations in the
Proposed Map File Syntax Example
MAP STYLE NAME "some_style" ... END ... LAYER NAME "uses_a_style" CLASS STYLE "some_style" ... END END LAYER NAME "extends_a_style" CLASS STYLE EXTENDS "some_style" ... END END END END
MapServer StyleObj
Extensions
- Add a "name" property
- Add a "global" property
- Add a "cloneStyle" function to mapfile.c
MapScript Extensions
- ...
Note:
See TracWiki
for help on using the wiki.