Skip to content

Commit

Permalink
Merge pull request #143 from jahow/add-ttf-support-mark-symbolizer
Browse files Browse the repository at this point in the history
Allow ttf:// scheme for well known names in mark symbolizer
  • Loading branch information
jansule authored Jun 4, 2020
2 parents 46a5b00 + aa86bcb commit 5e75132
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,20 @@ export interface BasePointSymbolizer extends BaseSymbolizer {

/**
* Supported WellKnownNames
* Note that due to TypeScript limitations any string will be valid for this type; this will not change
* until regexp or equivalent is supported, see:
* https://github.com/microsoft/TypeScript/issues/6579
*
* Important: Geostyler Style Parsers are only expected to support the values listed below,
* as well as font-based symbols following Geotools/Geoserver syntax:
* ttf://<font name>#<hex code>
*/
export type WellKnownName = 'Circle' | 'Square' | 'Triangle' | 'Star' | 'Cross' | 'X'
| 'shape://vertline' | 'shape://horline' | 'shape://slash'
| 'shape://backslash' | 'shape://dot' | 'shape://plus'
| 'shape://times' | 'shape://oarrow' | 'shape://carrow' ;
| 'shape://times' | 'shape://oarrow' | 'shape://carrow'
| 'ttf://Webdings#0x0064'
| string;

/**
* MarkSymbolizer describes the style representation of POINT data, if styled as
Expand Down
7 changes: 7 additions & 0 deletions sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ const sampleStyle: Style = {
wellKnownName: 'Circle',
visibility: false,
radius: 5
}, {
kind: 'Mark',
wellKnownName: 'ttf://Webdings#0x68',
radius: 12,
color: '#8a000e',
strokeOpacity: 0.7,
strokeColor: '#ffffff'
}]
},
{
Expand Down

0 comments on commit 5e75132

Please sign in to comment.