1.1.0 • Published 12 months ago
@geosdi/ngx-geocoding v1.1.0
NgxGeocoding
This library was generated with Angular CLI version 13.0.0.
General information
Component to get a list of place with a geocoding service using nominatim of openstreet map
Installation
npm i @geosdi/ngx-geocoding --save
It depends on :
"@angular/common": ">=13.0.0",
"@angular/core": ">=13.0.0",
"typescript": ">=4.4.4",
"rxjs": ">=7.0.0"
Usage
import { Injectable } from '@angular/core';
import {NgxGeocodingService} from "./ngx-geocoding.service"; import {GeocodingLocation} from "./geocoding-location.model";
@Injectable({
providedIn: 'root'
})
export class Service {
constructor(private geocodingService: NgxGeocodingService,) {
}
public addPlugin() {
this.geocodingService.geocode(addressToSearch).subscribe((res: GeocodingLocation[]) => {
alert(JSON.stringify(res));
});
}
}
Methods
Method | action |
---|---|
geocode(address: string): Observable<GeocodingLocation[]> | list of GeocodingLocation |
Events
Method | action |
---|---|
subjectNoResults | subscribe to notify if research is empty |
subjectLocation | subject to notify location |
subjectRemove | subject to notify remove location |