简体   繁体   English

如何在Haxe中使用navigator.geolocation.getCurrentPosition?

[英]How to use navigator.geolocation.getCurrentPosition in Haxe?

Maybe somebody can tell me how I will use navigator.geolocation.getCurrentPosition in Haxe. 也许有人可以告诉我如何在Haxe中使用navigator.geolocation.getCurrentPosition。 In JavaScript this method needs 2 callback functions (success/error) and an option object. 在JavaScript中,此方法需要2个回调函数(成功/错误)和一个选项对象。 In the Haxe version of this method, the successCallback is typed as Position and the errorCallback is typed as PositionError. 在此方法的Haxe版本中,将successCallback键入为Position,将errorCallback键入为PositionError。 How do I use getCurrentPosition method in Haxe? 如何在Haxe中使用getCurrentPosition方法?

In the Haxe version of this method, the successCallback is typed as Position and the errorCallback is typed as PositionError. 在此方法的Haxe版本中,将successCallback键入为Position,将errorCallback键入为PositionError。

This is inaccurate. 这是不准确的。 The documentation states : 文档指出

  • successCallback:Position ‑> Void
    this must be a callback accepting one argument of type Position 这必须是一个接受Position类型的参数的回调
  • ?errorCallback:PositionError ‑> Void
    this is an optional callback acception one argument of type PositionError 这是一个可选的回调接受,类型为PositionError
  • ?options:PositionOptions
    these are optional PositionOptions 这些是可选的PositionOptions

Here's a runnable example: http://try.haxe.org/#5EE17 这是一个可运行的示例: http : //try.haxe.org/#5EE17

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何强制 navigator.geolocation.getCurrentPosition 失败 - How to force navigator.geolocation.getCurrentPosition to fail navigator.geolocation.getCurrentPosition 的行为 - Behaviour of navigator.geolocation.getCurrentPosition navigator.geolocation.getCurrentPosition无法正常工作 - navigator.geolocation.getCurrentPosition not working React.js:如何在cookie中设置navigator.geolocation.getCurrentPosition - Reactjs : How to set navigator.geolocation.getCurrentPosition in cookie navigator.geolocation.getCurrentPosition 如何获取您的纬度和经度? - How does navigator.geolocation.getCurrentPosition get your latitude and longitude? navigator.geolocation.getCurrentPosition如何获取客户端浏览器的位置坐标 - How navigator.geolocation.getCurrentPosition gets location coordinates of a client browser navigator.geolocation.getCurrentPosition已停止工作 - navigator.geolocation.getCurrentPosition has stopped working navigator.geolocation.getcurrentposition抛出超时错误 - navigator.geolocation.getcurrentposition throws Timeout error 在百度地图中显示navigator.geolocation.getCurrentPosition - Showing navigator.geolocation.getCurrentPosition in Baidu Maps navigator.geolocation.getcurrentposition在Safari中不起作用 - navigator.geolocation.getcurrentposition is not working in safari
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM