On the world map it would be great if the map would try to auto center to the most center area of all locations. Currently I have sites in two cities in my state, and my map centers on my city and not the center most area of the state causing me to have to move the map constanly to the the other locations. It would be great if the map would auto zoom so it would give you the best view possible.
Claude has fixed this for me.
In /opt/librenms/resources/views/widgets/world-map.blade.php make the changes below:
Replace this:
var map = get_map(map_id);
if (! map.markerCluster) {
map.markerCluster = L.markerClusterGroup({
By this:
var map = get_map(map_id);
var isFirstLoad = ! map.markerCluster;
if (! map.markerCluster) {
map.markerCluster = L.markerClusterGroup({
Replace this:
map.markerCluster.clearLayers();
map.markerCluster.addLayers(markers);
By this:
map.markerCluster.clearLayers();
map.markerCluster.addLayers(markers);
if (isFirstLoad && markers.length > 0) {
map.fitBounds(map.markerCluster.getBounds(), {
padding: [30, 30],
maxZoom: 12
});
}
After the replacement, run php artisan view:clear and refresh the browser.
Probably reasonable and worth a pull request.
I am not developer, that’s why Claude fixed this for me.
How can I create the pull request?
The developer docs step you through it as if you are a new developer. Either that or just ask Claude.