Page 1 of 1

Geolocation Service Problem

Posted: Sat Jun 16, 2012 10:37 pm
by Srihari Yamanoor

Geolocation appears to be working, but the output values are not working. Here is what I have done - I have a simple button that invokes the geolocation service, and I mapped one output variable mapped to a label text on one cell in a grid. Chrome and my android phone both seem to invoke the service, but the value is not being written. I am obviously missing a step or something. Any help is much appreciated!


Geolocation Service Problem

Posted: Sat Jun 16, 2012 11:06 pm
by maxkatz

How did you test that the service being invoked?

When you map, add the following in JavaScript mapping:

code
console.log(value);
return value;
/code

and check in browser's console what is being returned.


Geolocation Service Problem

Posted: Sat Jun 16, 2012 11:12 pm
by Srihari Yamanoor

Thanks Max, this is what I get: TypeError Cannot read property 'watchPosition' of undefined

While I look for what I am doing wrong, I thought I would share it with you quickly.


Geolocation Service Problem

Posted: Sat Jun 16, 2012 11:40 pm
by Srihari Yamanoor

I had the javascript in the wrong place. Putting it next to the mapped field, DOES return the lattitude: 37.7667813 . However, it fails to populate the label text.

Here is how I did the label text: I created a cell grid and then I added the "label" field. I added "Latitude" as the text label. I went to the Geolocation service, and created an output map from the latitude field to this label.


Geolocation Service Problem

Posted: Sat Jun 16, 2012 11:53 pm
by Srihari Yamanoor

Ah sorry, I was mapping it to Visible and not Text. Serious NOOB mistake! Thanks for the help.


Geolocation Service Problem

Posted: Sun Jun 17, 2012 12:18 am
by Srihari Yamanoor

It still doesn't work on my Android Phone. Any tips would be really appreciated.