changes
This commit is contained in:
@@ -16,7 +16,8 @@ import { SafePipe } from './pipes/safe.pipe';
|
||||
HomeComponent,
|
||||
ListComponent,
|
||||
DetailComponent,
|
||||
SafePipe
|
||||
SafePipe,
|
||||
HttpClientModule
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div class="canvas nuvola">
|
||||
<canvas #myCanvas width="100vw" class="canvas"></canvas>
|
||||
</div> -->
|
||||
|
||||
@@ -26,7 +26,11 @@ export class positionService{
|
||||
}
|
||||
}*/
|
||||
|
||||
getDistanceBetweenCoordinates(lat1: number, lon1: number, lat2: number, lon2: number) {
|
||||
getDistanceBetweenCoordinates(lat1: number | undefined, lon1: number | undefined, lat2: number, lon2: number) {
|
||||
if (lat1 === undefined || lon1 === undefined) {
|
||||
console.log('lat1 or lon1 is undefined')
|
||||
return 0;
|
||||
}
|
||||
const earthRadius = 6371; // Raggio della Terra in km
|
||||
const dLat = this.deg2rad(lat2 - lat1);
|
||||
const dLon = this.deg2rad(lon2 - lon1);
|
||||
|
||||
Reference in New Issue
Block a user