A collection of tools relevant to locally-oriented dashboards supporting car2go, biki bike sharing and the Montreal metro. This is intended to run as an atlasboard submodule.
Note the shown dashboard includes altlasboard-social for twitter, atlasboard-weather and a slightly modified google-calendar
job/widget from the atlasboard-demo
package. (middle-right, bottom-middle and middle-bottom, respectively.)
All configuration options are optional.
"metro514": {
"language": "english"
}
The language
configuation option can be either english
or french
.
The motivation to use a static map is that the ChromeCast is slow to render JavaScript maps (e.g. add a webanimation showing a glowing point around your origin and watch it crash!)
The jobs
code has the bike sharing-parsing portion and theming portion separable. (My node/atlasboard knowledge doesn't know how to break this out, PRs welcome).
"mystaticmap": {
"lat": 40.76727,
"lon":-73.99392888,
"limit": 600,
"count": 20,
"maptype": "terrain",
"size": "640x640",
"zoom": 16,
"theme": "midnightcommander"
"bixi":{
"city": "montreal"
},
"car2go":{
"loc": "montreal",
"apikey": "Your Car2GoConsumerKey"
}
}
lat
andlon
are mandatory- if you use
bixi
you must set acity
- if you use
car2go
you must set aloc
andapikey
Supported city bike sharing service values: montreal, ottawa, boston, chicago, nyc, toronto, columbus, chattanooga, sf
All car2go values for car2go.loc
are supported.
limit
is the distance in meters from the lat
and lon
position.
count
is the max number of stations to gather independent of distance.
size
is limited to 640x640 without a premium account
zoom
is optional, but I find the default guess is pretty wide angle.
theme
is detailed below.
maptype
can be roadmap
, satellite
, hybrid
or terrain
transitcolor
is any valid Google Maps API colour and highlights non-specified links. E.g. if a leg has no specified colour it will use the transitcolor
. Most useful with themes.
Adding a Static Maps API Key permits access to higher resolution and more features, at a premium. It also permits them to track by API key instead of by IP address. It is mandatory if you want a map larger than 640x640.
In your globalAuth.json
you should add:
"staticmap": {
"apikey" : "YourGoogleStaticMapAPIKey"
}
Full credit goes to:
Themes are files in the jobs/themes/
directories and are JSON files as in the Snazzymaps JSON format. (Unfortunately at this time I don't have an easier way than cut and paste to get these files. I've looked at their dev API and it doesn't immediately do what I want.)
Show a travel time a specific origin and destination.
"mystaticmap": {
"origin_lat": 40.76727,
"origin_lon":-73.99392888,
"destination_lat": 40.0,
"destination_lon":-73.0,
"mode": "bicycling",
}
Also valid:
"mystaticmap": {
"origin": "4200 Saint Laurent, Montreal, PQ, Canada",
"destination": "Old Montreal, Montreal, PQ, Canada",
"mode": "driving"
}
origin_lat
andorigin_lon
(together) ORorigin
are mandatorydestination_lat
anddestination_lon
(together) ORdestination
are mandatory
mode
can be driving
, walking
, bicycling
, transit
. Default is driving
.
Adding a Google API Key permits access more features, at a premium. It also permits them to track by API key instead of by IP address.
In your globalAuth.json
you should add:
"traveltime": {
"apikey" : "YourGoogleAPIKey"
}
TODO: confirm distinction with static map and directions api keys, possibly distinguish
Show a travel time and route for a specific origin and destination.
"mystaticmap": {
"origin_lat": 40.76727,
"origin_lon":-73.99392888,
"destination_lat": 40.0,
"destination_lon":-73.0,
"mode": "bicycling",
"maptype": "terrain",
"size": "200x200",
"transitcolor": "red",
}
Also valid:
"mystaticmap": {
"origin": "4200 Saint Laurent, Montreal, PQ, Canada",
"destination": "Old Montreal, Montreal, PQ, Canada",
}
origin_lat
andorigin_lon
(together) ORorigin
are mandatorydestination_lat
anddestination_lon
(together) ORdestination
are mandatory
mode
can be driving
, walking
, bicycling
, transit
size
is limited to 640x640 without a premium account
zoom
is optional, but the default guess works
theme
is detailed below.
maptype
can be roadmap
, satellite
, hybrid
or terrain
transitcolor
is any valid Google Maps API colour and highlights non-specified links. E.g. if a leg has no specified colour it will use the transitcolor
. Most useful with themes.
Adding a Static Maps API Key permits access to higher resolution and more features, at a premium. It also permits them to track by API key instead of by IP address. It is mandatory if you want a map larger than 640x640.
In your globalAuth.json
you should add:
"traveltimemap": {
"apikey" : "YourGoogleStaticMapAPIKey"
}
TODO: confirm distinction with static map and directions api keys, possibly distinguish
(!) At this time themes are only static strings. Once I understand how to share themes with [Staticmap] I will add this.
"themeString": "&style=feature:all|element:labels.text.fill|color:0xffffff|weight:0.20|lightness:28|saturation:23|visibility:off&style=feature:all|element:labels.text.stroke|color:0x494949|lightness:13|visibility:off&style=feature:all|element:labels.icon|visibility:off&style=feature:administrative|element:geometry.fill|color:0x000000&style=feature:administrative|element:geometry.stroke|color:0x144b53|lightness:14|weight:1.4&style=feature:landscape|element:all|color:0x08304b&style=feature:poi|element:geometry|color:0x0c4152|lightness:5&style=feature:road.highway|element:geometry.fill|color:0x000000&style=feature:road.highway|element:geometry.stroke|color:0x0b434f|lightness:25&style=feature:road.arterial|element:geometry.fill|color:0x000000&style=feature:road.arterial|element:geometry.stroke|color:0x0b3d51|lightness:16&style=feature:road.local|element:geometry|color:0x000000&style=feature:transit|element:all|color:0x146474&style=feature:water|element:all|color:0x021019"