-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhere-routing.html
147 lines (141 loc) · 6.24 KB
/
here-routing.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<script type="text/javascript">
RED.nodes.registerType("hereapikey", {
category: "config",
defaults: {
name: {value:"", required: false}
},
credentials: {
apikey: {type: "password"}
},
label: function() {
return this.name;
}
});
</script>
<script type="text/x-red" data-template-name="hereapikey">
<div class="form-tips">
<p>Register at <a href="https://developer.here.com" target="_new">developer.here.com</a> for a HERE API Key.
</div>
<div class="form-row">
<label for="node-config-input-apikey"><i class="fa fa-key"></i> API Key</label>
<input type="password" id="node-config-input-apikey">
</div>
<div class="form-row">
<label for="node-config-input-name"><i class="fa fa-tag"></i> Config Name</label>
<input type="text" id="node-config-input-name">
</div>
</script>
<script type="text/x-red" data-help-name="hereapikey">
<p>Enter the API Key assigned from HERE.com<br />
<ul>
<li>Register for a <a href="https://developer.here.com" target="_new">developer.here.com</a> API key.
</ul>
</script>
<script type="text/javascript">
RED.nodes.registerType('here-routing',{
category: 'location',
color: "#FFD700",
icon: "font-awesome/fa-map-marker",
inputs:1,
outputs:1,
defaults: {
name: { value:""},
waypoint0: {value:""},
waypoint1: {value:""},
calctype: {value:"fastest"},
transport: {value:"car"},
traffic: {value:"default"},
apikey: {value:"", type:"hereapikey",required: true}
},
label: function() {
return this.name||"HERE Calculate Route";
}
});
</script>
<script type="text/x-red" data-template-name="here-routing">
<div class="form-row">
<label for="node-input-apikey"><i class="fa fa-key"></i> API Key</label>
<input type="text" id="node-input-apikey">
</div>
<div class="form-row">
<label for="node-input-waypoint0"><i class="fa fa-globe"></i> Starting waypoint</label>
<input type="text" id="node-input-waypoint0" placeholder="40.74,-73.99">
</div>
<div class="form-row">
<label for="node-input-waypoint1"><i class="fa fa-globe"></i> Ending waypoint</label>
<input type="text" id="node-input-waypoint1" placeholder="40.74,-73.99">
</div>
<div class="form-row">
<label for="node-input-calctype"><i class="fa fa-globe"></i> Calculation</label>
<select id="node-input-calctype">
<option value="fastest">Fastest</option>
<option value="shortest">Shortest</option>
<option value="balanced">Balanced</option>
</select>
</div>
<div class="form-row">
<label for="node-input-transport"><i class="fa fa-globe"></i> Transport Mode</label>
<select id="node-input-transport">
<option value="car">Car</option>
<option value="pedestrian">Pedestrian</option>
<option value="carHOV">HOV car</option>
<option value="publicTransport">Public Transport</option>
<option value="publicTransportTimeTable">Public Transport Timetable</option>
<option value="truck">Truck</option>
<option value="bicycle">Bicycle</option>
</select>
</div>
<div class="form-row">
<label for="node-input-traffic"><i class="fa fa-globe"></i> Traffic</label>
<select id="node-input-traffic">
<option value="enabled">Enabled</option>
<option value="disabled">Disabled</option>
<option value="default">Default</option>
</select>
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name">
</div>
</script>
<script type="text/x-red" data-help-name="here-routing">
<p>Calculate directions for private transport between two locations.
<p>Calculate directions for private transport between two locations by providing the starting/ending waypoints and routing modes.
<p>See the <a target="_blank" href="https://www.here.com/docs/bundle/routing-api-developer-guide-v8/page/README.html">online documentation</a>
for more information about the <strong>HERE Calculate Route API</strong>.</p>
<h3>Inputs:</h3>
<dl class="message-properties">
<dt class="optional">msg.hereparams.waypoint0 <span class="property-type">string</span></dt>
<dt class="optional">msg.hereparams.waypoint1 <span class="property-type">string</span></dt>
<dt class="optional">msg.hereparams.routetype <span class="property-type">string</span></dt>
<dd>If specified, override edit panel.</dd>
<dd>Routing Type relevant to calculation.</dd>
<dd>"fastest" - Route calculation from start to destination optimized by travel time.</dd>
<dd>"shortest" - Route calculation from start to destination disregarding any speed information.</dd>
<dd>"balanced" - Route calculation from start to destination optimizing based on combination of travel time and distance.</dd>
<dt class="optional">msg.hereparams.transport <span class="property-type">string</span></dt>
<dd>If specified, override edit panel.</dd>
<dd>Transportation mode:</dd>
<dd>car - Route calculation for cars.</dd>
<dd>carHOV - Route calculation for HOV (high-occupancy vehicle) cars.</dd>
<dd>pedestrian - Route calculation for a pedestrian.</dd>
<dd>publicTransport - Route calculation using public transport lines.</dd>
<dd>publicTransportTimeTable - Route calculation using public transport lines using additional officially published timetable info.</dd>
<dd>truck - Route calculation for trucks.</dd>
<dd>bicycle - Route calculation for bicycles.</dd>
<dt class="optional">msg.hereparams.traffic <span class="property-type">string</span></dt>
<dd>If specified, override edit panel.</dd>
<dd>Traffic Mode</dd>
<dd>"enabled"</dd>
<dd>"disabled"</dd>
<dd>"default"</dd>
</dl>
<h3>Outputs:</h3>
<dl class="message-properties">
<dt class="optional">msg.payload.response <span class="property-type">object</span></dt>
<dd>Array of json objects containing calculated route data</dd>
<dd>Find details on the <a target="_blank" href="https://developer.here.com/documentation/routing/dev_guide/topics/resource-type-calculate-route.html">Calculate Route Response Type</a> data elements and definitions.</dd>
<dt class="optional">msg.hereparams <span class="property-type">object</span></dt>
<dd>Array of json objects containing request parameters</dd>
</dl>
</script>