Prevent map search when zoomed out too much

It's usually an accidental click, and if not, the search radius/pulse
wouldn't be clearly visible.
This commit is contained in:
Râu Cao 2026-02-10 18:33:25 +04:00
parent 53300b92f5
commit d30375707a
Signed by: raucao
GPG Key ID: 37036C356E56CC51

View File

@ -744,6 +744,13 @@ export default class MapComponent extends Component {
return;
}
// Require Zoom >= 17 for generic map searches
// This prevents accidental searches when interacting with the map at a high level
const currentZoom = this.mapInstance.getView().getZoom();
if (currentZoom < 16) {
return;
}
const coords = toLonLat(event.coordinate);
const [lon, lat] = coords;