From 66db17dad4632f670acf6d47e3b57856489fdb0e Mon Sep 17 00:00:00 2001 From: Olivier Guyot Date: Thu, 28 May 2020 12:37:48 +0200 Subject: [PATCH 1/2] Allow ttf:// scheme for well known names in mark symbolizer Typescript does not allow yet doing strong validation on strings, so we have to resort to allowing any string for this attribute. --- index.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index e2c79441b..90190b896 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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://# */ 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 From aa86bcb3c643dac6312cc4dbe8ee75e4d933aaa8 Mon Sep 17 00:00:00 2001 From: Olivier Guyot Date: Thu, 4 Jun 2020 10:06:58 +0200 Subject: [PATCH 2/2] Add an example mark symbolizer using a font glyph --- sample.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sample.ts b/sample.ts index 9e5590da1..416f38116 100644 --- a/sample.ts +++ b/sample.ts @@ -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' }] }, {