From 05dd4bbc32b847170ab9ca8c9797617f006cdd26 Mon Sep 17 00:00:00 2001 From: Xaver Maierhofer Date: Thu, 23 Jun 2016 04:15:54 +0200 Subject: [PATCH] [TASK] Add nodeZoom level --- README.md | 6 ++++++ config.json | 1 + lib/map.js | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 93916ef..83c5656 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ #### Some features are maybe merged - Updates selected node or list (incl. image stats cache-breaker) - not only overview tables +- Zoom level for nodes (`nodeZoom`) - Formatted Code - Grunt inline for some css and js - less requests - Icon font with only needed icons @@ -88,6 +89,11 @@ Setting this to `false` will hide contact information for nodes. Nodes being online for less than maxAge days are considered "new". Likewise, nodes being offline for more than than maxAge days are considered "lost". +## nodeZoom (integer) + +Max level to be applied by clicking a node or open a node. With value `18` near by buildings and streets should be visible. +Interesting if one of configured map provider has zoom-level under `18`. + ## mapLayers (List) A list of objects describing map layers. Each object has at least `name` diff --git a/config.json b/config.json index 8ff9d2a..34376bb 100644 --- a/config.json +++ b/config.json @@ -28,6 +28,7 @@ "siteName": "Freifunk Regensburg", "showContact": false, "maxAge": 14, + "nodeZoom": 18, "mapLayers": [ { "name": "OpenStreetMap.HOT", diff --git a/lib/map.js b/lib/map.js index 0afdee8..bc91664 100644 --- a/lib/map.js +++ b/lib/map.js @@ -301,7 +301,7 @@ define(["map/clientlayer", "map/labelslayer", } function setView(bounds) { - map.fitBounds(bounds, {paddingTopLeft: [sidebar(), 0]}); + map.fitBounds(bounds, {paddingTopLeft: [sidebar(), 0], maxZoom: config.nodeZoom}); } function resetZoom() {