Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Jun 8, 2024
1 parent ea6d37b commit 7630f87
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions IsraelHiking.Web/src/application/services/poi.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class PoiService {
}

private initializePois() {
for (let source of Object.keys(PoiService.POIS_MAP)) {
for (const source of Object.keys(PoiService.POIS_MAP)) {
const sourceLayer = PoiService.POIS_MAP[source];
this.mapService.map.addSource(source, {
type: "vector",
Expand Down Expand Up @@ -388,13 +388,14 @@ export class PoiService {
lat: feature.geometry.coordinates[0][1],
lon: feature.geometry.coordinates[0][0],
};
case "Polygon":
// HM TODO: this is a very rough approximation
const bounds = SpatialService.getBoundsForFeature(feature);
return {
lat: (bounds.northEast.lat + bounds.southWest.lat) / 2,
lon: (bounds.northEast.lng + bounds.southWest.lng) / 2,
};
case "Polygon": {
// HM TODO: this is a very rough approximation
const bounds = SpatialService.getBoundsForFeature(feature);
return {
lat: (bounds.northEast.lat + bounds.southWest.lat) / 2,
lon: (bounds.northEast.lng + bounds.southWest.lng) / 2,
};
}
default:
throw new Error("Unsupported geometry type: " + feature.geometry.type);
}
Expand All @@ -413,11 +414,11 @@ export class PoiService {
return [];
}
let features: MapGeoJSONFeature[] = [];
for (let source of Object.keys(PoiService.POIS_MAP)) {
for (const source of Object.keys(PoiService.POIS_MAP)) {
features = features.concat(this.mapService.map.querySourceFeatures(source, {sourceLayer: PoiService.POIS_MAP[source].sourceLayer}));
}
if (features.length === 0) {
for (let source of Object.keys(PoiService.POIS_MAP)) {
for (const source of Object.keys(PoiService.POIS_MAP)) {
features = features.concat(this.mapService.map.querySourceFeatures(`${source}-offline`, {sourceLayer: PoiService.POIS_MAP[source].sourceLayer}));
}
}
Expand Down Expand Up @@ -612,7 +613,7 @@ export class PoiService {
}
} catch {
let features: MapGeoJSONFeature[] = [];
for (let source of Object.keys(PoiService.POIS_MAP)) {
for (const source of Object.keys(PoiService.POIS_MAP)) {
features = features.concat(this.mapService.map.querySourceFeatures(`${source}-offline`, {sourceLayer: PoiService.POIS_MAP[source].sourceLayer}));
}
const feature = features.find(f => this.featureToPoiIdentifier(f) === id);
Expand Down

0 comments on commit 7630f87

Please sign in to comment.