config.json

You can configure the OpenDataMap with the config.json

format

This is the format for the config.json with example attributes:

{
"title": "This is the Name of the map",
"modules": [
{
"moduleName": "freifunk",
"config": {
"layerName": "Freifunk Siegburg",
"dataURL": "https://map.freifunk-siegburg.de/data/"
}
},
{
"moduleName": "iotmapper",
"config": {
"layerName": "IoT Mapper Hennef",
"dataURL": "https://map.bonn.codefor.de/assets/data/"
"filterValue": 0.00005,
"filterMapper": 900000,
"iotNodes": true,
"iotMapper": true,
"iotGateways": true,
"iotGatewayLines": false
}
}
],
"map": {
"layer": {
"url": "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png",
"attribution": "&copy; <a href='https://carto.com/location-data-services/basemaps/' target='_blank'>Carto</a>, <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"
},
"center": [
50.797467,
7.206706
],
"maxZoom": 18
},
"layerChooser": {
"activated": true
}
}

title (String)

title is the String where the name of the map is defined.

"title": "That's the title of the map"

modules (Array[Object])

modules is the Array where the modules are in. The module-config is in a seperate page.

"modules": [
{
"moduleName": "freifunk",
"config": { }
}
]

moduleName (String)

moduleName is a String. This is the name of the module in the lib/modules directory.

"name": "freifunk"

map (Object)

In map are the properties of the map.

"map": {
"layer": {
"url": "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png",
"attribution": "&copy; <a href='https://carto.com/location-data-services/basemaps/' target='_blank'>Carto</a>, <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"
},
"center": [
50.797467,
7.206706
],
"minZoom": 10,
"maxZoom": 18
}

layer (Object)

layer is the Object where the layer from the map is defined

"layer": {
"url": "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png",
"attribution": "&copy; <a href='https://carto.com/location-data-services/basemaps/' target='_blank'>Carto</a>, <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"
},

url (String)

url is a String. It will be used for the map layer URL. The variables are the leaflet variables (Leaflet documentation)

"url": "https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}{r}.png",

attribution (String)

attribution is a String. It will be used for the map layer attribution.

"attribution": "&copy; <a href='https://carto.com/location-data-services/basemaps/' target='_blank'>Carto</a>, <a href='http://osm.org/copyright'>OpenStreetMap</a> contributors"

center (Array[Number])

center is a Array with Numbers. It will be used for the map center. The first value in the Array is the latitude and the second the longitude

"center": [
50.797467,
7.206706
],

maxZoom (Number)

maxZoom is a Number. It will be used to define the maximal zoom that is possible in the map

"maxZoom": 18

layerChooser (Object)

activated (Boolean)

activated is a Boolean. It is used for activation/deactivation of the layerChooser.

"activated": true