Replaced WorldMap zoom with text field to enable more fine grained zooming by steps of 0.1 (#10753)

* Reimplemented filtering of devices under maintenance when displaying only Down devices in the WorldMap

* Replaced WorldMap zoom with text field to enable more fine grained zooming by steps of 0.1
This commit is contained in:
gdepeyrot
2019-11-04 18:39:43 +01:00
committed by Kevin Krumm
parent 7bb5f22681
commit 4fe3bca717
2 changed files with 8 additions and 10 deletions

View File

@@ -19,11 +19,7 @@
<div class="form-group">
<label for="init_zoom-{{ $id }}" class="control-label">@lang('Initial Zoom')</label>
<select class="form-control" name="init_zoom" id="init_zoom-{{ $id }}">
@foreach(range(0, 18) as $zoom)
<option value="{{ $zoom }}" @if($zoom == $init_zoom) selected @endif>{{ $zoom }}</option>
@endforeach
</select>
<input class="form-control" name="init_zoom" id="init_zoom-{{ $id }}" type="number" min="0" max="18" step="0.1" value="{{ $init_zoom }}" placeholder="@lang('ie. 5.8')">
</div>
<div class="form-group">

View File

@@ -40,11 +40,13 @@
});
@foreach($devices as $device)
var title = '<a href="{{ \LibreNMS\Util\Url::deviceUrl($device) }}"><img src="{{ $device->icon }}" width="32" height="32" alt=""> {{ $device->displayName() }}</a>';
var tooltip = '{{ $device->displayName() }}';
var marker = L.marker(new L.LatLng('{{ $device->location->lat }}', '{{ $device->location->lng }}'), {title: tooltip, icon: {{ $device->markerIcon }}, zIndexOffset: {{ $device->zOffset }}});
marker.bindPopup(title);
markers.addLayer(marker);
@if($status != '0' or !$device->isUnderMaintenance())
var title = '<a href="{{ \LibreNMS\Util\Url::deviceUrl($device) }}"><img src="{{ $device->icon }}" width="32" height="32" alt=""> {{ $device->displayName() }}</a>';
var tooltip = '{{ $device->displayName() }}';
var marker = L.marker(new L.LatLng('{{ $device->location->lat }}', '{{ $device->location->lng }}'), {title: tooltip, icon: {{ $device->markerIcon }}, zIndexOffset: {{ $device->zOffset }}});
marker.bindPopup(title);
markers.addLayer(marker);
@endif
@endforeach
map.addLayer(markers);