Wie man Breitengrad und Länge von der Adresse in Angular 6 bekommt
getGeoLocation(address: string): Observable<any> {
console.log('Getting address: ', address);
let geocoder = new google.maps.Geocode();
return Observable.create(observer => {
geocoder.geocode({
'address': address
}, (results, status) => {
if (status == google.maps.GeocoderStatus.OK) {
observer.next(results[0].geometry.location);
observer.complete();
} else {
console.log('Error: ', results, ' & Status: ', status);
observer.error();
}
});
});
}
Jittery Jaguar