@ng-maps/places
TypeScript icon, indicating that this package has built-in type declarations

6.0.0 • Public • Published

@ng-maps/places

Components related to places library. Currently only an autocomplete directive is implemented that can be attached to an input field to provide places suggestions

Installation

  • Npm: npm install @ng-maps/places
  • Yarn: yarn add @ng-maps/places

Add NgMapsPlacesModule to the module you want to use this module in.

You will also need to load the places library together with google maps. To achieve this you have to add it to the GOOGLE_MAPS_API_CONFIG provider.

{
  provide: GOOGLE_MAPS_API_CONFIG,
  useValue: {
    
    libraries: ['places']
  }
}

Configuration

There are different possibilities to add a default configuration to the module.

You can use either NgMapsPlacesModule.forRoot(<ConfigOptions>) or NgMapsPlacesModule.forRootFactory(() => <ConfigOptions>, [...depts]).

Or you can provide a configuration with the NG_MAPS_PLACES_DEFAULT_CONFIGURATION injection token.

Directives

Autocomplete

Add mapAutocomplete to an input field like <input mapAutocomplete /> or with options <input [mapAutocomplete]="options" />

Attach to result by adding listener for placeResult which returns a PlaceResult

Dependents (0)

Package Sidebar

Install

npm i @ng-maps/places

Weekly Downloads

229

Version

6.0.0

License

MIT

Unpacked Size

74.9 kB

Total Files

16

Last publish

Collaborators

  • dasch