Skip to content

Commit 93c8a0c

Browse files
authored
fix: revert add handling of lat, lon coordinate queries (#385)
1 parent 036eb33 commit 93c8a0c

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

src/SearchControl.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { ControlPosition, FeatureGroup, MarkerOptions, Map } from 'leaflet';
33
import SearchElement from './SearchElement';
44
import ResultList from './resultList';
55
import debounce from './lib/debounce';
6-
import { validateCoords } from './coords';
76

87
import {
98
createElement,
@@ -374,13 +373,7 @@ const Control: SearchControl = {
374373
const { provider } = this.options;
375374

376375
if (query.length) {
377-
let results = [];
378-
const coords = validateCoords(query);
379-
if (coords) {
380-
results = coords;
381-
} else {
382-
results = await provider!.search({ query });
383-
}
376+
let results = await provider!.search({ query });
384377
results = results.slice(0, this.options.maxSuggestions);
385378
this.resultList.render(results, this.options.resultFormat);
386379
} else {
@@ -392,13 +385,7 @@ const Control: SearchControl = {
392385
this.resultList.clear();
393386
const { provider } = this.options;
394387

395-
let results = [];
396-
const coords = validateCoords(query);
397-
if (coords) {
398-
results = coords;
399-
} else {
400-
results = await provider!.search(query);
401-
}
388+
const results = await provider!.search(query);
402389

403390
if (results && results.length > 0) {
404391
this.showResult(results[0], query);

src/coords.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)