GEOLYTIX / xyz

An open source javascript framework for spatial data and application interfaces.
MIT License
87 stars 25 forks source link

icon styles: svgSymbols / svg_templates #1193

Open dbauszus-glx opened 5 months ago

dbauszus-glx commented 5 months ago

The svgSymbols mapp mod has become quite a long in the teeth.

The type icons should be retired once the styleParser has been reviewed and merged.

There are currently following type symbols.

dot target triangle square diamond semiCircle markerLetter markerColor circle template

SVG icons hosted in the public directory should be made available for these.

The styleParser method can replace the type declarations with the matching svg.

It must still be possible to create an icon from a custom function. Memoization is crucial is this is to happen inside the theme method.

The template type icons should be created with the styleParser.

dbauszus-glx commented 4 months ago

The svg_templates plugin method shouldn't be a plugin method. This method should always be executed when a mapview is created. But svg_templates should not be loaded twice in the case of multiple mapviews in a document.

With the svgSymbols being retired it doesn't make sense to have the type: template if there is only a single type.

It must still be possible to create a custom templates from a function.

There should be an interface to define custom templates and colour substitutes.

The templates should render without any colours being substituted.

dbauszus-glx commented 2 months ago

The next step will be to create svg templates for each type.

These default templates could be imported as string from svg files in the public folder if possible.

The target: type needs to be translated into base icon dot (with shadow) and additional icon array items which do not have a shadow.

A translation method will be required for each of the type icons.

It may be necessary to flatten icon arrays where an array type target is in an icon array.