基于 Web 的应用程序是否有可能以某种方式访问智能手机的位置?并报告回来

Is it possible for a web-based application to somehow access a smartphone's location ? And report back?

本文关键字:位置 智能手机 访问 回来 报告 方式 应用程序 Web 是否 有可能 基于      更新时间:2023-09-26

我的Web应用程序是用Flask(Python的DIY Web框架)构建的,我想将用户的位置与我们的其他资产一起包含在地图上。

我没有在Android或iPhone上构建应用程序。我不清楚这项任务的范围。

堆栈:CentOS6PythonFlaskTwilio,以及用户浏览器能够执行的任何操作(?

是的,HTML5附带了地理位置API。

if ("geolocation" in navigator) {
  navigator.geolocation.getCurrentPosition(function(position) {
    do_something(position.coords.latitude, position.coords.longitude);
  });
}