Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/current location nearest station #13 #18

Merged
merged 12 commits into from
Nov 9, 2024

Conversation

imoken777
Copy link
Collaborator

close #13

backend

  • stationUseCaseに最寄り駅取得メソッドgetNearestStation追加
  • そのためのutlis
  • 仮でそれようのエンドポイント/location追加

frontend

  • 現在地取得のためのカスタムフック追加

@imoken777 imoken777 requested a review from mst-mkt November 5, 2024 13:59
@imoken777 imoken777 self-assigned this Nov 5, 2024
@imoken777 imoken777 requested a review from gotsteven November 5, 2024 14:01
apps/backend/src/usecases/stationUseCase.ts Outdated Show resolved Hide resolved
apps/backend/src/utils/calculateSphericalDistance.ts Outdated Show resolved Hide resolved
apps/backend/src/utils/calculateSphericalDistance.ts Outdated Show resolved Hide resolved
apps/backend/src/utils/calculateSphericalDistance.ts Outdated Show resolved Hide resolved
apps/backend/src/routes/location.ts Outdated Show resolved Hide resolved
apps/backend/src/usecases/stationUseCase.ts Outdated Show resolved Hide resolved
apps/backend/src/usecases/stationUseCase.ts Outdated Show resolved Hide resolved
apps/backend/src/usecases/stationUseCase.ts Show resolved Hide resolved
apps/backend/src/routes/location.ts Outdated Show resolved Hide resolved
apps/backend/src/utils/calculateSphericalDistance.ts Outdated Show resolved Hide resolved
Copy link

cloudflare-workers-and-pages bot commented Nov 5, 2024

Deploying sophie with  Cloudflare Pages  Cloudflare Pages

Latest commit: 00eb7ab
Status: ✅  Deploy successful!
Preview URL: https://07b9c363.sophie-4ce.pages.dev
Branch Preview URL: https://feat-currentlocation-nearest.sophie-4ce.pages.dev

View logs

@imoken777 imoken777 requested a review from mst-mkt November 5, 2024 15:34
apps/backend/src/routes/location.ts Outdated Show resolved Hide resolved
apps/backend/src/lib/odptApiPath.ts Outdated Show resolved Hide resolved
apps/backend/src/index.ts Outdated Show resolved Hide resolved
apps/backend/src/routes/location.ts Outdated Show resolved Hide resolved
@imoken777 imoken777 force-pushed the feat/currentLocation_nearestStation_#13 branch from 8a79f9d to 605228c Compare November 6, 2024 17:10
@imoken777 imoken777 requested a review from mst-mkt November 6, 2024 17:11
Comment on lines 10 to 17
const a =
Math.sin(deltaLatitude / 2) * Math.sin(deltaLatitude / 2) +
Math.cos(degreeToRadian(from.lat)) *
Math.cos(degreeToRadian(to.lat)) *
Math.sin(deltaLongitude / 2) *
Math.sin(deltaLongitude / 2)

const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

公式か何かを使った複雑な計算は、コメントアウトで補足しておいたほうがわかりやすそう

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

関数に切り出してJSDoc的なの書いておきたさがある

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

関数分けるとよりわかりずらそうだったから関数にjsdocと途中計算にはコメントアウトにした
それでもよくわからないけど

@mst-mkt mst-mkt merged commit 0ba6f14 into main Nov 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

現在地と最寄り駅の取得
2 participants