OnGeolocationUpdate usage

Hello!

What's the proper usage of the OnGeolocationUpdate event? I set a logging on the event, but it's never fired.

I do geolocation by a timer firing a TWegGeolocation.GetGeolocation and OnGeolocation event.

Is this OK or soul I use the update event for continuous location?

You need to call WebGeoLocation.StartTracking for getting continuous updates via OnGeoLocationUpdate

1 Like

Thank you!

Just for curiosity, is there any documentation about tracking? Does it work on interval or movement delta..?

The Geolocation API in the browser does not specify an exact update frequency or a minimum precision of change that triggers position updates, but it is influenced by the device's capabilities, hardware sensors, and the options you provide when calling the API.

Key Factors That Influence Updates

  1. Options Passed to watchPosition()
  • The HighPrecision property:
    • If true, the device will attempt to provide the most accurate location data (e.g., using GPS), but it consumes more power and may be slower.
    • If false, less accurate location updates will be provided, but they will arrive faster (e.g., via Wi-Fi or cell tower triangulation).
  • The MaximumAge property:
    • Specifies how long (in milliseconds) the browser can cache a previous location before fetching a new one.
  • The TimeOut property:
    • Sets the maximum time (in milliseconds) the API will wait for a position to be retrieved.
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.