Add weathericons

pull/112/head
Dave Conway-Jones 6 years ago
parent 3077bf87bd
commit 878ba17b43
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4

@ -1,6 +1,8 @@
### Change Log for Node-RED Worldmap
- v1.5.37 - Add .trackpoints to override default in tracks node. Let tracks optionally be on different layers. Fix marker changing layers Issue #85
- v1.5.39 - Add weather-lite icons
- v1.5.38 - Add Esri dark grey and ocean, re-add hikebike, layers
- v1.5.37 - Add .trackpoints to override default number in tracks node. Let tracks optionally be on different layers. Fix marker changing layers Issue #85
- v1.5.36 - Fix contextmenu $name substitution
- v1.5.35 - Add msp.delete command to remove any layers not needed at start (array of names). Issue #83.
- v1.5.34 - Add command.contextmenu to set non-marker context menu (defaults to add marker).

@ -9,6 +9,7 @@ map web page for plotting "things" on.
### Updates
- v1.5.39 - Add weather-lite icons
- v1.5.38 - Add Esri dark grey and ocean, re-add hikebike, layers
- v1.5.37 - Add .trackpoints to override default in tracks node. Let tracks optionally be on different layers. Fix marker changing layers Issue #85
- v1.5.36 - Fix contextmenu $name substitution. Issue #84
@ -18,15 +19,6 @@ map web page for plotting "things" on.
- v1.5.32 - Add .contextmenu custom right click menu, Fix map lock, Close websocket on unload
- v1.5.31 - Fix pan first at start, and coords overlay. Issues #81 and #82
- v1.5.30 - Add .tooltip option, ability to remove base layer, search on icon, show mouse pointer co-ordinates
- v1.5.29 - Remove lat/lon from popup if using .popup property. Allow icon to be loaded from http.
- v1.5.28 - Tidy up popup location and timing. Auto add countries overlay if no internet.
- v1.5.27 - Add hide right click option to config panel
- v1.5.26 - Ensure all map tiles loaded over https
- v1.5.25 - Add button command to allow user to add and remove buttons
- v1.5.24 - Ensure hiderightclick does do that, and popup always has close button. Issue #69, #70
- v1.5.23 - Let icon support use of emoji specified as :emoji name:
- v1.5.22 - Slight adjust to label positions for default map marker icon. Add .lineColor for bearing lines
- v1.5.21 - Add .label option to display permanent label. Clean up some excess debug logging
- ...
see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list.
@ -61,7 +53,7 @@ Optional properties include
- **bearing** : when combined with speed, draws a vector.
- **accuracy** : when combined with bearing, draws a polygon of possible direction.
- **lineColor** : CSS color name or #rrggbb value for bearing line or accuracy polygon
- **icon** : <a href="https://fontawesome.com/v4.7.0/icons/" target="mapinfo">font awesome</a> icon name, :emoji name:, or http://
- **icon** : <a href="https://fontawesome.com/v4.7.0/icons/" target="mapinfo">font awesome</a> icon name, <a href="https://github.com/Paul-Reed/weather-icons-lite" target="mapinfo">weather-lite</a> icon, :emoji name:, or http://
- **iconColor** : Standard CSS colour name or #rrggbb hex value.
- **SIDC** : NATO symbology code (can be used instead of icon). See below.
- **building** : OSMbulding GeoJSON feature set to add 2.5D buildings to buildings layer. See below.
@ -83,7 +75,7 @@ by using the **popup** property to supply your own html content.
### Icons
You may select any of the Font Awesome set of [icons](https://fontawesome.com/v4.7.0/icons/).
If you use the name without the fa- prefix (eg `male`) you will get the icon inside a generic marker shape. If you use the fa- prefix (eg `fa-male`) you will get the icon on its own.
If you use the name without the fa- prefix (eg `male`) you will get the icon inside a generic marker shape. If you use the fa- prefix (eg `fa-male`) you will get the icon on its own. Likewise you can use any of the [Weather-lite](https://github.com/Paul-Reed/weather-icons-lite) icons by using the wi- prefix. These map to icons returned by common weather API such as DarkSky and OpenWeatherMap - for example `"wi-owm-"+msg.payload.weather[0].icon` will pickup the icon returned from the OpenWeatherMap API.
You can also specify an emoji as the icon by using the :emoji name: syntax - for example `:smile:`. Here is a **[list of emojis](https://github.com/dceejay/RedMap/blob/master/emojilist.md)**.

@ -1,6 +1,6 @@
{
"name": "node-red-contrib-web-worldmap",
"version": "1.5.38",
"version": "1.5.39",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": {
"cgi": "0.3.1",

@ -23,6 +23,7 @@
<link rel="stylesheet",type="text/css" href="css/map.css"/>
<link rel="stylesheet",type="text/css" href="leaflet/leaflet.css"/>
<link rel="stylesheet",type="text/css" href="leaflet/font-awesome/css/font-awesome.min.css"/>
<link rel="stylesheet",type="text/css" href="leaflet/weather-icons-lite/css/weather-icons-lite.min.css"/>
<link rel="stylesheet",type="text/css" href="leaflet/leaflet-vector-markers.css">
<link rel="stylesheet",type="text/css" href="leaflet/MarkerCluster.css">
<link rel="stylesheet",type="text/css" href="leaflet/MarkerCluster.Default.css">
@ -1277,6 +1278,19 @@ function setMarker(data) {
marker = L.marker(ll, {title:data.name, icon:myMarker, draggable:drag});
labelOffset = [16,-16];
}
else if (data.icon && (data.icon.substr(0,3) === "wi-")) {
var col = data.iconColor || "#910000";
var imod = "";
if (data.icon.indexOf(" ") === -1) { imod = "wi-2x "; }
myMarker = L.divIcon({
className:"wiicon",
html: '<center><i class="wi wi-fw '+imod+data.icon+'" style="color:'+col+'"></i></center>',
iconSize: [32, 32],
popupAnchor: [0, -16]
});
marker = L.marker(ll, {title:data.name, icon:myMarker, draggable:drag});
labelOffset = [16,-16];
}
else {
myMarker = L.VectorMarkers.icon({
icon: data.icon || "circle",

@ -0,0 +1,9 @@
/*!
* Weather Icons Lite
* Weather themed icons for Bootstrap
* Author - Paul Reed
* Maintained at https://github.com/Paul-Reed/weather-icons-lite
* Description - A lighweight version of Weather Icons
* Credit to Erik Flowers - erik@helloerik.com
*
*/@font-face{font-family:'weather-icons-lite';font-weight:normal;font-style:normal;src:url('../fonts/weather-icons-lite.woff2') format('woff2'),url('../fonts/weather-icons-lite.woff') format('woff'),url('../fonts/weather-icons-lite.ttf') format('truetype'),url('../fonts/weather-icons-lite.eot') format('embedded-opentype')}.wi{display:inline-block;font-family:'weather-icons-lite';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.wi-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.wi-xs{font-size:.75em}.wi-sm{font-size:.875em}.wi-1x{font-size:1em}.wi-2x{font-size:2em}.wi-3x{font-size:3em}.wi-4x{font-size:4em}.wi-5x{font-size:5em}.wi-6x{font-size:6em}.wi-7x{font-size:7em}.wi-8x{font-size:8em}.wi-9x{font-size:9em}.wi-10x{font-size:10em}.wi-fw{text-align:center;width:1.4em}.wi-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.wi-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.wi-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.wi-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0,mirror=1);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.wi-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2,mirror=1);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}.wi-darksky-clear-day:before{content:"\f00d"}.wi-darksky-clear-night:before{content:"\f02e"}.wi-darksky-rain:before{content:"\f019"}.wi-darksky-snow:before{content:"\f01b"}.wi-darksky-sleet:before{content:"\f0b5"}.wi-darksky-wind:before{content:"\f050"}.wi-darksky-fog:before{content:"\f014"}.wi-darksky-cloudy:before{content:"\f013"}.wi-darksky-partly-cloudy-day:before{content:"\f002"}.wi-darksky-partly-cloudy-night:before{content:"\f086"}.wi-darksky-hail:before{content:"\f015"}.wi-darksky-thunderstorm:before{content:"\f01e"}.wi-darksky-tornado:before{content:"\f056"}.wi-owm-01d:before{content:"\f00d"}.wi-owm-02d:before{content:"\f00c"}.wi-owm-03d:before{content:"\f002"}.wi-owm-04d:before{content:"\f013"}.wi-owm-09d:before{content:"\f017"}.wi-owm-10d:before{content:"\f019"}.wi-owm-11d:before{content:"\f01e"}.wi-owm-13d:before{content:"\f01b"}.wi-owm-50d:before{content:"\f014"}.wi-owm-01n:before{content:"\f02e"}.wi-owm-02n:before{content:"\f081"}.wi-owm-03n:before{content:"\f07e"}.wi-owm-04n:before{content:"\f086"}.wi-owm-09n:before{content:"\f026"}.wi-owm-10n:before{content:"\f028"}.wi-owm-11n:before{content:"\f02c"}.wi-owm-13n:before{content:"\f02a"}.wi-owm-50n:before{content:"\f04a"}.wi-wu-chanceflurries:before{content:"\f064"}.wi-wu-chancerain:before{content:"\f019"}.wi-wu-chancesleet:before{content:"\f0b5"}.wi-wu-chancesnow:before{content:"\f01b"}.wi-wu-chancetstorms:before{content:"\f01e"}.wi-wu-clear:before{content:"\f00d"}.wi-wu-cloudy:before{content:"\f002"}.wi-wu-flurries:before{content:"\f064"}.wi-wu-fog:before{content:"\f014"}.wi-wu-hazy:before{content:"\f0b6"}.wi-wu-mostlycloudy:before{content:"\f002"}.wi-wu-mostlysunny:before{content:"\f00d"}.wi-wu-partlycloudy:before{content:"\f002"}.wi-wu-partlysunny:before{content:"\f00d"}.wi-wu-rain:before{content:"\f01a"}.wi-wu-sleet:before{content:"\f0b5"}.wi-wu-snow:before{content:"\f01b"}.wi-wu-sunny:before{content:"\f00d"}.wi-wu-tstorms:before{content:"\f01e"}.wi-wu-nt_chanceflurries:before{content:"\f067"}.wi-wu-nt_chancerain:before{content:"\f028"}.wi-wu-nt_chancesleet:before{content:"\f0b4"}.wi-wu-nt_chancesnow:before{content:"\f02a"}.wi-wu-nt_chancetstorms:before{content:"\f02d"}.wi-wu-nt_clear:before{content:"\f02e"}.wi-wu-nt_flurries:before{content:"\f067"}.wi-wu-nt_fog:before{content:"\f04a"}.wi-wu-nt_hazy:before{content:"\f07e"}.wi-wu-nt_mostlycloudy:before{content:"\f081"}.wi-wu-nt_mostlysunny:before{content:"\f02e"}.wi-wu-nt_partlycloudy:before{content:"\f081"}.wi-wu-nt_partlysunny:before{content:"\f086"}.wi-wu-nt_rain:before{content:"\f028"}.wi-wu-nt_sleet:before{content:"\f0b4"}.wi-wu-nt_snow:before{content:"\f02a"}.wi-wu-nt_sunny:before{content:"\f02e"}.wi-wu-nt_tstorms:before{content:"\f02d"}.wi-wu-nt_cloudy:before{content:"\f031"}
Loading…
Cancel
Save