2016-05-19 06:26:08 +08:00
|
|
|
<!DOCTYPE html>
|
2016-04-01 18:31:07 +08:00
|
|
|
<!--
|
2017-05-03 02:46:48 +08:00
|
|
|
Copyright 2015, 2017 IBM Corp.
|
2016-04-01 18:31:07 +08:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<script type="text/x-red" data-template-name="worldmap">
|
2016-06-12 19:40:29 +08:00
|
|
|
<div class="form-row">
|
|
|
|
<table border="0" width="96%">
|
|
|
|
<tr><td width="100px"><i class="fa fa-globe"></i> Start<td>Latitude</td><td>Longitude</td><td width="60px">Zoom</td></tr>
|
|
|
|
<tr><td> </td>
|
|
|
|
<td><input type="text" id="node-input-lat" style="width:90px;"></td>
|
|
|
|
<td><input type="text" id="node-input-lon" style="width:90px;"></td>
|
|
|
|
<td><input type="text" id="node-input-zoom" style="width:60px;" placeholder="1 - 18"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-layer"><i class="fa fa-map"></i> Base map</label>
|
|
|
|
<select id="node-input-layer">
|
|
|
|
<option value="OSM grey">OpenStreetMap Greyscale</option>
|
|
|
|
<option value="OSM">OpenStreetMap</option>
|
|
|
|
<option value="Esri">ESRI Streetmap</option>
|
|
|
|
<option value="Esri Satellite">ESRI Satellite</option>
|
|
|
|
<option value="Esri Terrain">ESRI Terrain</option>
|
|
|
|
<option value="Esri Ocean">ESRI Ocean</option>
|
|
|
|
<option value="Mapsurfer">Mapsurfer</option>
|
|
|
|
<option value="MapQuest OSM">MapQuest OSM</option>
|
|
|
|
<option value="Nat Geo">National Geographic</option>
|
|
|
|
<option value="UK OS Opendata">UK OS Opendata</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2016-06-15 19:57:31 +08:00
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-cluster"><i class="fa fa-gears"></i> Cluster at</label>
|
2016-11-22 16:21:56 +08:00
|
|
|
zoom levels less than <input type="text" id="node-input-cluster" placeholder="10 (0-19)" style="width:70px;">
|
2016-06-15 19:57:31 +08:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2016-11-22 16:21:56 +08:00
|
|
|
<label for="node-input-maxage"><i class="fa fa-clock-o"></i> Max age</label>
|
|
|
|
Remove markers after <input type="text" id="node-input-maxage" style="width:67px;"> seconds
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2017-10-11 06:51:18 +08:00
|
|
|
<label for="node-input-usermenu"><i class="fa fa-user"></i> User menu</label>
|
2016-11-22 16:21:56 +08:00
|
|
|
<select id="node-input-usermenu" style="width:70px;">
|
|
|
|
<option value="show">Show</option>
|
|
|
|
<option value="hide">Hide</option>
|
|
|
|
</select>
|
2017-10-11 06:51:18 +08:00
|
|
|
<i class="fa fa-bars" style="margin-left:30px;"></i> Layer menu
|
|
|
|
<select id="node-input-layers" style="width:70px;">
|
|
|
|
<option value="show">Show</option>
|
|
|
|
<option value="hide">Hide</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-panit"><i class="fa fa-arrows-alt"></i> Auto-pan</label>
|
|
|
|
<select id="node-input-panit" style="width:70px;">
|
2016-11-22 16:21:56 +08:00
|
|
|
<option value="false">False</option>
|
|
|
|
<option value="true">True</option>
|
|
|
|
</select>
|
2016-06-15 19:57:31 +08:00
|
|
|
</div>
|
2016-06-12 19:40:29 +08:00
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-name"><i class="fa fa-file"></i> Name</label>
|
|
|
|
<input type="text" id="node-input-name" placeholder="name">
|
|
|
|
</div>
|
2018-06-01 05:50:50 +08:00
|
|
|
<div class="form-tips">Tip: By default <code>⌘⇧m</code> - <code>ctrl-shift-m</code> will load the map in a new tab.</div>
|
2016-04-01 18:31:07 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/x-red" data-help-name="worldmap">
|
|
|
|
<p>Plots "things" on a web map. Needs an internet connection.</p>
|
2018-06-01 05:50:50 +08:00
|
|
|
<p>Shortcut - <code>⌘⇧m</code> - ctrl-shift-m to jump to Map.</p>
|
2016-05-19 06:26:08 +08:00
|
|
|
<p>The minimum <code>msg.payload</code> must contain <code>name</code>, <code>lat</code> and <code>lon</code> properties, e.g.</p>
|
2016-04-01 18:31:07 +08:00
|
|
|
<pre>{name:"Joe", lat:51, lon:-1.05}</pre>
|
|
|
|
<p><code>name</code> must be a unique identifier.</p>
|
|
|
|
<p>Optional properties include</p>
|
|
|
|
<ul>
|
|
|
|
<li><code>layer</code> : specify a layer on the map to add marker to.</li>
|
|
|
|
<li><code>speed</code> : combined with bearing, draws a vector.</li>
|
|
|
|
<li><code>bearing</code> : combined with speed, draws a vector.</li>
|
|
|
|
<li><code>accuracy</code> : combined with bearing, draws a polygon of possible direction.</li>
|
|
|
|
<li><code>icon</code> : <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_new">font awesome</a> icon name</li>
|
|
|
|
<li><code>iconColor</code> : standard CSS color name or #rrggbb hex value.</li>
|
2018-06-01 05:50:50 +08:00
|
|
|
<li><code>SIDC</code> : NATO symbology code (instead of icon).</li>
|
|
|
|
<li><code>bulding</code> : OSMBuildings GeoJSON object.</li>
|
|
|
|
<li><code>ttl</code> : time to live of an individual marker.</li>
|
2016-06-06 01:37:17 +08:00
|
|
|
<li><code>photoUrl</code> : adds an image pointed at by the url to the popup box.</li>
|
2018-06-01 05:50:50 +08:00
|
|
|
<li><code>videoUrl</code> : adds an mp4 (320x240) pointed at by the url to Popup box</li>
|
|
|
|
<li><code>weblink</code> : link to an external web page.</li>
|
2016-04-01 18:31:07 +08:00
|
|
|
<li><code>deleted</code> : set to <i>true</i> to remove the named marker. (default false)</li>
|
|
|
|
</ul>
|
|
|
|
<p>Any other sub-properties of <code>msg.payload</code> will be added to the icon popup text box as extra information.</p>
|
2018-06-01 05:50:50 +08:00
|
|
|
<p>Icons of type <i>plane</i>, <i>ship</i>, <i>car</i>, <i>uav</i> or <i>arrow</i> will use built in SVG icons that align to the
|
2016-04-01 18:31:07 +08:00
|
|
|
<code>bearing</code> value.</p>
|
2018-06-01 05:50:50 +08:00
|
|
|
<p>Font Awesome (fa-icons 4.7) can also be used, as can NATO symbology codes (SIDC).</p>
|
|
|
|
<p>See the <a href="https://www.npmjs.com/package/node-red-contrib-web-worldmap" target="_new">README</a> for further
|
|
|
|
details and examples of icons and commands for drawing <b>lines</b> and <b>areas</b>, and to <b>add layers</b> and
|
|
|
|
to <b>control</b> the map remotely, including how to use a local map server.</p>
|
2016-04-01 18:31:07 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2017-04-20 20:44:19 +08:00
|
|
|
var lnk = document.location.host+RED.settings.httpNodeRoot+"/worldmap";
|
|
|
|
var re = new RegExp('\/{1,}','g');
|
|
|
|
lnk = lnk.replace(re,'/');
|
|
|
|
if (!RED.hasOwnProperty("actions")) {
|
|
|
|
RED.keyboard.add("*",/* m */ 77,{ctrl:true, shift:true},function() { window.open(document.location.protocol+"//"+lnk) });
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
RED.keyboard.add("*","ctrl-shift-m","Show Map");
|
|
|
|
RED.actions.add("Show Map",function() { window.open(document.location.protocol+"//"+lnk) });
|
|
|
|
}
|
2016-04-01 18:31:07 +08:00
|
|
|
RED.nodes.registerType('worldmap',{
|
|
|
|
category: 'location',
|
|
|
|
color:"darksalmon",
|
|
|
|
defaults: {
|
2016-11-22 16:21:56 +08:00
|
|
|
name: {value:""},
|
2016-06-12 19:40:29 +08:00
|
|
|
lat: {value:""},
|
|
|
|
lon: {value:""},
|
|
|
|
zoom: {value:""},
|
|
|
|
layer: {value:""},
|
2016-06-15 19:57:31 +08:00
|
|
|
cluster: {value:""},
|
|
|
|
maxage: {value:""},
|
2016-11-22 16:21:56 +08:00
|
|
|
usermenu: {value:"show"},
|
2017-10-11 06:51:18 +08:00
|
|
|
layers: {value:"show"},
|
2016-11-22 16:21:56 +08:00
|
|
|
panit: {value:"false"}
|
2016-04-01 18:31:07 +08:00
|
|
|
},
|
2016-05-19 06:26:08 +08:00
|
|
|
inputs:1,
|
2016-04-01 18:31:07 +08:00
|
|
|
outputs:0,
|
|
|
|
icon: "white-globe.png",
|
|
|
|
align: "right",
|
|
|
|
label: function() {
|
|
|
|
return this.name||"world map";
|
|
|
|
},
|
|
|
|
labelStyle: function() {
|
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
},
|
|
|
|
info: function() {
|
|
|
|
return 'The map can be found [here]('+RED.settings.httpNodeRoot.slice(0,-1)+'/worldmap).';
|
2017-03-04 22:13:05 +08:00
|
|
|
//return 'The map can be found <a href="'+RED.settings.httpNodeRoot.slice(0,-1)+'/worldmap" target="_blank">here</a>.';
|
2016-06-15 19:57:31 +08:00
|
|
|
},
|
|
|
|
oneditprepare: function() {
|
|
|
|
$( "#node-input-zoom" ).spinner({min:0, max:18});
|
|
|
|
$( "#node-input-cluster" ).spinner({min:0, max:19});
|
2016-04-01 18:31:07 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2016-05-19 06:26:08 +08:00
|
|
|
|
|
|
|
<script type="text/x-red" data-template-name="worldmap in">
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-name"><i class="fa fa-file"></i> Name</label>
|
|
|
|
<input type="text" id="node-input-name" placeholder="name">
|
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/x-red" data-help-name="worldmap in">
|
|
|
|
<p>Receives events from a worldmap web page.</p>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('worldmap in',{
|
|
|
|
category: 'location',
|
|
|
|
color:"darksalmon",
|
|
|
|
defaults: {
|
|
|
|
name: {value:""}
|
|
|
|
},
|
|
|
|
inputs:0,
|
|
|
|
outputs:1,
|
|
|
|
icon: "white-globe.png",
|
|
|
|
label: function() {
|
|
|
|
return this.name||"world map";
|
|
|
|
},
|
|
|
|
labelStyle: function() {
|
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
},
|
|
|
|
info: function() {
|
|
|
|
return 'The map can be found [here]('+RED.settings.httpNodeRoot.slice(0,-1)+'/worldmap).';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2017-05-15 20:55:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
<script type="text/x-red" data-template-name="worldmap-tracks">
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-depth"><i class="fa fa-map-marker"></i> Number of</label>
|
|
|
|
points in track <input type="text" id="node-input-depth" style="width:50%" placeholder="number - default 20">
|
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-name"><i class="fa fa-file"></i> Name</label>
|
|
|
|
<input type="text" id="node-input-name" placeholder="name">
|
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/x-red" data-help-name="worldmap-tracks">
|
|
|
|
<p>Creates tracks lines based on a specified number of previous locations.</p>
|
|
|
|
<p>Holds all the points in memory, so if you have a lot of points held for a
|
|
|
|
large depth then memory usage may become excessive.</p>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('worldmap-tracks',{
|
|
|
|
category: 'location',
|
|
|
|
color:"darksalmon",
|
|
|
|
defaults: {
|
|
|
|
depth: {value:20},
|
|
|
|
name: {value:""}
|
|
|
|
},
|
|
|
|
inputs:1,
|
|
|
|
outputs:1,
|
|
|
|
icon: "white-globe.png",
|
|
|
|
paletteLabel: "tracks",
|
|
|
|
label: function() {
|
|
|
|
return this.name||"tracks";
|
|
|
|
},
|
|
|
|
labelStyle: function() {
|
|
|
|
return this.name?"node_label_italic":"";
|
|
|
|
},
|
|
|
|
info: function() {
|
|
|
|
return 'The map can be found [here]('+RED.settings.httpNodeRoot.slice(0,-1)+'/worldmap).';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|