Skip to content

Commit

Permalink
remove deprecated box bounds fields from areas
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght committed Dec 20, 2023
1 parent bd1e20a commit e329aa3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 41 deletions.
6 changes: 1 addition & 5 deletions src/routes/communities/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
.filter(
(area) =>
area.tags.type === 'community' &&
((area.tags['box:east'] &&
area.tags['box:north'] &&
area.tags['box:south'] &&
area.tags['box:west']) ||
area.tags.geo_json) &&
area.tags.geo_json &&
area.tags.name &&
area.tags['icon:square'] &&
area.tags.continent &&
Expand Down
6 changes: 1 addition & 5 deletions src/routes/communities/leaderboard/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
? $areas.filter(
(area) =>
area.tags.type === 'community' &&
((area.tags['box:east'] &&
area.tags['box:north'] &&
area.tags['box:south'] &&
area.tags['box:west']) ||
area.tags.geo_json) &&
area.tags.geo_json &&
area.tags.name &&
area.tags['icon:square'] &&
area.tags.continent &&
Expand Down
29 changes: 3 additions & 26 deletions src/routes/community/[area]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@
(area) =>
area.id == data.id &&
area.tags.type === 'community' &&
((area.tags['box:east'] &&
area.tags['box:north'] &&
area.tags['box:south'] &&
area.tags['box:west']) ||
area.tags.geo_json) &&
area.tags.geo_json &&
area.tags.name &&
area.tags['icon:square'] &&
area.tags.continent &&
Expand Down Expand Up @@ -175,18 +171,7 @@
let lat = latCalc(element['osm_json']);
let long = longCalc(element['osm_json']);
if (community.geo_json) {
if (geoContains(rewoundPoly, [long, lat])) {
return true;
} else {
return false;
}
} else if (
lat >= Number(community['box:south']) &&
lat <= Number(community['box:north']) &&
long >= Number(community['box:west']) &&
long <= Number(community['box:east'])
) {
if (geoContains(rewoundPoly, [long, lat])) {
return true;
} else {
return false;
Expand Down Expand Up @@ -620,15 +605,7 @@
map.addLayer(outdatedLayer);
map.addLayer(legacyLayer);
map.fitBounds(
// @ts-expect-error
community.geo_json
? leaflet.geoJSON(community.geo_json).getBounds()
: [
[community['box:south'], community['box:west']],
[community['box:north'], community['box:east']]
]
);
map.fitBounds(leaflet.geoJSON(community.geo_json).getBounds());
mapLoaded = true;
};
Expand Down
6 changes: 1 addition & 5 deletions src/routes/dashboard/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
? $areas.filter(
(area) =>
area.tags.type === 'community' &&
((area.tags['box:east'] &&
area.tags['box:north'] &&
area.tags['box:south'] &&
area.tags['box:west']) ||
area.tags.geo_json) &&
area.tags.geo_json &&
area.tags.name &&
area.tags['icon:square'] &&
area.tags.continent &&
Expand Down

0 comments on commit e329aa3

Please sign in to comment.