ng-location-picker
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

ng-location-picker

This library for angular 4 allows the user to select a geographical location in a map. You just have to use the directive on any HTML element that can trigger a click event.

Installation

To install this library, run:

$ npm install ng-location-picker --save

First of all you have to include the google maps libraries in your application

<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {Component} from '@angular/core';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import LatLng = google.maps.LatLng;
import {LocationPickerModule} from "ng-location-picker";
 
@Component({
    selector: 'app',
    template: `
        <input ng-location-picker (onPickedLocation)="logPickedLocation($event)">`
})
class AppComponent {
    static logPickedLocation(location: LatLngLiteral) {
        console.log(location);
    }
}
 
@NgModule({
    bootstrap: [AppComponent],
    declarations: [AppComponent],
    imports: [BrowserModule, LocationPickerModule]
})
class AppModule {
}

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

To lint all *.ts files:

$ npm run lint

License

MIT © Víctor Rodriguez

Readme

Keywords

Package Sidebar

Install

npm i ng-location-picker

Weekly Downloads

6

Version

0.1.9

License

MIT

Unpacked Size

34.4 kB

Total Files

12

Last publish

Collaborators

  • vrodmz