-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add photo display feature and routing #20
Conversation
rtomitani
commented
May 30, 2022
•
edited
Loading
edited
- パスに/p/:photoIdを指定すると、Firestoreのphotos/photoIdの写真を地図上に表示する
- Firestoreセキュリティルールを変更し、photosコレクションを誰でもread可能にした
Visit the preview URL for this PR (updated for commit 79cb3f6): https://nounsmap-web-dev--pr20-feature-photo-displa-u0gihanq.web.app (expires Wed, 08 Jun 2022 23:57:12 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rtomitani 素晴らしいです ありがとうございます。
直前にマージしてしまいコンフリクトしてしまっている箇所があるので対応お願いします。
@kozayupapa @isamu |
src/components/NounsMap.vue
Outdated
lng, | ||
visibility: true | ||
}); | ||
if (!isNaN(lat) && !isNaN(lng)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lat, lngは、firestoreからとってきているので、NaNではなく、undefinedになりそうです。
undefined or nullが、よくあるケースなので、その判定をする関数を作って判断するのが良いと思います。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます!
zoomプロパティ含め、undefined or nullの判定を行うよう修正します
後学のためにお聞きしたいのですが、プロパティに数値とnull / undefined以外の値(例えばArrayなど)が入っている可能性を考慮した場合、どのようにチェックしたら良いですか?
また、そもそもチェックの必要性はありますか?
以前Firestoreを使ったときにこの辺りのチェックがよくわからず、なあなあにしていました
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます!
ありがとうございます! |