/** * ng2-gm - Angular 2 components for Google Maps * @version v0.0.2 * @link https://github.com/williampaulo/angular2-google-maps#readme * @license MIT */ import {Directive, SimpleChange, OnChanges} from '@angular/core'; // import {SebmGoogleMapRouterPanel} from './google-map-router-panel'; import {RouterManager} from '../services/router-manager'; // import {GoogleMapsAPIWrapper} from '../services/google-maps-api-wrapper'; // import {RouterPanelManager} from '../services/router-panel-manager'; /** * SebmGoogleMapRouterPanel renders a info window inside a {@link SebmGoogleMapMarker} or * standalone. * * ### Example * ```typescript * import {Component} from '@angular/core'; * import {SebmGoogleMap, SebmGoogleMapMarker, SebmGoogleMapRouterPanel} from * 'angular2-google-maps/core'; * * @Component({ * selector: 'my-map-cmp', * directives: [SebmGoogleMap, SebmGoogleMapMarker, SebmGoogleMapRouterPanel], * styles: [` * .sebm-google-map-container { * height: 300px; * } * `], * template: ` * * * * Hi, this is the content of the info window * * * * ` * }) * ``` */ @Directive({ selector: 'sebm-google-map-router', inputs: ['origin', 'destination', 'waypoints'], providers: [RouterManager] }) export class SebmGoogleMapRouter implements OnChanges { /** * address or latitude and longitude of the point of arrival of the route */ origin: string = ''; /** * address or latitude and longitude, starting position of the route */ destination: string = ''; /** * dress or latitude and longitude of waypoints on the route */ waypoints: string[] = []; constructor(private _routerManager: RouterManager) { console.log(this.origin); } /** @internal */ ngOnChanges(changes: {[key: string]: SimpleChange}) { console.log('em rotas'); console.log(this.origin); if ((changes['origin'] || changes['destination']) && typeof this.origin === 'string' && typeof this.destination === 'string') { // this._routePanelManager.reload(this); // console.log('olha ae ' + this.destination); this._routerManager.updateRoute(this); } } }