Skip to content

Commit

Permalink
Merge pull request #98 from swoocn/fix-bugs
Browse files Browse the repository at this point in the history
Self approved.
  • Loading branch information
swoocn authored Mar 14, 2024
2 parents 9525d06 + 3852310 commit 30b2f02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/app/core/service/geolocation.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable, signal } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { Icon, icon, latLng, MapOptions, tileLayer } from 'leaflet';
import { Icon, icon, Map, MapOptions, tileLayer } from 'leaflet';
import axios from 'axios';

@Injectable({
Expand All @@ -11,10 +11,13 @@ export class GeolocationService {
initCoords: number[] = [];
private readonly geolocationTrigger = new Subject<void>();
private readonly maxZoomLevel = 18;
private readonly minZoomLevel = 2;
private readonly tileLayer = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
readonly geoLoading = signal<boolean>(false);
readonly geolocationTriggerEvent$ = this.geolocationTrigger.asObservable();

private map!: Map;

triggerGeolocation(): void {
this.geolocationTrigger.next();
}
Expand Down Expand Up @@ -50,6 +53,7 @@ export class GeolocationService {
layers: [
tileLayer(this.tileLayer, {
maxZoom: this.maxZoomLevel,
minZoom: this.minZoomLevel,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}),
],
Expand Down

0 comments on commit 30b2f02

Please sign in to comment.