Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation Tracking App

You have two values mapped to the same Input component, it's incorrect.

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Geolocation Tracking App

I'm confused. Do I not need both latitude and longitude in the "inputSource" component. What's the correct mapping? Thanks Katya.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Geolocation Tracking App

Joe,

If you want Input Source to display current address you shouldn't map latitude and longitude there. You would need to save latitude and longtitude in two localStorage variables and map address from Reverse Geocoding service to Input Source.

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Geolocation Tracking App

Ohh I see. So I should do a "test" in the "reverseGeo" service in order to map those variables to "inputSource"? Is there any visual aid you could provide for the mapping? I often need to be spoon-fed. Here's my "Geolocation" data mapping now. What do I need to do? Thanks Katya! Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Geolocation Tracking App

I'll try to explain from the beginning:
1) Create REST service with the following settings:
Image

  • URL codehttp://maps.googleapis.com/maps/api/geocode/json/code

  • Method: GET

  • Data Type: json
    2) add request parameters
    Image

  • latlng: 40.714224,-73.961452

  • sensor: true
    3) Go to Test tab, click test button to get response:
    Image
    4) Click "Automatically Create Service Response", go to Response tab to see response structure. Should look like this:

    Image

    5) Add this service to screen
    6) Go to mapping
    7) Create mapping for request parameter latlng, map localStorage variable latitude to parameter latlng;
    Image

    8) click "Add JS" in front of "latlng" and paste the following code:
    codereturn localStorage.getItem("latitude") + ',' + localStorage.getItem("longitude");/code
    Image
    9) Map Response formatted_address to textbox.
    10) On success Geolocation service call created service

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Geolocation Tracking App

Thanks Marina! I had a lot of that stuff correct I think. I believe there was the slightest problem with the latlng parameter value, which was fixed with what you provided.
On step 9 you mean to map it like this, correct? Image
And I need to invoke the "reverseGeo" on "map" component load, right?
Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Geolocation Tracking App

Yes, mapping looks correct. You should invoke reverseGeo service on geolocation1 success event

Image

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Geolocation Tracking App

Thanks Marina! It's all set up. Except when I test it in Eclipse, I still get this error. I've included the screenshots of the log. Hopefully everything will work well after we fix this one. Thanks! Image Image Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Geolocation Tracking App

1) Change code in JavaScript1 from
codevar mapOptions = {
zoom:7,
mapTypeId: google.maps.MapTypeId.ROADMAP,
map = new google.maps.Map(document.getElementById("directionsMap"), mapOptions);
}/code
to codevar mapOptions = {zoom:7,
mapTypeId: google.maps.MapTypeId.ROADMAP};
map = new google.maps.Map(document.getElementById("directionsMap"), mapOptions);/code

2) on Website-Page show-Run JavaScript change code$("#Chat").attr("100%", the_height);/code to code$("#Chat").attr("height", the_height);/code

3) don't worry about "Unsafe JavaScript attempt to access frame with URL", you can skip it.

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Geolocation Tracking App

Thanks Marina! It's working fairly well now. The "chat" page of my mobile website in the panel on "website" page still isn't really sizing itself correctly. Not really sure why.

Return to “Issues”