2016-05-19 06:26:08 +08:00
|
|
|
<!DOCTYPE html>
|
2016-04-01 18:31:07 +08:00
|
|
|
<!--
|
2016-05-19 06:26:08 +08:00
|
|
|
Copyright 2015, 2016 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">
|
|
|
|
<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">
|
|
|
|
<p>Plots "things" on a web map. Needs an internet connection.</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>
|
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>
|
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>
|
2016-04-18 23:57:31 +08:00
|
|
|
<p>Icons of type <i>plane</i>, <i>ship</i> or <i>car</i> will use built in SVG icons that align to the
|
2016-04-01 18:31:07 +08:00
|
|
|
<code>bearing</code> value.</p>
|
2016-06-06 01:37:17 +08:00
|
|
|
<p>There are some <a href="https://www.npmjs.com/package/node-red-contrib-web-worldmap" target="_new">extra commands</a>
|
|
|
|
for drawing <b>lines</b> and <b>areas</b>, and to <b>add layers</b> and to <b>control</b> the map remotely.</p>
|
2016-04-01 18:31:07 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('worldmap',{
|
|
|
|
category: 'location',
|
|
|
|
color:"darksalmon",
|
|
|
|
defaults: {
|
|
|
|
name: {value:""}
|
|
|
|
},
|
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).';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</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>
|