add more mapserver info to readme and bump for weblink PR

This commit is contained in:
Dave Conway-Jones 2021-03-07 17:07:47 +00:00
parent cfb9d96215
commit 67e6970795
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
4 changed files with 35 additions and 9 deletions

View File

@ -1,5 +1,7 @@
### Change Log for Node-RED Worldmap ### Change Log for Node-RED Worldmap
- v2.9.0 - Let weblinks be an array of links. Add more info to readme about Mapservers.
- v2.8.9 - Only load cgi module if we have a local mapserv file
- v2.8.8 - Change length of speed leader to show where you will be in 1 min if speed in m/s - v2.8.8 - Change length of speed leader to show where you will be in 1 min if speed in m/s
- v2.8.7 - Delay start of ui widget. - v2.8.7 - Delay start of ui widget.
- v2.8.6 - Better checking of type property before guessing it's geojson. Issue #153 - v2.8.6 - Better checking of type property before guessing it's geojson. Issue #153

View File

@ -11,7 +11,9 @@ map web page for plotting "things" on.
### Updates ### Updates
- v2.8.8 - Change length of speed leader to show where you will be in 1 min if speed in m/s - v2.9.0 - Let weblinks be an array of links. Add more info to readme about Mapservers.
- v2.8.9 - Only load cgi module if we have a local mapserv file.
- v2.8.8 - Change length of speed leader to show where you will be in 1 min if speed in m/s.
- v2.8.7 - Delay start of ui widget. - v2.8.7 - Delay start of ui widget.
- v2.8.6 - Better checking of type property before guessing it's geojson. Issue #153 - v2.8.6 - Better checking of type property before guessing it's geojson. Issue #153
- v2.8.4 - Add addToForm(n,v) option and $form - to make contextmenu form submission easier. - v2.8.4 - Add addToForm(n,v) option and $form - to make contextmenu form submission easier.
@ -629,13 +631,29 @@ You can then add a new WMS Base layer by injecting a message like
"wms": true // set to true for WMS type mapserver "wms": true // set to true for WMS type mapserver
}}} }}}
Optionally set `"wms":"grey"` to set the layer to greyscale which may make your markers more visible.
**Hint**: if can use a docker container like https://hub.docker.com/r/geodata/mapserver/ then assuming you have the mapfile 'my-app.map' in the current working directory, you could mount it as: #### Using a Docker Map Server
You can use a docker continaer like https://hub.docker.com/r/camptocamp/mapserver, then assuming you have the mapfile 'my-app.map' in the current working directory, you could mount it as:
``` ```
docker run -d --name mapserver -v $(pwd):/maps:ro -p 1881:80 geodata/mapserver docker run -d --name camptocamp -v $(pwd):/etc/mapserver/:ro -p 1881:80 camptocamp/mapserver
``` ```
then the url should be of the form `"url": "http://localhost:1881/?map=/maps/my-app.map",` where *my-app.map* is the name of your map file. A quick test of the server would be to browse to http://localhost:1881/?map=/maps/my-app.map&mode=map and use a url like `"url": "http://localhost:1882/?map=/etc/mapserver/my-app.map"`
then the url should be of the form `"url": "http://localhost:1881/?map=/etc/mapserver/my-app.map"` where *my-app.map* is the name of your map file. A quick test of the server would be to browse to http://localhost:1881/?map=/etc/mapserver/my-app.map&mode=map
Or you can use a docker container like https://hub.docker.com/r/geodata/mapserver/ then assuming you have the mapfile 'my-app.map' in the current working directory, you could mount it as:
```
docker run -d --name mapserver -v $(pwd):/maps:ro -p 1882:80 geodata/mapserver
```
and use a url like `"url": "http://localhost:1882/?map=/maps/my-app.map",`
To use a vector mbtiles server like **MapTiler** then you can download your mbtiles file into a directory and then from that directory run
```
docker run --name maptiler -d -v $(pwd):/data -p 1884:8080 maptiler/tileserver-gl -p 8080
```
and use a url like `"url": "http://localhost:1884/styles/basic-preview/{z}/{x}/{y}.png"`
## Examples and Demo Flow ## Examples and Demo Flow

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-contrib-web-worldmap", "name": "node-red-contrib-web-worldmap",
"version": "2.8.8", "version": "2.9.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": {
"cgi": "0.3.1", "cgi": "0.3.1",
@ -9,7 +9,10 @@
"sockjs": "~0.3.21" "sockjs": "~0.3.21"
}, },
"bundledDependencies": [ "bundledDependencies": [
"cgi","compression","express","sockjs" "cgi",
"compression",
"express",
"sockjs"
], ],
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -17,14 +17,17 @@
module.exports = function(RED) { module.exports = function(RED) {
"use strict"; "use strict";
var fs = require('fs');
var path = require("path"); var path = require("path");
var express = require("express"); var express = require("express");
var compression = require("compression"); var compression = require("compression");
var sockjs = require('sockjs'); var sockjs = require('sockjs');
var sockets = {}; var sockets = {};
RED.log.info("Worldmap version " + require('./package.json').version ); RED.log.info("Worldmap version " + require('./package.json').version );
// add the cgi module for serving local maps.... // add the cgi module for serving local maps.... only if mapserv exists
RED.httpNode.use("/cgi-bin/mapserv", require('cgi')(__dirname + '/mapserv')); if (fs.existsSync((__dirname + '/mapserv'))) {
RED.httpNode.use("/cgi-bin/mapserv", require('cgi')(__dirname + '/mapserv'));
}
function worldMap(node, n) { function worldMap(node, n) {
RED.nodes.createNode(node,n); RED.nodes.createNode(node,n);