Files
marco/app/services/map-ui.js
Râu Cao bf12305600 Add full-text search
Add a search box with a quick results popover, as well full results in
the sidebar on pressing enter.
2026-02-20 12:39:04 +04:00

47 lines
925 B
JavaScript

import Service from '@ember/service';
import { tracked } from '@glimmer/tracking';
export default class MapUiService extends Service {
@tracked selectedPlace = null;
@tracked isSearching = false;
@tracked isCreating = false;
@tracked creationCoordinates = null;
@tracked returnToSearch = false;
@tracked currentCenter = null;
selectPlace(place) {
this.selectedPlace = place;
}
clearSelection() {
this.selectedPlace = null;
}
startSearch() {
this.isSearching = true;
this.isCreating = false;
}
stopSearch() {
this.isSearching = false;
}
startCreating() {
this.isCreating = true;
this.isSearching = false;
}
stopCreating() {
this.isCreating = false;
this.creationCoordinates = null;
}
updateCreationCoordinates(lat, lon) {
this.creationCoordinates = { lat, lon };
}
updateCenter(lat, lon) {
this.currentCenter = { lat, lon };
}
}