[
https://issues.apache.org/jira/browse/CB-7283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jesse MacFadyen resolved CB-7283.
---------------------------------
Resolution: Invalid
JSON.stringify does not enumerate the object, but if you just access the
properties, or do a for..in you will see they do exist.
{code}
navigator.geolocation.watchPosition(
function (position) {
for (var v in position) {
console.log(v + " : " + position[v]);
}
},
function (error) { // next function is the error callback
alert("Error : " + error);
},
{ enableHighAccuracy: true }
);
{code}
Outputs:
coords : [object Coordinates]
timestamp : 1412113359592
> Wp8 cordova geolocation problem
> -------------------------------
>
> Key: CB-7283
> URL: https://issues.apache.org/jira/browse/CB-7283
> Project: Apache Cordova
> Issue Type: Bug
> Components: WP8
> Affects Versions: 3.5.0
> Environment: Wp 8.1 / windows x64 8.1/ VisualStudio 2013
> Reporter: nicolas Sagon
> Assignee: Jesse MacFadyen
> Labels: features
>
> I have a workfull application on android an iphone build with phonegap 3.5
> In this application i use a watchPosition and it's work on android and
> iPhone. But now i want to use my application on a WP8.1 device.
> So i have add the platform to my project and build it (works fine) but the
> watchPosition always return an empty position :
> function startGeolocation() {
> if (navigator.geolocation) {
> stopGeolocation(); // au cas ou deja lance
> mbdGlobal.geolocationWatchIdHighAccuracy =
> navigator.geolocation.watchPosition(
> function (position) {
> alert("Position : " + JSON.stringify(position));
> mbdGlobal.lastMyPosition = position;
> },
> // next function is the error callback
> function (error) { displayGeolocationErrorMessage(error, 'GPS') },
> {
> enableHighAccuracy: true
> }
> );
> }
> else // finish the error checking if the client is not compliant with the spec
> {
> alertWebapp(strMessageNotCompatible + "(geolocation)");
> }
> }
> My alert display : Position : {};
> I don't understand why in WP8 this doesn't work. I have add the
> ID_CAP_LOCATION on my app.
> Plz if you know why it's doesn't work tell me.
> Thanks you for all your answers.
> edit : I also made a test app with the geoloc plugin and it's the same issue
> doesn't work.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)