Check if Geolocation was allowed and get Lat Lon

后端 未结 5 726
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-04 02:17

I\'m building a small script that clients will install on their page. Geolocation is not necessary for it, however if it exists it would be nice to have. Is there a way for

5条回答
  •  长发绾君心
    2021-01-04 02:47

    According to the API it is not possible to find out of the user has already permitted the current site to retrieve the user's location without causing a prompt if he hasn't. See Endless answer

    I'd suggest you to allow users to pass an argument when embedding your script telling it if it should use geolocation features or not.

提交回复
热议问题