get location home component

This commit is contained in:
2023-01-31 15:54:13 +01:00
parent 21f2d2d002
commit be568dc118
3 changed files with 14 additions and 1 deletions

View File

@@ -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>

View File

@@ -1,3 +1,4 @@
<div class="bg-image"> <div class="bg-image">
<input type="text" placeholder="Type here" class="input input-bordered input-primary w-full max-w-xs" /> <input type="text" placeholder="Type here" class="input input-bordered input-primary w-full max-w-xs" />
</div> </div>

View File

@@ -6,7 +6,13 @@ import {Component, OnInit} from '@angular/core';
styleUrls: ['./home.component.css'] styleUrls: ['./home.component.css']
}) })
export class HomeComponent implements OnInit { export class HomeComponent implements OnInit {
latitude: number | undefined;
longitude: number | undefined;
ngOnInit(): void { ngOnInit(): void {
navigator.geolocation.getCurrentPosition(position => {
this.latitude = position.coords.latitude;
this.longitude = position.coords.longitude;
})
} }
} }