Newer
Older
googleMap / src / app / home / home.page.ts
Luis Olaya on 15 Jun 2020 631 bytes Direccion
import { Component, OnInit } from '@angular/core';
import { GooglemapService } from '../services/googlemap.service';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage implements OnInit {

  public direccion: string = "";
  public lat = null;
  public lng = null;

  constructor(private googleMap: GooglemapService) {}

  ngOnInit(){
    this.dir();
  }

  dir(){
    this.googleMap.loadMap().then((data:any) => {
      console.log("direccion", data);
      this.direccion = data.dir;
      this.lat = data.lat;
      this.lng = data.lng;
    })
  }

}