-
Notifications
You must be signed in to change notification settings - Fork 1
Configuration
GistMap renders a map based on a JSON configuration file. Here is an example:
{
"layers": [
{
"type": "background",
"source": "osm"
},
{
"type": "choropleth",
"features": "https://dl.dropboxusercontent.com/s/qsg4n1kg8bkqfhi/judete.topojson",
"data": "https://docs.google.com/spreadsheet/ccc?key=0AlBmcLkxpBOXdEEzSE1HWTdWeGYxTG9ja0l4c2VyRHc&usp=drive_web#gid=0"
}
]
}
The map is made up of layers. You typically want a background layer, then a choropleth or bubble layer with your data. These are the available layer types:
An XYZ tile layer, as provided by OpenStreetMap, CloudMade, MapBox and many others.
{
"type": "tiles",
"src": "http://{s}.tile.osm.org/{z}/{x}/{y}.png",
"attribution": "© <a href=\"http://osm.org/copyright\">OpenStreetMap</a> contributors"
}
Preconfigured background layers. Only OpenStreetMap is currently available.
{
"type": "background",
"source": "osm"
}
Polygons colored according to value.
{
"type": "choropleth",
"features": "https://dl.dropboxusercontent.com/s/qsg4n1kg8bkqfhi/judete.topojson",
"data": "https://docs.google.com/spreadsheet/ccc?key=0AlBmcLkxpBOXdEEzSE1HWTdWeGYxTG9ja0l4c2VyRHc&usp=drive_web#gid=0"
}
features
is a Features file. data
is a Data file.
By default, a choropleth layer maps the values to a blue color scale, but this can be overridden by specifying colorRange
:
"colorRange": {"min": {"color": "#aaa", "value": 0}, "max": {"color": "#038", "value": 50}}
Circles scaled according to value.
{
"type": "bubble",
"features": "https://dl.dropboxusercontent.com/s/3718h4vi5bk5alm/localitati.geojson",
"data": "https://docs.google.com/spreadsheet/ccc?key=0AlBmcLkxpBOXdEZHd05HOGRzU3d6OHk4MG00RV9ySVE&usp=drive_web#gid=0"
}
features
is a Features file. data
is a Data file. Circles are scaled according to the maximum value of the data, which is drawn as a 5000 km² circle, the size of a medium city.