V
V
volucris12021-06-30 13:12:51
JavaScript
volucris1, 2021-06-30 13:12:51

How to find out the permissions issued by the user (for geolocation)?

60dc424ce4606014668336.png
I need to get the position of the user (navigator.geolocation.getCurrentPosition)
But first I need to get the permission. Can you tell me how can I know that I have received this permission?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2021-06-30
@volucris1

navigator.geolocation.getCurrentPosition(
  function(){
    // Дали добро, делаем все что нужно
  }, 
  function(){
    // Ошибка. В т.ч. если отказали в определении местоположения.
  }
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question