Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: revert add handling of lat, lon coordinate queries #385

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions src/SearchControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import SearchElement from './SearchElement';
import ResultList from './resultList';
import debounce from './lib/debounce';
import { validateCoords } from './coords';

import {
createElement,
addClassName,
removeClassName,
stopPropagation,

Check warning on line 11 in src/SearchControl.ts

View workflow job for this annotation

GitHub Actions / Eslint

'stopPropagation' is defined but never used
} from './domUtils';
import {
ENTER_KEY,
Expand All @@ -18,7 +17,7 @@
ARROW_DOWN_KEY,
ESCAPE_KEY,
} from './constants';
import AbstractProvider, { SearchResult } from './providers/provider';

Check warning on line 20 in src/SearchControl.ts

View workflow job for this annotation

GitHub Actions / Eslint

'AbstractProvider' is defined but never used
import { Provider } from './providers';

const defaultOptions: Omit<SearchControlProps, 'provider'> = {
Expand Down Expand Up @@ -283,7 +282,7 @@
);

this.container.appendChild(this.searchElement.form);
root!.appendChild(this.container);

Check warning on line 285 in src/SearchControl.ts

View workflow job for this annotation

GitHub Actions / Eslint

Forbidden non-null assertion
}

L.DomEvent.disableClickPropagation(this.searchElement.form);
Expand Down Expand Up @@ -374,13 +373,7 @@
const { provider } = this.options;

if (query.length) {
let results = [];
const coords = validateCoords(query);
if (coords) {
results = coords;
} else {
results = await provider!.search({ query });
}
let results = await provider!.search({ query });

Check warning on line 376 in src/SearchControl.ts

View workflow job for this annotation

GitHub Actions / Eslint

Forbidden non-null assertion
results = results.slice(0, this.options.maxSuggestions);
this.resultList.render(results, this.options.resultFormat);
} else {
Expand All @@ -392,13 +385,7 @@
this.resultList.clear();
const { provider } = this.options;

let results = [];
const coords = validateCoords(query);
if (coords) {
results = coords;
} else {
results = await provider!.search(query);
}
const results = await provider!.search(query);

Check warning on line 388 in src/SearchControl.ts

View workflow job for this annotation

GitHub Actions / Eslint

Forbidden non-null assertion

if (results && results.length > 0) {
this.showResult(results[0], query);
Expand Down
23 changes: 0 additions & 23 deletions src/coords.ts

This file was deleted.

Loading