Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーがサイトのGPSを無効にしたかどうかを確認するための簡単な設定はありますか、それともgeolocation.getCurrentPositionエラーコールバックを使用して使用する必要がありますか?
geolocation.getCurrentPosition
機能の検出に加えてif ("geolocation" in navigator) {、ユーザーが位置情報サービスを使用する許可を与えているかどうかは、エラー ハンドラを使用するgetCurrentPosition()か渡すことによって、最初にサービスへの関心を表明することによってのみ決定できます。watchPosition()
if ("geolocation" in navigator) {
getCurrentPosition()
watchPosition()