auto snap changed to 1 meter
All checks were successful
Build and deploy / Build and Push Docker Images (push) Successful in 2m25s
All checks were successful
Build and deploy / Build and Push Docker Images (push) Successful in 2m25s
This commit is contained in:
@@ -37,7 +37,7 @@ export function DrawingHandler({ mapId, onItemCreated }: DrawingHandlerProps) {
|
|||||||
}, [mapId]);
|
}, [mapId]);
|
||||||
|
|
||||||
// Find nearby device for snapping (exclude info markers)
|
// Find nearby device for snapping (exclude info markers)
|
||||||
const findNearbyDevice = (lat: number, lng: number, radiusMeters = 5): any | null => {
|
const findNearbyDevice = (lat: number, lng: number, radiusMeters = 1): any | null => {
|
||||||
const devices = allItems.filter(item =>
|
const devices = allItems.filter(item =>
|
||||||
['switch', 'indoor_ap', 'outdoor_ap', 'other_device'].includes(item.type) &&
|
['switch', 'indoor_ap', 'outdoor_ap', 'other_device'].includes(item.type) &&
|
||||||
item.geometry.type === 'Point'
|
item.geometry.type === 'Point'
|
||||||
@@ -151,7 +151,7 @@ export function DrawingHandler({ mapId, onItemCreated }: DrawingHandlerProps) {
|
|||||||
// Wireless mesh - connect AP to AP only
|
// Wireless mesh - connect AP to AP only
|
||||||
if (isWirelessTool) {
|
if (isWirelessTool) {
|
||||||
// Must click on an AP
|
// Must click on an AP
|
||||||
const ap = findNearbyDevice(lat, lng, 5);
|
const ap = findNearbyDevice(lat, lng, 1);
|
||||||
if (!ap || !['indoor_ap', 'outdoor_ap'].includes(ap.type)) {
|
if (!ap || !['indoor_ap', 'outdoor_ap'].includes(ap.type)) {
|
||||||
showToast('Wireless mesh can only connect between Access Points. Please click on an AP.', 'error');
|
showToast('Wireless mesh can only connect between Access Points. Please click on an AP.', 'error');
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user