This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
world map
#1
i am tring to get worldmap working
i have 3 functions two getting gps cords from the example websocket that is installed and one to combind the two. the problem is on the message, it  returns lat for both lat lon then the second message it shows lon for both..

msg.payload : Object
object
name: "MyBoat"
lat: 28.***********
lon: 28.***********
icon: "ship"
iconColor: "red"
8/2/2017, 10:46:11 AMnode: 5f6bc82c.0ae8b8

msg.payload : Object
object
name: "MyBoat"
lat: -80.******
lon: -80.******
icon: "ship"
iconColor: "red"
8/2/2017, 10:46:12 AMnode: 5f6bc82c.0ae8b8

first function ..
var lat= msg.payload;
msg.payload = lat;
return msg;

 then same for lon.
the function to wold map .

var name= "MyBoat";
var lat= msg.payload,lat;
var lon= msg.payload,lon;

var map={
name,
lat,
lon,
icon:"ship",
iconColor:"red",
};
msg.payload = map;
return msg;

flow
Code:
[{"id":"51ce9625.f8d018","type":"function","z":"217cab7.d842f54","name":"lat","func":"\nvar lat= msg.payload;\nmsg.payload = lat;\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":500,"wires":[["967072ff.f978f"]]},{"id":"5f6bc82c.0ae8b8","type":"debug","z":"217cab7.d842f54","name":"","active":false,"console":"false","complete":"payload","x":650,"y":580,"wires":[]},{"id":"d985d20b.38da3","type":"function","z":"217cab7.d842f54","name":"lon","func":"\nvar lon= msg.payload;\n\nmsg.payload = lon;\n\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":540,"wires":[["967072ff.f978f"]]},{"id":"967072ff.f978f","type":"function","z":"217cab7.d842f54","name":"return","func":"\nvar name= \"MyBoat\";\nvar lat= msg.payload,lat;\nvar lon= msg.payload,lon;\n\nvar map={\nname,\nlat,\nlon,\nicon:\"ship\",\niconColor:\"red\",\n};\nmsg.payload = map;\nreturn msg;","outputs":"1","noerr":0,"x":450,"y":520,"wires":[["fb529491.2b5f08","5f6bc82c.0ae8b8"]]},{"id":"fb529491.2b5f08","type":"worldmap","z":"217cab7.d842f54","name":"map","lat":"28.56","lon":"-80.80","zoom":"10","layer":"Esri Ocean","cluster":"10","maxage":"","usermenu":"show","panit":"true","x":630,"y":520,"wires":[]}]


any help would be greatly appreciated 
Thanks
Jim
Reply


Messages In This Thread
world map - by jim321 - 2017-08-04, 10:19 AM
RE: world map - by PaddyB - 2017-08-04, 01:03 PM
RE: world map - by jim321 - 2017-08-04, 01:38 PM
RE: world map - by PaddyB - 2017-08-04, 01:46 PM
RE: world map - by jim321 - 2017-08-04, 01:57 PM
RE: world map - by PaddyB - 2017-08-04, 02:45 PM
RE: world map - by jim321 - 2017-08-04, 04:23 PM
RE: world map - by PaddyB - 2017-08-04, 04:27 PM
RE: world map - by jim321 - 2017-08-04, 04:40 PM
RE: world map - by jim321 - 2017-08-21, 02:34 PM
RE: world map - by dione - 2018-06-20, 08:08 PM
RE: world map - by jim321 - 2018-06-21, 02:33 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)