diff --git a/README.md b/README.md index b0f5564..52e7249 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,10 @@ Change this to match your communities' name. It will be used in various places. This affects the initial scale of the map. Greater values will show a larger area. Values like 1.0 and 0.5 might be good choices. +## mapLatOffset and mapLngOffset (float) + +Normally the center of your map is calculated by the geo coordinates of your nodes. If you want to center the map slightly different, you can use mapLatOffset and mapLngOffset. A value of 0 will center the map as normal. Value can be negativ. + ## showContact (bool) Setting this to `false` will hide contact information for nodes. diff --git a/config.json.example b/config.json.example index 8d7e9ed..ed6fc2c 100644 --- a/config.json.example +++ b/config.json.example @@ -2,6 +2,8 @@ "dataPath": "https://map.luebeck.freifunk.net/data/", "siteName": "Freifunk Lübeck", "mapSigmaScale": 0.5, + "mapLatOffset": 0.1, + "mapLngOffset": -0.1, "showContact": true, "maxAge": 14, "mapLayers": [ diff --git a/lib/map.js b/lib/map.js index bcab1a8..f025d1a 100644 --- a/lib/map.js +++ b/lib/map.js @@ -321,8 +321,8 @@ define(["map/clientlayer", "map/labelslayer", if (nodes.length === 0) return undefined - var lats = nodes.map(function (d) { return d.latitude }) - var lngs = nodes.map(function (d) { return d.longitude }) + var lats = nodes.map(function (d) { return d.latitude + config.mapLatOffset }) + var lngs = nodes.map(function (d) { return d.longitude + config.mapLngOffset }) var barycenter = L.latLng(d3.median(lats), d3.median(lngs)) var barycenterDev = [d3.deviation(lats), d3.deviation(lngs)]