jpenilla / squaremap-addons

Various addons for squaremap
12 stars 13 forks source link

signs: permit user-selectable custom icons #59

Closed cbs228 closed 1 year ago

cbs228 commented 1 year ago

Add custom icons to the Leaflet map via the signs plugin. Administrators with shell access may add their own image files to the $dataDir/customicons/ directory, which is now created empty on first run. Image files placed in this directory are registered as custom icons.

When enabled in the configuration, the first line of text on the front of every marker sign is matched against the pattern defined in icon.custom.regexp. If the matched text is an icon file, that icon is used in place of the stock "sign" icon.

With the default pattern, a sign with the text content

![my_cool_icon]
Anything goes
on line three and
line four

will attempt to use a custom icon. If the file $dataDir/customicons/my_cool_icon.png exists, it will be used as the Leaflet map icon. Otherwise, the stock icon will be used.

This behavior is optional and disabled by default.

Also add a basic README file for this plugin.