get location home component
This commit is contained in:
@@ -1 +1,7 @@
|
||||
<p>detail works!</p>
|
||||
<iframe
|
||||
width="100%"
|
||||
height="450"
|
||||
frameborder="0" style="border:0"
|
||||
src="https://www.google.com/maps/embed/v1/directions?key=API_KEY&origin=PARTENZA&destination=DESTINAZIONE&avoid=tolls|highways" allowfullscreen>
|
||||
</iframe>
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<div class="bg-image">
|
||||
<input type="text" placeholder="Type here" class="input input-bordered input-primary w-full max-w-xs" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,7 +6,13 @@ import {Component, OnInit} from '@angular/core';
|
||||
styleUrls: ['./home.component.css']
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
latitude: number | undefined;
|
||||
longitude: number | undefined;
|
||||
ngOnInit(): void {
|
||||
navigator.geolocation.getCurrentPosition(position => {
|
||||
this.latitude = position.coords.latitude;
|
||||
this.longitude = position.coords.longitude;
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user