wiki:NamedStylesProposal

Version 2 (modified by sderle, 15 years ago) ( diff )

--

Proposal to implement Named Styles in MapServer

Mapfile Extensions

  • Enable STYLE blocks at the top MAP level
    • Add a NAME directive to the STYLE block
    • Top-level STYLE blocks must be named
  • Provide a "named style" declaration in the LAYER block in the form of LAYER "name" (in addition to the existing LAYER ... 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
  • Add an EXTENDS "style" directive to the STYLE 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

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.