navigator.geolocation.watchPosition stops after a few success events
Reported by
amueller...@gmail.com,
Sep 10
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0 Steps to reproduce the problem: 1. start geowatch.html 2. click watch position 3. you will see success messages What is the expected behavior? the messages stop after 2 or three success events What went wrong? it seems watchposition stops working. Did this work before? Yes Does this work in other browsers? Yes Chrome version: 69.0.3497.81 Channel: beta OS Version: 10.0 Flash Version:
,
Sep 11
,
Sep 11
Able to reproduce the issue on Mac 10.13.3, Win-10 and Ubuntu 14.04 using chrome reported version #69.0.3497.81 and latest canary #71.0.3548.0. This is a non-regression issue as it is observed from M60 old builds. Hence, marking it as untriaged to get more inputs from dev team. Thanks...!!
,
Sep 11
One remark: It works fine on my Android Chrome 68. Could it be that watchposition only works if coordinates are changing? I use windows Chrome for testing and geowatch.html works with older Chrome versions but i do not know the version.
,
Sep 12
Hi amueller326@, thanks for reporting this! I think this is intended behavior. watchPosition will deliver new estimates as they are generated, but in some scenarios the estimate may not be updated very quickly. For instance, if you are using the network geolocation provider then the estimate is based on nearby wifi APs. If these don't change significantly then we won't request a new estimate from the network service. Furthermore, we limit how often we scan for nearby APs based on whether Chrome thinks the device is stationary. When the set of scanned APs hasn't changed recently, Chrome may go as long as 10 minutes between scans. When GPS is active we should expect the estimate to change fairly often. If you set your Android device to not use GPS I would expect it to behave similarly to the desktop cases. I'm closing this WontFix since this appears to be the intended behavior and it does seem that the page is receiving all available location estimates. Please re-open if this is incorrect or if you have other concerns about the behavior.
,
Sep 12
,
Sep 13
Hi mattreynolds@ thank you for claryfication. This makes sense. One remark for Chrome on mobiles. On Android for example i have only the possibility to change priority usage of GPS or forbid usage of location service at all. So, if i set option PositionOptions.enableHighAccuracy to true then the behavior you describe for active GPS should be used. watchposition should request coordinates fairly often also if there are no changes in coordinates, because the user could make a break or a car must wait for green signal. The problem with the behavior you describe is, that i have no feedback from watchposition about reducing updates. So i do not know wether watchposition is dead or only reducing the updating frequence.
,
Sep 13
Android should allow you to configure the location service to use GPS-only, network-only, both, or none. I think the options to disable network geolocation provider were moved to a "Google Location Accuracy" option in Android P. > if i set option PositionOptions.enableHighAccuracy to true then the behavior you describe for active GPS should be used. It's generally true that if you set enableHighAccuracy to true and the GPS provider is enabled at the OS level that active GPS will be used. However, this decision isn't made by Chrome, it's made by the platform API implementation. https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi FusedLocationProviderApi. The provider API takes a high accuracy parameter like the Geolocation API and decides which providers to use based on that hint. > The problem with the behavior you describe is, that i have no feedback from watchposition about reducing updates. So i do not know wether watchposition is dead or only reducing the updating frequence. I haven't encountered any cases where watchPosition dies after a few estimates. I think it would be possible to distinguish this case from the case where no new GPS data is available by looking for the location service icon (map pin) in the status bar. If the icon is there then probably there is no GPS data. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Sep 10