add raw fa-icons

un-“fix” web socket
This commit is contained in:
Dave Conway-Jones 2017-07-12 17:59:56 +01:00
parent b7d4c0d999
commit a3ee1beba9
No known key found for this signature in database
GPG Key ID: 81B04231572A9A2D
6 changed files with 26 additions and 7 deletions

View File

@ -7,6 +7,7 @@ map web page for plotting "things" on.
![Map Image](https://dceejay.github.io/pages/images/redmap.png)
### Changes
- v1.0.33 - Add fa-icon without marker
- v1.0.32 - Add uav icon, update README
- v1.0.31 - Add arrow and wind icons
- v1.0.32 - Add uav icon
@ -63,7 +64,9 @@ Optional properties include
Any other `msg.payload` properties will be added to the icon popup text box.
You may select any of the Font Awesome set of [icons](http://fortawesome.github.io/Font-Awesome/icons/).
However there are several specials...
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 it's own.
There are also several special icons...
- **plane** : a plane icon that aligns with the bearing of travel.
- **ship** : a ship icon that aligns with the bearing of travel.
@ -176,7 +179,9 @@ To add a new base layer
};
To add an Image Overlay
var imageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];
msg.payload = { command : {lat:40.74, lon:-74.175, zoom:13 } };
msg.payload.command.map = {
overlay:"New York Historical",
url:'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',

View File

@ -1,10 +1,10 @@
{
"name" : "node-red-contrib-web-worldmap",
"version" : "1.0.32",
"version" : "1.0.33",
"description" : "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies" : {
"express": "^4.15.0",
"socket.io": "^1.7.3",
"socket.io": "^1.7.4",
"cgi": "0.3.1"
},
"repository" : {

View File

@ -64,6 +64,7 @@
<label for="node-input-name"><i class="fa fa-file"></i> Name</label>
<input type="text" id="node-input-name" placeholder="name">
</div>
<div class="form-tips">Tip: By default <code>ctrl-shift-m</code> will load the map in a new tab.</div>
</script>
<script type="text/x-red" data-help-name="worldmap">

View File

@ -72,8 +72,8 @@ module.exports = function(RED) {
});
}
node.on("close", function() {
socket.close();
socket = null;
// socket.close();
// socket = null;
});
node.status({});
socket.on('connection', callback);
@ -83,7 +83,10 @@ module.exports = function(RED) {
var WorldMapIn = function(n) {
RED.nodes.createNode(this,n);
if (!socket) { socket = io.listen(RED.server); }
if (!socket) {
var fullPath = path.posix.join(RED.settings.httpNodeRoot, 'worldmap', 'socket.io');
socket = io.listen(RED.server, {path:fullPath});
}
var node = this;
var callback = function(client) {

View File

@ -829,6 +829,7 @@ function setMarker(data) {
// Create the icons... handle plane, car, ship, wind, earthquake as specials
var marker, mymarker;
var icon, q;
//console.log("ICON",data.icon);
if (data.icon === "ship") {
marker = L.boatMarker(ll, {
title: data.name,
@ -960,6 +961,15 @@ function setMarker(data) {
else if (data.icon === "earthquake") {
marker = L.marker(ll, { icon: L.divIcon({ className: 'circle e', iconSize: [data.mag*5, data.mag*5] }), title: data.name });
}
else if (data.icon.substr(0,3) === "fa-") {
var col = data.iconColor || "#910000";
myMarker = L.divIcon({
className: data.icon,
html: '<i class="fa fa-2x '+data.icon+'" style="color:'+col+'"></i>',
iconSize: [32, 32]
});
marker = L.marker(ll, {title:data.name, icon:myMarker});
}
else {
myMarker = L.VectorMarkers.icon({
icon: data.icon || "circle",

View File

@ -1,5 +1,5 @@
CACHE MANIFEST
# date: Jun 27th 2017 - v1.0.32
# date: Jul 12th 2017 - v1.0.33
CACHE:
index.html