retrieve boundaries from location using GMaps API
This commit is contained in:
parent
32d536b4cc
commit
a30dfe730e
@ -1,6 +1,6 @@
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Category, GooglePlaceResult, Place } from '../types/poi';
|
||||
import { Category, GoogleBoundaries, GooglePlaceResult, Place } from '../types/poi';
|
||||
import { BehaviorSubject, map, Observable, shareReplay, tap } from 'rxjs';
|
||||
import { Info } from '../types/info';
|
||||
import { Backup, ImportResponse, Settings } from '../types/settings';
|
||||
@ -325,4 +325,8 @@ export class ApiService {
|
||||
gmapsSearchText(q: string): Observable<GooglePlaceResult[]> {
|
||||
return this.httpClient.get<GooglePlaceResult[]>(`${this.apiBaseUrl}/places/google-search`, { params: { q } });
|
||||
}
|
||||
|
||||
gmapsGeocodeBoundaries(q: string): Observable<GoogleBoundaries> {
|
||||
return this.httpClient.get<GoogleBoundaries>(`${this.apiBaseUrl}/places/google-geocode`, { params: { q } });
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,3 +35,8 @@ export interface GooglePlaceResult {
|
||||
allowdog: boolean;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface GoogleBoundaries {
|
||||
northeast: { lat: number; lng: number };
|
||||
southwest: { lat: number; lng: number };
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user