From dd8ef10ec642c638875fe51882adeba2345e8d6f Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 23 Nov 2017 22:00:58 +0000 Subject: [PATCH] Fix map base root to Close #28 --- README.md | 2 ++ package.json | 2 +- worldmap.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a6aef70..61ecd6f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ map web page for plotting "things" on. ![Map Image](https://dceejay.github.io/pages/images/redmap.png) ### Changes + - v1.1.7 - extend path correctly - Issue #28 + - v1.1.6 - cleanup/remove excess logging - v1.1.5 - add ttl property to set expiry time (secs) of individual marker, and let command clear:"layername" delete a complete layer. - v1.1.4 - Let layer control be visible or not - v1.1.3 - more typos. diff --git a/package.json b/package.json index 2a578eb..45df75e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-contrib-web-worldmap", - "version" : "1.1.6", + "version" : "1.1.7", "description" : "A Node-RED node to provide a web page of a world map for plotting things on.", "dependencies" : { "express": "^4.15.0", diff --git a/worldmap.js b/worldmap.js index eaa6a63..bec58b5 100644 --- a/worldmap.js +++ b/worldmap.js @@ -26,7 +26,7 @@ module.exports = function(RED) { if (!socket) { var fullPath = path.posix.join(RED.settings.httpNodeRoot, 'worldmap', 'leaflet', 'sockjs.min.js'); socket = sockjs.createServer({sockjs_url:fullPath, log:function() {}, transports:"xhr-polling"}); - socket.installHandlers(RED.server, {prefix:'/worldmap/socket'}); + socket.installHandlers(RED.server, {prefix:path.posix.join(RED.settings.httpNodeRoot,'/worldmap/socket')}); } this.lat = n.lat || ""; this.lon = n.lon || ""; @@ -93,7 +93,7 @@ module.exports = function(RED) { RED.nodes.createNode(this,n); if (!socket) { var fullPath = path.posix.join(RED.settings.httpNodeRoot, 'worldmap', 'leaflet', 'sockjs.min.js'); - socket = sockjs.createServer({sockjs_url:fullPath, prefix:'/worldmap/socket'}); + socket = sockjs.createServer({sockjs_url:fullPath, prefix:path.posix.join(RED.settings.httpNodeRoot,'/worldmap/socket')}); socket.installHandlers(RED.server); } var node = this;