Skip to content

catt-stefano/ngx-heremaps-geocoding

 
 

Repository files navigation

NgxHeremapsGeocoding

Easy geocoding for Angular using Here Maps services.

Installation

Run npm install ngx-heremaps-geocoding or yarn add ngx-heremaps-geocoding.

Import the library inside your desired module, passing your Here Maps credentilas:

@NgModule({
    imports: [
        ...
        NgxHeremapsGeocodingModule.forRoot({
          app_code: [YOUR_HEREMAPS_APP_CODE],
          app_id: [YOUR_HEREMAPS_APP_ID]
        })
        ...

Usage

Import the service:

constructor(private geocoder: NgxHeremapsGeocodingService) {}

Use the geocode method to get a list of possible positions from an address:

this.geocoder.geocode('Via del Corso, Roma - Italy')
  .subscribe(
     geocodeResults => console.log('my results: ', geocodeResults)
  );

Use the search method to search for an address or a point of interest:

this.geocoder.search('Colosseo')
  .subscribe(
     geocodeResults => console.log('my results: ', geocodeResults)
  );

Contributions are welcome.

About

Easy geocoding for Angular using Here Maps services

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 84.7%
  • JavaScript 15.3%