{"id":21063982,"url":"https://github.com/davidenunes/vehicle-routing-viz","last_synced_at":"2025-07-16T14:39:12.039Z","repository":{"id":7248549,"uuid":"8559307","full_name":"davidenunes/vehicle-routing-viz","owner":"davidenunes","description":"A vehicle routing visualisation system with node.js and Google Maps API","archived":false,"fork":false,"pushed_at":"2017-09-21T22:01:45.000Z","size":4313,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T18:52:48.051Z","etag":null,"topics":["discrete-event","maps","simulation","visualisation"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidenunes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-04T16:13:10.000Z","updated_at":"2021-10-07T19:14:46.000Z","dependencies_parsed_at":"2022-09-19T03:20:39.391Z","dependency_job_id":null,"html_url":"https://github.com/davidenunes/vehicle-routing-viz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fvehicle-routing-viz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fvehicle-routing-viz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fvehicle-routing-viz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidenunes%2Fvehicle-routing-viz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidenunes","download_url":"https://codeload.github.com/davidenunes/vehicle-routing-viz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254456028,"owners_count":22074082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discrete-event","maps","simulation","visualisation"],"created_at":"2024-11-19T17:47:54.440Z","updated_at":"2025-05-16T02:32:09.914Z","avatar_url":"https://github.com/davidenunes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vehicle Routing Visualisation\nThis is a visualisation application written in [Node.js](http://nodejs.org/) used to display simple\nvehicle routing information in a page using the [Google Maps JavaScript API v3](https://developers.google.com/maps/documentation/javascript/reference).\n\nThe *Node.js* server provides a way to link other applications such as vehicle routing simulators to the Google Maps canvas \nvia a simple Web interface. To provide the Web interface, we used the [Express.js](http://expressjs.com/) framework for *Node.js*.\nTo communicate with the visualisation pages containing Google Maps canvas, we used the [Socket.io](http://socket.io/). This provides a \nflexible API that allows for asynchronous communication using *WebSockets*. \n\nFinaly, we used the [EPoly Google Maps API Extension](http://econym.org.uk/gmap/epoly.htm) to visualise markers moving along \nexisting routes.\n\n#Usage\nTo run the visualisation server you need to install [Node.js](http://nodejs.org/). To install extra modules for *Node.js*\n(such as *Socket.io* and *Express*) you can use the [Node Package Modules](https://npmjs.org/).\n\nTo do this, run \n\n```bash\nnpm install socket.io\nnpm install express\n```\n\nafter the node modules are installed you are ready to run the demo.\n\nTo run this demo, you just need to execute the `routing_server.js` with node. This can be done as follows:\n\n```bash\nnodejs routing_server.js\n```\nThis starts the server which means you are ready to make requests and visualise the results. To visualise the \nresults on a map, you just need to open the `routing_client.html` file. If the server is running, this client \nwill connect to it and wait for instructions.\n\n## Test the Visualisation API\nTo test the visualisation API you don't need a particular application. Just Open your browser and type for instance\n`http://localhost:6969/api`\n\nYou should receive the message: `OK`\n\n## Visualisation Web API\n**Note** : note that the address `localhost` and the port `6969` are values for the host and port that should be used if you \nare just running the application locally you can obviously change these values based on the machine running the visualisation server \nand the port you set in the `routing_server.js` file. The visualisation client (routing_client.html) should be opened after you run routing_server.js as\nit will try to connect to the server.\n\n**Dummy Server Check** : `http://localhost:6969/api` - dummy method that returns `OK` if the web browser is able to send a request to the visualisation server.\n\n**Set Map Center** : `http://localhost:6969/api/set/mapcenter/:lat/:lng` - sets the map center to a given latitude and longitude. As an example `http://localhost:6969/api/set/mapcenter/1/1`\nsets the map center to the coordinates `(1,1)`\n\n**Add Marker** : `http://localhost:6969/api/add/marker/:id/:color/:lat/:lng/:title` - adds a generic marker to the map: \n* :id - is the id of the marker \n* :color - is the color for the marker (for example #FE7569)\n* :lat - the latitude of the marker\n* :lng - the longitude of the marker\n* :title - a title or name for the marker\n\n**Add Worker** : `http://localhost:6969/api/add/worker/:id/:lat/:lng/:name` - adds a worker / vehicle marker to the map:\n* :id - is the id of the worker\n* :lat - worker latitude\n* :lng - worker longitude\n* :name - a textual name for the worker\n\n**Set Worker Position** : `http://localhost:6969/api/set/worker/position/:workerID/:lat/:lng` - sets the position of the given worker to a coordinate:\n* :workerID - worker id\n* :lat - new worker latitude\n* :lng - new worker longitude\n\n**Add Job** : `http://localhost:6969/api/add/job/:id/:lat/:lng/:title` - adds a job marker to the map:\n* :id - is the id of the job\n* :lat - job latitude\n* :lng - job longitude\n* :title - a textual name or title for the job\n\n**Add Depot** : `http://localhost:6969/api/add/depot/:id/:lat/:lng/:title` - adds a depot / base marker to the map:\n* :id - is the id of the depot\n* :lat - depot latitude\n* :lng - depot longitude\n* :title - a textual name or title for the depot\n\n**Add Route** : `http://localhost:6969/api/add/route/:id/:lat1/:lng1/:lat2/:lng2` - uses the Google Directions api to \nadd a route between two coordinates to the map:\n* :id - route id\n* :lat1 - route starting latitude\n* :lng1 - route starting longitude\n* :lat2 - route ending latitude\n* :lng2 - route ending longitude\n\n**Remove Route** : `http://localhost:6969/api/remove/route/:id` - removes a previously added route from the map:\n* :id - route id\n\n**Remove Depot** : `http://localhost:6969/api/remove/depot/:id` - removes a depot from the map based on its *id*:\n* :id - depot id\n\n**Remove Job** : `http://hocalhost:6969/api/remove/job/:id` - removes a previously added job from the map :\n* :id -  job id \n\n**Remove Worker** : `http://localhost:6969/api/remove/worker/:id` - removes a previously added worker from the map:\n* :id -  worker id \n\n**Complete Job** : `http://localhost:6969/api/set/job/done/:id` - sets an existing job as done (simply changes its marker in this case):\n* :id -  job id \n\n**Clear the Map** : `http://localhost:6969/api/remove/all` - removes all the objects from the map.\n\n**Move Worker in a Route** : `http://localhost:6969/api/update/worker/position/:workerID/:routeID/:distance` - moves a worker in a route given a distance counting from the start of the route:\n* :workerID - worker id\n* :routeID - route id\n* :distance - a distance in meters counting from the start of the route\n\n**Get Worker Position** : `http://localhost:6969/api/get/worker/position/:workerID` - returns the current coordinates for the given worker:\n* :workerID - the id of the worker\n* response: `lat;lng`\n\nThis is the only method in this demo that returns some kind of state for the map. It might be useful if one needs \nto determine the actual coordinate of a Worker (for instance if this in the middle of an existing route and\nneeds to be re-routed).\n\n# Licence\nVehicle Routing Visualisation\n\n* Copyright (C) 2017 [Davide Nunes](http://davidenunes.com)\n\nThe Vehicle Routing Visualisation is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThe Vehicle Routing Visualisation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with Vehicle Routing Visualisation.\nIf not, see [GPL 3.0](http://www.gnu.org/licenses/gpl-3.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidenunes%2Fvehicle-routing-viz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidenunes%2Fvehicle-routing-viz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidenunes%2Fvehicle-routing-viz/lists"}