Let icons be inline images

This commit is contained in:
Dave Conway-Jones 2023-11-01 09:31:49 +00:00
parent 5bef32c0f4
commit c830282b24
No known key found for this signature in database
GPG Key ID: 1DDB0E91A28C2643
4 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v4.2.0 - Let icons also be inline images data:image...
- v4.1.0 - Add optional SOG, COG, altft, altm input properties. - v4.1.0 - Add optional SOG, COG, altft, altm input properties.
- v4.0.0 - Breaking - Better context menu variable substitution and retention - v4.0.0 - Breaking - Better context menu variable substitution and retention
Now uses ${name} syntax rather than $name so we can handle user defined variables in context menus. Now uses ${name} syntax rather than $name so we can handle user defined variables in context menus.

View File

@ -13,6 +13,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
### Updates ### Updates
- v4.2.0 - Let icons also be inline images data:image...
- v4.1.0 - Add optional SOG, COG, altft, altm input properties. - v4.1.0 - Add optional SOG, COG, altft, altm input properties.
- v4.0.0 - Breaking - Better context menu variable substitution and retention - v4.0.0 - Breaking - Better context menu variable substitution and retention
Now uses ${name} syntax rather than $name so we can handle user defined variables in context menus. Now uses ${name} syntax rather than $name so we can handle user defined variables in context menus.

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "name": "node-red-contrib-web-worldmap",
"version": "4.1.0", "version": "4.2.0",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.", "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": { "dependencies": {
"@turf/bezier-spline": "~6.5.0", "@turf/bezier-spline": "~6.5.0",

View File

@ -1974,7 +1974,7 @@ function setMarker(data) {
marker = L.marker(ll, {title:data.name, icon:myMarker, draggable:drag}); marker = L.marker(ll, {title:data.name, icon:myMarker, draggable:drag});
labelOffset = [12,-4]; labelOffset = [12,-4];
} }
else if (data.icon.match(/^https?:.*$|^\//)) { // web url icon https://... else if (data.icon.match(/^https?:.*$|^\/|^data:image\//)) { // web url icon https://...
var sz = data.iconSize ?? 32; var sz = data.iconSize ?? 32;
myMarker = L.icon({ myMarker = L.icon({
iconUrl: data.icon, iconUrl: data.icon,