From 3fa4992113d22eb1836e3344310ecee39c2718e6 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sat, 16 Feb 2019 17:40:28 +0000 Subject: [PATCH] Add more side bar info --- README.md | 124 ++++++++++++++++++++++++-------------------- worldmap.html | 20 +++++-- worldmap/index.html | 2 +- 3 files changed, 86 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index af053e2..a7b6033 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,14 @@ Either use the Manage Palette option in the Node-RED Editor menu, or run the fol ## Usage -Plots "things" on a map. By default the map will be served from `{httpRoot}/worldmap` +Plots "things" on a map. By default the map will be served from `{httpRoot}/worldmap`, but this +can be configured in the configuration panel. Use keyboard shortcut `⌘⇧m`, `ctrl-shift-m` to jump to the map. The minimum **msg.payload** must contain `name`, `lat` and `lon` properties, e.g. - msg.payload = { name:"Jason", lat:51.05, lon:-1.35 } + msg.payload = { "name":"Jason", "lat":51.05, "lon":-1.35 } `name` must be a unique identifier across the whole map. Repeated location updates to the same `name` move the marker. @@ -57,25 +58,26 @@ Optional properties include - **deleted** : set to true to remove the named marker. (default false) - **draggable** : set to true to allow marker to be moved. (default false) - **layer** : specify a layer on the map to add marker to. (default unknown) - - **speed** : combined with bearing, draws a vector. - - **bearing** : combined with speed, draws a vector. - - **accuracy** : combined with bearing, draws a polygon of possible direction. + - **speed** : when combined with bearing, draws a vector. + - **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** : font awesome icon name, or :emoji name: - **iconColor** : Standard CSS colour name or #rrggbb hex value. - - **SIDC** : NATO symbology code (instead of icon). See below. + - **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. - **ttl** : time to live, how long an individual marker stays on map in seconds (overrides general maxage setting, minimum 20 seconds) - **photoUrl** : adds an image pointed at by the url to the popup box. - **videoUrl** : adds an mp4 video pointed at by the url to the popup box. Ideally 320x240 in size. - - **weblink** : adds a link to an external page for more information. Either set a url as a *string*, or an *object* like `{name:"BBC News", url:"http://news.bbc.co.uk", target:"_new"}` - - **addtoheatmap** : set to false to exclude point from contributing to heatmap layer. (default true) - - **intensity** : set to a value of 0.1 - 1.0 to set the intensity of the point on heatmap layer. (default 1.0) + - **weblink** : adds a link to an external page for more information. Either set a url as a *string*, or an *object* like `{"name":"BBC News", "url":"http://news.bbc.co.uk", "target":"_new"}` + - **addtoheatmap** : set to false to exclude point from contributing to the heatmap layer. (default true) + - **intensity** : set to a value of 0.1 - 1.0 to set the intensity of the point on the heatmap layer. (default 1.0) - **popped** : set to true to automatically open the popup info box, set to false to close it. - **popup** : html to fill the popup if you don't want the automatic default of the properties list. - **label** : displays the contents of label next to the icon. -Any other `msg.payload` properties will be added to the icon popup text box. +Any other `msg.payload` properties will be added to the icon popup text box. This can be overridden +by using the **popup** property to supply your own html content. ### Icons @@ -119,9 +121,10 @@ There are lots of extra options you can specify as `msg.options` - see the Leaflet geojson docs for more info on possible options. Note: only simple options are supported as functions cannot be serialised. The `fit` property is optional. If present the map will automatically zoom to fit the area relevant to the geojson. + see http://leafletjs.com/examples/geojson/ for more details about options for opt. #### To add a new KML, GPX, or TOPOJSON overlay @@ -332,13 +344,13 @@ see http://leafletjs.com/examples/geojson/ for more details about options for op As per the geojson overlay you can also inject a KML layer, GPX layer or TOPOJSON layer. The syntax is the same but with either a `kml` property containing the KML string - a `gpx` property containing a GPX string - or a `topojson` property containing the topojson. msg.payload.command.map = { - overlay:"myKML", - kml:"...your kml placemarks..." + overlay: "myKML", + kml: "...your kml placemarks..." }; - For GPX and KML layers, it is possible to define which icon to use for point markers by adding the following properties to `msg.payload.command.map`: + - **icon** : font awesome icon name. - **iconColor** : Standard CSS colour name or #rrggbb hex value. @@ -347,7 +359,7 @@ Again the `fit` property can be added to make the map zoom to the relevant area. #### To add a Velocity Grid Overlay msg.payload.command.map = { - overlay:"myWind", + overlay: "myWind", velocity: { displayValues: true, displayOptions: { @@ -367,10 +379,10 @@ see https://github.com/danwild/leaflet-velocity for more details about options a 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', + overlay: "New York Historical", + url: 'http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg', bounds: imageBounds, - opt:{ opacity:1.0, attribution:"© University of Texas" } + opt: { opacity:1.0, attribution:"© University of Texas" } }; #### To clear a layer from the map diff --git a/worldmap.html b/worldmap.html index d6ab02a..ca5b53f 100644 --- a/worldmap.html +++ b/worldmap.html @@ -98,7 +98,7 @@ then by default ⌘⇧m - ctrl-shift-m will load the m path. Worldmap-in nodes are matched to worldmap nodes by having exactly the same path.

Shortcut - ⌘⇧m - ctrl-shift-m to jump to the default Map (/worldmap).

The minimum msg.payload must contain name, lat and lon properties, e.g.

-
{name:"Joe", lat:51, lon:-1.05}
+
{"name":"Joe", "lat":51, "lon":-1.05}

name must be a unique identifier.

Optional properties include