You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2013/12/04 00:06:28 UTC
[1/6] git commit: Merge branch 'dev' of
https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation into dev
Updated Branches:
refs/heads/dev b7f3d73cc -> e05dae68c
Merge branch 'dev' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation into dev
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/9921477c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/9921477c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/9921477c
Branch: refs/heads/dev
Commit: 9921477c606972f574b0129048712486a775d26e
Parents: b8faed2 7ddbd8f
Author: purplecabbage <pu...@gmail.com>
Authored: Tue Sep 24 01:46:23 2013 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Tue Sep 24 01:46:23 2013 -0700
----------------------------------------------------------------------
----------------------------------------------------------------------
[6/6] git commit: Merge branch 'CB-5113' of
https://github.com/Touchit/cordova-plugin-geolocation into dev
Posted by pu...@apache.org.
Merge branch 'CB-5113' of https://github.com/Touchit/cordova-plugin-geolocation into dev
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/e05dae68
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/e05dae68
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/e05dae68
Branch: refs/heads/dev
Commit: e05dae68c8710616678bb2a21a561cb9db20bbfe
Parents: eccd62b 22055cc
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Dec 3 15:06:01 2013 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Dec 3 15:06:01 2013 -0800
----------------------------------------------------------------------
plugin.xml | 3 +
src/windows8/GeolocationProxy.js | 163 ++++++++++++++++++++++++++++++++++
2 files changed, 166 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/e05dae68/plugin.xml
----------------------------------------------------------------------
diff --cc plugin.xml
index b34fdba,5563272..5486c4c
--- a/plugin.xml
+++ b/plugin.xml
@@@ -173,8 -129,11 +173,11 @@@ xmlns:android="http://schemas.android.c
<config-file target="package.appxmanifest" parent="/Package/Capabilities">
<DeviceCapability Name="location" />
</config-file>
+ <js-module src="src/windows8/GeolocationProxy.js" name="GeolocationProxy">
+ <merges target="" />
+ </js-module>
</platform>
-
+
<!-- firefoxos -->
<platform name="firefoxos">
<config-file target="config.xml" parent="/*">
[2/6] git commit: Append windows 8 Geolocation proxy
Posted by pu...@apache.org.
Append windows 8 Geolocation proxy
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/a91b49aa
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/a91b49aa
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/a91b49aa
Branch: refs/heads/dev
Commit: a91b49aa5072537cf29c2b56f0e86b068e68c718
Parents: fee7065
Author: SomaticIT <co...@somatic.fr>
Authored: Thu Oct 17 12:22:39 2013 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Thu Oct 17 12:22:39 2013 +0200
----------------------------------------------------------------------
src/windows8/GeolocationProxy.js | 163 ++++++++++++++++++++++++++++++++++
1 file changed, 163 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/a91b49aa/src/windows8/GeolocationProxy.js
----------------------------------------------------------------------
diff --git a/src/windows8/GeolocationProxy.js b/src/windows8/GeolocationProxy.js
new file mode 100644
index 0000000..d965efd
--- /dev/null
+++ b/src/windows8/GeolocationProxy.js
@@ -0,0 +1,163 @@
+/*
+ * Copyright 2013 Research In Motion Limited.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var PositionError = require('./PositionError'),
+ ids = {},
+ loc;
+
+function ensureLocator() {
+ if (loc == null)
+ loc = new Windows.Devices.Geolocation.Geolocator();
+
+ return loc;
+}
+
+function createErrorCode() {
+ switch (loc.locationStatus) {
+ case Windows.Devices.Geolocation.PositionStatus.initializing:
+ // This status indicates that a location device is still initializing
+ case Windows.Devices.Geolocation.PositionStatus.noData:
+ // No location data is currently available
+ case Windows.Devices.Geolocation.PositionStatus.notInitialized:
+ // This status indicates that the app has not yet requested
+ // location data by calling GetGeolocationAsync() or
+ // registering an event handler for the positionChanged event.
+ case Windows.Devices.Geolocation.PositionStatus.notAvailable:
+ // Location is not available on this version of Windows
+ return PositionError.POSITION_UNAVAILABLE;
+
+ case Windows.Devices.Geolocation.PositionStatus.disabled:
+ // The app doesn't have permission to access location,
+ // either because location has been turned off.
+ return PositionError.PERMISSION_DENIED;
+
+ default:
+ break;
+ }
+}
+
+module.exports = {
+ getLocation: function (success, fail, args, env) {
+ ensureLocator();
+ if (loc != null)
+ {
+ var highAccuracy = args[0],
+ maxAge = args[1];
+
+ loc.desiredAccuracy = highAccuracy ?
+ Windows.Devices.Geolocation.PositionAccuracy.high :
+ Windows.Devices.Geolocation.PositionAccuracy.default;
+
+ loc.reportInterval = maxAge ? maxAge : 0;
+
+ loc.getGeopositionAsync().then(
+ function (pos) {
+ success({
+ latitude: pos.coordinate.latitude,
+ longitude: pos.coordinate.longitude,
+ altitude: pos.coordinate.altitude,
+ accuracy: pos.coordinate.accuracy,
+ heading: pos.coordinate.heading,
+ velocity: pos.coordinate.speed,
+ altitudeAccuracy: pos.coordinate.altitudeAccuracy,
+ timestamp: pos.coordinate.timestamp
+ });
+ },
+ function (err) {
+ fail({
+ code: createErrorCode(),
+ message: err.message
+ });
+ }
+ );
+ }
+ else
+ {
+ fail({
+ code: PositionError.POSITION_UNAVAILABLE,
+ message: "You do not have the required location services present on your system."
+ });
+ }
+ },
+
+ addWatch: function (success, fail, args, env) {
+ ensureLocator();
+ var clientId = args[0],
+ highAccuracy = args[1],
+
+ onPositionChanged = function (e) {
+ success({
+ latitude: e.position.coordinate.latitude,
+ longitude: e.position.coordinate.longitude,
+ altitude: e.position.coordinate.altitude,
+ accuracy: e.position.coordinate.accuracy,
+ heading: e.position.coordinate.heading,
+ velocity: e.position.coordinate.speed,
+ altitudeAccuracy: e.position.coordinate.altitudeAccuracy,
+ timestamp: e.position.coordinate.timestamp
+ });
+ },
+
+ onStatusChanged = function (e) {
+ switch (e.status) {
+ case Windows.Devices.Geolocation.PositionStatus.noData:
+ case Windows.Devices.Geolocation.PositionStatus.notAvailable:
+ fail({
+ code: PositionError.POSITION_UNAVAILABLE,
+ message: "Data from location services is currently unavailable or you do not have the required location services present on your system."
+ });
+ break;
+
+ case Windows.Devices.Geolocation.PositionStatus.disabled:
+ fail({
+ code: PositionError.PERMISSION_DENIED,
+ message: "Your location is currently turned off."
+ });
+ break;
+
+ case Windows.Devices.Geolocation.PositionStatus.initializing:
+ case Windows.Devices.Geolocation.PositionStatus.ready:
+ default:
+ break;
+ }
+ };
+
+ loc.desiredAccuracy = highAccuracy ?
+ Windows.Devices.Geolocation.PositionAccuracy.high :
+ Windows.Devices.Geolocation.PositionAccuracy.default;
+
+ loc.addEventListener("positionchanged", onPositionChanged);
+ loc.addEventListener("statuschanged", onStatusChanged);
+
+ ids[clientId] = { pos: onPositionChanged, status: onStatusChanged };
+ },
+
+ clearWatch: function (success, fail, args, env) {
+ var clientId = args[0],
+ callbacks = ids[clientId];
+
+ if (callbacks) {
+ loc.removeEventListener("positionchanged", callbacks.pos);
+ loc.removeEventListener("statuschanged", callbacks.status);
+
+ delete ids[clientId];
+ }
+
+ success && success();
+ }
+};
+
+require("cordova/windows8/commandProxy").add("Geolocation", module.exports);
\ No newline at end of file
[3/6] git commit: Append proxy to platform definition in plugin.xml
Posted by pu...@apache.org.
Append proxy to platform definition in plugin.xml
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/22055cce
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/22055cce
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/22055cce
Branch: refs/heads/dev
Commit: 22055cceb53dc64d993abb5f81b39da0e4446da6
Parents: a91b49a
Author: SomaticIT <co...@somatic.fr>
Authored: Thu Oct 17 12:24:41 2013 +0200
Committer: SomaticIT <co...@somatic.fr>
Committed: Thu Oct 17 12:24:41 2013 +0200
----------------------------------------------------------------------
plugin.xml | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/22055cce/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 5d90ede..5563272 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -129,6 +129,9 @@ xmlns:android="http://schemas.android.com/apk/res/android"
<config-file target="package.appxmanifest" parent="/Package/Capabilities">
<DeviceCapability Name="location" />
</config-file>
+ <js-module src="src/windows8/GeolocationProxy.js" name="GeolocationProxy">
+ <merges target="" />
+ </js-module>
</platform>
<!-- firefoxos -->
[4/6] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation into dev
Posted by pu...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation into dev
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/512491f7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/512491f7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/512491f7
Branch: refs/heads/dev
Commit: 512491f72c598f8218c3c7fde51ddd382a3c2b23
Parents: 9921477 fee7065
Author: purplecabbage <pu...@gmail.com>
Authored: Thu Oct 17 11:51:16 2013 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Thu Oct 17 11:51:16 2013 -0700
----------------------------------------------------------------------
RELEASENOTES.md | 6 +++++-
plugin.xml | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[5/6] git commit: Merge branch 'dev' of
https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation into dev
Posted by pu...@apache.org.
Merge branch 'dev' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation into dev
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/eccd62b7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/eccd62b7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/eccd62b7
Branch: refs/heads/dev
Commit: eccd62b7dc67c247a0205b04b7db5cc26eec1249
Parents: 512491f b7f3d73
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Dec 3 15:03:19 2013 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Dec 3 15:03:19 2013 -0800
----------------------------------------------------------------------
RELEASENOTES.md | 4 +
plugin.xml | 69 +++++++-
src/amazon/CordovaLocationListener.java | 252 +++++++++++++++++++++++++++
src/amazon/GPSListener.java | 51 ++++++
src/amazon/GeoBroker.java | 205 ++++++++++++++++++++++
src/amazon/NetworkListener.java | 33 ++++
src/android/GPSListener.java | 1 -
src/android/GeoBroker.java | 3 +-
src/blackberry10/index.js | 64 -------
src/firefoxos/GeolocationProxy.js | 53 ++++--
test/cordova-incl.js | 6 +-
www/blackberry10/GeolocationProxy.js | 61 +++++++
12 files changed, 710 insertions(+), 92 deletions(-)
----------------------------------------------------------------------