From fcf3a806557b990ded2c994e14cf5dc55d26c5bb Mon Sep 17 00:00:00 2001 From: Mike Rostermund Date: Sat, 17 Oct 2015 11:31:57 +0200 Subject: [PATCH] Allow user to influence when devices are grouped on world map from widget settings --- html/includes/common/worldmap.inc.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/html/includes/common/worldmap.inc.php b/html/includes/common/worldmap.inc.php index fdec3fc269..bf9e6f36e1 100644 --- a/html/includes/common/worldmap.inc.php +++ b/html/includes/common/worldmap.inc.php @@ -46,7 +46,7 @@ if ($config['map']['engine'] == 'leaflet') {
-
+
+
+
+ +
+
+ +
+
@@ -87,13 +95,21 @@ if ($config['map']['engine'] == 'leaflet') { $init_lng = $config['leaflet']['default_lng']; $init_zoom = $config['leaflet']['default_zoom']; } + if (!empty($widget_settings['group_radius'])) { + $group_radius = $widget_settings['group_radius']; + } + else { + $group_radius = 80; + } $map_init = "[" . $init_lat . ", " . $init_lng . "], " . sprintf("%01.0f", $init_zoom); $temp_output .= 'var map = L.map(\'leaflet-map\').setView('.$map_init.'); L.tileLayer(\'//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\', { attribution: \'© OpenStreetMap contributors\' }).addTo(map); -var markers = L.markerClusterGroup(); +var markers = L.markerClusterGroup({ + maxClusterRadius: ' . $group_radius . ', + }); var redMarker = L.AwesomeMarkers.icon({ icon: \'server\', markerColor: \'red\', prefix: \'fa\', iconColor: \'white\'