allow fa-icon midifers to affect size more usefully

to close #49
This commit is contained in:
Dave Conway-Jones 2018-10-04 22:39:42 +01:00
parent 31fe6d5ec1
commit 43765d8b89
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
5 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v1.4.6 - allow more variation in fa-icon modifiers
- v1.4.5 - fix clearing overlays - v1.4.5 - fix clearing overlays
- v1.4.4 - add a couple of extra overlay layers, roads, rail, sea - v1.4.4 - add a couple of extra overlay layers, roads, rail, sea
- v1.4.3 - support custom icon for GPX and KML. Better readme for geojson. - v1.4.3 - support custom icon for GPX and KML. Better readme for geojson.

View File

@ -9,6 +9,7 @@ map web page for plotting "things" on.
### Updates ### Updates
- v1.4.6 - allow more variation in fa-icon modifiers
- v1.4.5 - fix clearing overlays - v1.4.5 - fix clearing overlays
- v1.4.4 - add a couple of extra overlay layers, roads, rail, sea - v1.4.4 - add a couple of extra overlay layers, roads, rail, sea
- v1.4.3 - support custom icon for GPX and KML. Better readme for geojson. - v1.4.3 - support custom icon for GPX and KML. Better readme for geojson.

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "name": "node-red-contrib-web-worldmap",
"version": "1.4.5", "version": "1.4.6",
"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": {
"cgi": "0.3.1", "cgi": "0.3.1",

View File

@ -1049,9 +1049,11 @@ function setMarker(data) {
} }
else if (data.icon && (data.icon.substr(0,3) === "fa-")) { else if (data.icon && (data.icon.substr(0,3) === "fa-")) {
var col = data.iconColor || "#910000"; var col = data.iconColor || "#910000";
var imod = "";
if (data.icon.indexOf(" ") === -1) { imod = "fa-2x "; }
myMarker = L.divIcon({ myMarker = L.divIcon({
className:"faicon", className:"faicon",
html: '<center><i class="fa fa-fw fa-2x '+data.icon+'" style="color:'+col+'"></i></center>', html: '<center><i class="fa fa-fw '+imod+data.icon+'" style="color:'+col+'"></i></center>',
iconSize: [30, 30] iconSize: [30, 30]
}); });
marker = L.marker(ll, {title:data.name, icon:myMarker, draggable:drag}); marker = L.marker(ll, {title:data.name, icon:myMarker, draggable:drag});

View File

@ -1,5 +1,5 @@
CACHE MANIFEST CACHE MANIFEST
# date: Oct 3rd 2018 - v1.4.5 # date: Oct 3rd 2018 - v1.4.6
CACHE: CACHE:
index.html index.html