Beispiel #1
0
 /// <summary>
 /// Use this command rather than the getCurrentPosition command to track progress during a trip rather than just getting a single position.
 /// </summary>
 /// <remarks>
 /// Use this command rather than the <see cref="getCurrentPosition(PositionCallback,PositionErrorCallback,PositionOptions)">getCurrentPosition</see> command to track progress during a trip rather than just getting a single position. This command asynchronously acquires the latitude and longitude of the device. When data is available, the success function is called. If there is an error getting position data, the error function is called.
 /// <para>Available Platforms:</para>
 /// <list type="bullet">
 /// <item>
 /// <description>Apple iOS</description>
 /// </item>
 /// <item>
 /// <description>Google Android</description>
 /// </item>
 /// <item>
 /// <description>Microsoft Windows 8</description>
 /// </item>
 /// <item>
 /// <description>Microsoft Windows Phone 8</description>
 /// </item>
 /// <item>
 /// <description>Html5 natively</description>
 /// </item>
 /// <item>
 /// <description>XDK emulated mode</description>
 /// </item>
 /// </list>
 /// </remarks>
 /// <example>
 /// <code lang="C#">
 /// // Tips: if your class inherit from the "HtmlContext" base class, you don't need to add "HtmlContext." before "alert"
 /// // This object holds the options for the command
 /// var options = new PositionOptions() { timeout = 10000, maximumAge = 11000, enableHighAccuracy = true };
 /// // This function is called on every iteration of the watch Position command that fails
 /// PositionErrorCallback Fail = delegate(PositionError p)
 /// {
 ///     HtmlContext.alert("Geolocation failed. \nPlease enable GPS in Settings.");
 /// };
 /// // This function is called on every iteration of the watchPosition command that is a success
 /// PositionCallback Suc = delegate(Geoposition p)
 /// {
 ///     HtmlContext.alert("Moved To: Latitude:" + p.coords.latitude + "Longitude:" + p.coords.longitude);
 /// };
 /// // This command starts watching the geolocation
 /// int geolocationWatchTimer = AppMobi.geolocation.watchPosition(Suc, Fail, options);
 /// // Call the StopGeolocation function to stop the geolocation watch
 /// JsAction StopGeolocation = delegate()
 /// {
 ///     AppMobi.geolocation.clearWatch(geolocationWatchTimer);
 /// };
 /// </code>
 /// </example>
 /// <param name="successCallback">When data is available, this success function is called.</param>
 /// <param name="errorCallback">If there is an error getting position data, the error function is called.</param>
 /// <param name="options">Some options may be specified for the method as an object.</param>
 /// <returns>geolocationWatchTimer</returns>
 public int watchPosition(PositionCallback successCallback, PositionErrorCallback errorCallback, PositionOptions options) { return default(int); }
Beispiel #2
0
 /// <summary>
 /// Use this command to get the current location of the device.
 /// </summary>
 /// <remarks>
 /// Use this command to get the current location. This command asynchronously acquires the approximate latitude and longitude of the device. When data is available, the success function is called. If there is an error getting position data, the error function is called.
 /// <para>Available Platforms:</para>
 /// <list type="bullet">
 /// <item>
 /// <description>Apple iOS</description>
 /// </item>
 /// <item>
 /// <description>Google Android</description>
 /// </item>
 /// <item>
 /// <description>Microsoft Windows 8</description>
 /// </item>
 /// <item>
 /// <description>Microsoft Windows Phone 8</description>
 /// </item>
 /// <item>
 /// <description>Html5 natively</description>
 /// </item>
 /// <item>
 /// <description>XDK emulated mode</description>
 /// </item>
 /// </list>
 /// </remarks>
 /// <example>
 /// <code lang="C#">
 /// // Tips: if your class inherit from the "HtmlContext" base class, you don't need to add "HtmlContext." before "undefined" or "alert"
 /// public static void GetLocation()
 /// {
 ///     PositionCallback Suc = delegate(Geoposition p)
 ///     {
 ///         HtmlContext.alert("geolocation success");
 ///         if (p.coords.latitude as object != HtmlContext.undefined)
 ///         {
 ///             var currentLatitude = p.coords.latitude;
 ///             var currentLongitude = p.coords.longitude;
 ///         }
 ///     };
 ///     PositionErrorCallback Fail = delegate(PositionError p)
 ///     {
 ///         HtmlContext.alert("geolocation failed");
 ///         GetLocation();
 ///     };
 ///     AppMobi.geolocation.getCurrentPosition(Suc, Fail);
 /// }
 /// </code>
 /// </example>
 /// <param name="successCallback">When data is available, this success function is called.</param>
 /// <param name="errorCallback">If there is an error getting position data, the error function is called.</param>
 /// <param name="options">Some options may be specified for the method as an object.</param>
 public void getCurrentPosition(PositionCallback successCallback, PositionErrorCallback errorCallback, PositionOptions options) { }