forked from kazuhitoyokoi/node-red-wasm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ba1fb6
commit 4f3544b
Showing
8 changed files
with
122 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> | ||
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> | ||
</head> | ||
<body> | ||
<div id="map" style="width: 100%; height: 100%;"></div> | ||
<script src="./wasm_exec.js"></script> | ||
<script> | ||
(async () => { | ||
const go = new Go(); | ||
const { instance } = await WebAssembly.instantiateStreaming( | ||
fetch('bus.wasm'), | ||
go.importObject | ||
); | ||
await go.run(instance); | ||
})(); | ||
async function run() { | ||
console.clear(); | ||
await go.run(inst); | ||
inst = await WebAssembly.instantiate() | ||
} | ||
</script> | ||
<script> | ||
var map = L.map('map'); | ||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map); | ||
map.setView([35.3386861, 139.4870951], 7); | ||
alert("msgData1"); | ||
function debug(msgData) { | ||
var msg = JSON.parse(msgData); | ||
alert(msg); | ||
//map.setView([msg.latitude, msg.longitude]); | ||
//L.marker([msg.latitude, msg.longitude],{"color": "#910000"}).addTo(map); | ||
for (var i = 0; i < msg.length; i++) { | ||
//map.setView([msg.latitude, msg.longitude]); | ||
L.marker([msg[i].stop_lat, msg[i].stop_lon],{"color": "#910000"}).addTo(map); | ||
} | ||
} | ||
</script> | ||
</body> | ||
</html> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
[ | ||
{ | ||
"id": "8740d4c87aa226d5", | ||
"type": "http request", | ||
"z": "506a7e799b8b8c67", | ||
"name": "", | ||
"method": "GET", | ||
"ret": "obj", | ||
"paytoqs": "ignore", | ||
"url": "https://kazuhitoyokoi.github.io/ogiri-bus-api/bus.json", | ||
"tls": "", | ||
"persist": false, | ||
"proxy": "", | ||
"insecureHTTPParser": false, | ||
"authType": "", | ||
"senderr": false, | ||
"headers": [], | ||
"x": 390, | ||
"y": 120, | ||
"wires": [ | ||
[ | ||
"9ae96b81d3eb6fe2" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "7d5ef118b8c6f3cb", | ||
"type": "inject", | ||
"z": "506a7e799b8b8c67", | ||
"name": "", | ||
"props": [ | ||
{ | ||
"p": "payload" | ||
}, | ||
{ | ||
"p": "topic", | ||
"vt": "str" | ||
} | ||
], | ||
"repeat": "1", | ||
"crontab": "", | ||
"once": false, | ||
"onceDelay": 0.1, | ||
"topic": "", | ||
"payload": "", | ||
"payloadType": "date", | ||
"x": 210, | ||
"y": 120, | ||
"wires": [ | ||
[ | ||
"8740d4c87aa226d5" | ||
] | ||
] | ||
}, | ||
{ | ||
"id": "9ae96b81d3eb6fe2", | ||
"type": "debug", | ||
"z": "506a7e799b8b8c67", | ||
"name": "debug 1", | ||
"active": true, | ||
"tosidebar": true, | ||
"console": false, | ||
"tostatus": false, | ||
"complete": "false", | ||
"statusVal": "", | ||
"statusType": "auto", | ||
"x": 560, | ||
"y": 120, | ||
"wires": [] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters