Home

Awesome

About

This project animates vehicles (markers) on a map using the public transport timetables to interpolate their positions along the routes (polylines).

NEW: Plug and play your GTFS files ! Check the GTFS-viz for more information.

Swiss railways(SBB) SBB network - http://simcity.vasile.ch/sbb/

Live applications using this project

Swiss railways(SBB) Romanian railways(CFR) Lausanne (TL) Brașov (RAT) Grenoble (TAG) Genève (TPG)

Install

You need is a webserver(i.e. Apache) and a (modern) browser.

Steps:

You should already see some action on the map !

Customize

Parameters in config.js

File static/js/config.js

KeyRequiredSample ValueDescription
center.xYES8.540Longitude of the map center. Values in decimal degrees.
center.xYES47.378Latitude of the map center. Values in decimal degrees.
map_type_idYESroadmapInitial map type. Values: roadmap, satellite, terrain, stamen
zoom.startYES13Initial map zoom level. Values from 1 to 21.
zoom.min7Minimum map zoo level.
zoom.max7Maximum map zoo level.
zoom.to_stopsYES17Zoom to this value when a stop(station) is clicked / selected
zoom.roadmap.stops_min15Minimum zoom level for which the stops(stations) layer is visible when the roadmap view is rendered
zoom.roadmap.stops_max20Maximum zoom level ...
zoom.roadmap.shapes_min7Minimum zoom level for which the shapes(tracks) ...
zoom.roadmap.shapes_min20Maximum zoom level ...
zoom.satellite.stops_min15Minimum zoom level for which the stops(stations) layer is visible when the satellite view is rendered
zoom.satellite.stops_max20Maximum zoom level ...
zoom.satellite.shapes_min7Minimum zoom level for which the shapes(tracks) ...
zoom.satellite.shapes_min18Maximum zoom level ...
zoom.vehicle_followYES17Zoom to this value when a vehicle is "followed"
zoom.vehicle_mouseover_minYES7Prohibit vehicle popups when hovering under this zoom value
ft_layer_ids.maskstringFusion Table ID of the area mask. Example: SBB network mask
ft_layer_ids.gtfs_shapesstringFusion Table ID of the GTFS shapes. Example: SF Muni shapes
ft_layer_ids.gtfs_stopsstringFusion Table ID of the GTFS stops. Example: SF Muni stops
ft_layer_ids.topology_edgesstringFusion Table ID of the custom network edges. Example: SBB edges . Use this for non-GTFS projects
ft_layer_ids.topology_stationsstringFusion Table ID of the custom network stations. Example: SBB edges . Use this for non-GTFS projects
api_paths.tripsYESapi/getTrips/[hhmm]Vehicles (or GTFS trips) API with all vehicles that run at given hhmm - hour minutes.
api_paths.departuresapi/getDepartures/[stop_id]/[hhmm]Departures API of the vehicles that stop in [stop_id] station at given [hhmm] time.
geojson.gtfs_shapesYESapi/geojson/gtfs_shapes.jsonGeoJSON FeatureCollection with the GTFS shapes. *This param is not required if geojson.topology_ are used.
geojson.gtfs_stopsYESapi/geojson/gtfs_shapes.jsonGeoJSON FeatureCollection with the GTFS stops. This param is not required if geojson.topology_ are used.*
geojson.topology_edgesstatic/geojson/edges-sbb.jsonGeoJSON FeatureCollection with the network edges. This param is required if the project is NOT GTFS based.
geojson.topology_stationsstatic/geojson/edges-sbb.jsonGeoJSON FeatureCollection with the network stations. This param is required if the project is NOT GTFS based.
routesHashJS Hash containing the route defintions.**

Notes:

Override parameters

All the config parameters above can be overriden using query string parameters, for instance add ?center.x=8.2&center.y=46.9 to override the map center.

Other parameters

In addition to these, other optional parameters can be used as querystring parameters or in the config.js

KeySample ValueDescription
hms10:20:30Override time of day, using hh:mm:vv format
time_multiply10Accelerate the simulation :) Possible values: 1, 5, 10, 100
view_modeiframeWill remove the info panel; suitable for IFRAME integrations
vehicle_nameICN10017The application will try to locate the vehicle by name and follow it
vehicle_idstringSame as above for vehicle_id

Examples:

Contact ?

Have other questions or do you want to use this application for your area and got stuck ?

Then ping me on Twitter or drop me a line.

License

Copyright (c) 2014 Vasile Coțovanu - http://www.vasile.ch

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: