crosswalk-project / crosswalk

A web runtime built on Chrome. This project is currently unmaintained.
https://crosswalk-project.org/blog/crosswalk-final-release.html
BSD 3-Clause "New" or "Revised" License
2.33k stars 652 forks source link

Geolocation #52

Open baleboy opened 11 years ago

huningxin commented 11 years ago

I investigated the geolocation API (http://dev.w3.org/geo/api/spec-source.html ) support in Content/Blink which Cameo depends on.

Background

Basically geolocation (position) data is provided by GPS sensor or location web service (client provides the WIFI, Cell or IP, server returns position). In practice, GPS sensor is used for high accuracy, and the location web service is used for devices without GPS (such as desktop), for in-door usage or even for power saving.

As diagram [1] shows, Content/Blink uses different location providers (backends) on different platforms. There are three types of providers implemented in Content/Blink: 1) GPS sensor based; 2) web service based,; 3) Platform/OS API based (the platform/OS API itself depends on web service or GPS sensor).

Summary

Cameo CAN reuse GPS sensor based provider for general Linux distribution and Windows 7. Cameo CANNOT use location web service based provider unless purchasing the API key from Google. Cameo CAN reuse the platform/OS location API based provider for Android and Windows 8. But the position data availability depends on underlying platform/OS. Cameo NEEDS to implement platform/OS location API based provider for Tizen.

Details

[1] Content geolocation components diagram geolocation

huningxin commented 11 years ago

API spec: http://dev.w3.org/geo/api/spec-source.html

huningxin commented 11 years ago

According to current implementation, validation points are:

  1. On Linux with GPS sensor, navigator.geolocation.getCurrentPosition should invoke successCallback with meaningful Position value. (when sensor is working, for example out-door)
  2. On Linux without GPS sensor, navigator.geolocation.getCurrentPosition should invoke errorCallback with POSITION_UNAVAILABLE error.
  3. On Windows 7 with GPS sensor, navigator.geolocation.getCurrentPosition should invoke successCallback with meaningful Position value. (when sensor is working, for example out-door)
  4. On Windows 7 without GPS sensor, navigator.geolocation.getCurrentPosition should invoke errorCallback with POSITION_UNAVAILABLE error.
  5. On Windows 8, navigator.geolocation.getCurrentPosition should invoke successCallback with meaningful Position value.
jiangwenhao commented 11 years ago

This feature has been migrated to JIRA, please track it in https://crosswalk-project.org/jira/browse/XWALK-221. Thanks