Device location map zoom out when location N/A (#16034)

This commit is contained in:
Tony Murray
2024-05-14 10:11:52 -05:00
committed by GitHub
parent 34032723c4
commit 0c35b7dc4f

View File

@@ -162,8 +162,8 @@ if ($device['location_id'] && $location = Location::find($device['location_id'])
config = {"tile_url": "' . Config::get('leaflet.tile_url', '{s}.tile.openstreetmap.org') . '"};
device_map = init_map("location-map", "' . $maps_engine . '", "' . $maps_api . '", config);
device_marker = L.marker(device_location).addTo(device_map);
device_map.setView(device_location);
device_map.setZoom(18);
let zoom = (device_location.lat === 0 && device_location.lng === 0) ? 2 : 17;
device_map.setView(device_location, zoom);
device_marker.dragging.enable();