That way in the majority of cases it'll pick up the correct host ip to point at...
However it does assume that you haven't also messed with the settings.js file to move the httpStatic or httpRoot away from their default locations... if so the url would need to be
here is a tweaked version of that flow (also changed to add some more locations - discussed below), and start the map somewhere in UK and at a lesser zoom level.
[{"id":"54651cc0.ab9ae4","type":"websocket-listener","path":"/ws/location","wholemsg":"false"},{"id":"3ce8dc35.c31724","type":"websocket out","name":"","server":"54651cc0.ab9ae4","x":672,"y":287,"z":"c04f6206.3fb0a","wires":[]},{"id":"a1875909.5e78a8","type":"function","name":"","func":"// The received message is stored in 'msg'\n// It will have at least a 'payload' property:\n// console.log(msg.payload);\n// The 'context' object is available to store state\n// between invocations of the function\n// context = {};\ncontext.global.location = msg.payload;\n\nreturn msg;","outputs":1,"x":475,"y":224,"z":"c04f6206.3fb0a","wires":[["3ce8dc35.c31724","3f4c5db6.c0b3a2"]]},{"id":"dced249a.2312d8","type":"websocket in","name":"","server":"54651cc0.ab9ae4","x":255,"y":351,"z":"c04f6206.3fb0a","wires":[["ae7ab97d.518548"]]},{"id":"ae7ab97d.518548","type":"function","name":"","func":"// The received message is stored in 'msg'\n// It will have at least a 'payload' property:\n// console.log(msg.payload);\n// The 'context' object is available to store state\n// between invocations of the function\n// context = {};\n\nmsg.payload = context.global.location;\nreturn msg;","outputs":1,"x":483,"y":342,"z":"c04f6206.3fb0a","wires":[["3ce8dc35.c31724"]]},{"id":"7a4c6539.85b39c","type":"template","name":"","template":"<!DOCTYPE html>\n<html>\n<head>\n <title>Owntracks & Node-Red Live Map</title>\n <script type=\"text/javascript\" src=\"
http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js\"></script>\n <script type=\"text/javascript\" src=\"
http://maps.google.com/maps/api/js?sensor=true\"></script>\n <script type=\"text/javascript\" src=\"
http://yourjavascript.com/4594301102/gmaps.js\"></script>\n \n <style type=\"text/css\" media=\"screen\">\n #map {\n position:absolute;\n top: 0; bottom: 0; left: 0; right: 0;\n }\n </style>\n</head>\n<body>\n \n <div id=\"map\"></div>\n <script type=\"text/javascript\">\n var server = window.location.hostname;\n var socketaddy = \"ws://\"+server+\":1880/admin/ws/location\";\n var map;\n var sock;\n $(document).ready(function(){\n \n map = new GMaps({\n div: '#map',\n lat: 54,\n lng: -1\n });\n \n \n sock = new WebSocket(socketaddy);\n sock.onopen = function(){ console.log(\"Connected websocket\");\n\t console.log(\"Sending ping..\");\n\t sock.send(\"Ping!\");\n\t console.log(\"Ping sent..\");\n };\n sock.onerror = function(){ console.log(\"Websocket error\"); };\n sock.onmessage = function(evt){\n var latlng = JSON.parse(evt.data);\n var array = $.map(latlng, function(el) {\n \t\t\treturn [[el.lat, el.lng]];\n\t\t\t});\n \n map.removeMarkers();\n map.removePolylines();\n \tconsole.log(\"Got marker at \" + latlng[0].lat + \", \" + latlng[0].lng, latlng);\n map.setZoom(12);\n \tmap.setCenter(latlng[0].lat, latlng[0].lng);\n map.addMarkers(latlng);\n \tmap.drawPolyline({\n\t\t path: array,\n\t\t strokeColor: '#131540',\n\t\t strokeOpacity: 0.6,\n\t\t strokeWeight: 6\n\t\t});\n }\n });\n </script>\n</body>\n</html>","x":465,"y":398,"z":"c04f6206.3fb0a","wires":[["85513d03.7aaec"]]},{"id":"85513d03.7aaec","type":"http response","name":"","x":649,"y":398,"z":"c04f6206.3fb0a","wires":[]},{"id":"ea58b789.15a748","type":"http in","name":"","url":"/map","method":"get","x":244,"y":403,"z":"c04f6206.3fb0a","wires":[["7a4c6539.85b39c"]]},{"id":"3f4c5db6.c0b3a2","type":"debug","name":"","active":true,"console":false,"complete":false,"x":617,"y":174,"z":"c04f6206.3fb0a","wires":[]},{"id":"8cd91314.7326f","type":"inject","name":"Array of Co-ords","topic":"","payload":"[{\"lat\":54.9619349,\"lng\":-1.6003813},{\"lat\":54.9656694,\"lng\":-1.5239833},{\"lat\":54.9696456,\"lng\":-1.5069755},{\"lat\":54.9378907,\"lng\":-1.5273729}]","payloadType":"string","repeat":"","crontab":"","once":false,"x":222,"y":119,"z":"c04f6206.3fb0a","wires":[["a1875909.5e78a8"]]},{"id":"d780c811.287f38","type":"inject","name":"Single Co-ord","topic":"","payload":"[{\"lat\":54.9696456,\"lng\":-1.5069755}]","payloadType":"string","repeat":"","crontab":"","once":false,"x":196,"y":173,"z":"c04f6206.3fb0a","wires":[["a1875909.5e78a8"]]},{"id":"b8a569bc.475a98","type":"inject","name":"Single Co-ord","topic":"","payload":"[{\"lat\":54.5,\"lng\":-1.5}]","payloadType":"string","repeat":"","crontab":"","once":false,"x":213,"y":219,"z":"c04f6206.3fb0a","wires":[["a1875909.5e78a8"]]},{"id":"7bc9c6c3.843638","type":"inject","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":92,"y":273,"z":"c04f6206.3fb0a","wires":[["d5598d86.2aa67"]]},{"id":"d5598d86.2aa67","type":"function","name":"create array of objects","func":"msg.payload = [{ lat:55, lng:-2 }];\nreturn msg;","outputs":1,"x":246,"y":309,"z":"c04f6206.3fb0a","wires":[["d6652fc6.299ad","4a011e0a.b5fee"]]},{"id":"d6652fc6.299ad","type":"function","name":"Stringify it","func":"msg.payload = JSON.stringify(msg.payload);\nreturn msg;","outputs":1,"x":365,"y":264,"z":"c04f6206.3fb0a","wires":[["a1875909.5e78a8"]]},{"id":"4a011e0a.b5fee","type":"debug","name":"","active":true,"console":false,"complete":false,"x":461,"y":303,"z":"c04f6206.3fb0a","wires":[]}]
The thing to note is that actually those injects are passing in strings.... not javascript objects...
So the inject node on my new node - calls a function that creates a location object... which is more likely what is going to happen... eg you would parse a GPS string into a location object... and add it to an array... so in this instance it's an array [ ] containing a single object { lat:51, lng:-1.5 } - this then gets passed to the next function (stringify) that makes the payload into a string (much like the existing injects are) - and then passes it out to the map.
The other thing to note is that the socket handler in the html page (from the template) - doesn't attempt to reconnect on any error or close - so once you deploy the flow you need to reload the map page first to get the websocket to (re)connect - before then clicking the injects to make things happen.