• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 392
  • Last Modified:

google latitude and displaying it in realtime HTML

Hi,

I am in the process of setting up google latitude to track a project across europe and at the moment i have it setup to go to www.mightyavonradio.com/football/google.html and at the moment i am importing the KML files but i would love to do it in real time.

Apparently there is a way using REST but i dont know where to start?
0
jonathanduane2010
Asked:
jonathanduane2010
  • 6
  • 6
1 Solution
 
BardobraveCommented:
I'm not very sure what do you refer with google latitude.

If you mean the latitude and longitude values of any point in the google maps you can get it through their google maps API, as those are data stored on API classes. You can ask for a determinate point in the maps through petitions to their API, but this won't be realtime, as you'll always have a delay between your request and the server response.

Maybe more info on what you are seeking to achieve could help us to guide you.
0
 
jonathanduane2010Author Commented:
well at the moment i have the html code to display where a user is and we can embed that to our site but apparently there is a way you you can have location history showing without  having to update using KML files

here is the guide but i cant really follow it

http://code.google.com/apis/latitude/v1/getting_started.html
0
 
BardobraveCommented:
Didn't know that Google have such an API for positioning.

At first glance the documentation seems clear and complete. Although I still believe you won't receive "real time" info as you should count on a delay between your requests to REST server and their responses, I think it should be fair easy to build a function to stablish a dialog between Latitude API and your app.

Can you explain your exact problem? If the problem is that you are not familiar with REST I think all the info you need to start is on the link you've previously posted. Google's documentation usually is pretty clear.

If you find some rock on your path, ask it here and we'll try to help you moving it away.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
jonathanduane2010Author Commented:
Thanks a million for getting back to me,

So i have the code

<!-- Google Public Location Badge -->
<iframe src="http://www.google.com/latitude/apps/badge/api?user=-116452991543013806&type=iframe&maptype=roadmap" width="580" height="400" frameborder="0"></iframe>
<!-- To disable location sharing, you *must* visit https://www.google.com/latitude/apps/badge and disable the Google Public Location badge. Removing this code snippet is not enough! -->
<?xml version="1.0" encoding="UTF-8"?>

so i was wondering to display the location history do i put in

GET https://www.googleapis.com/latitude/v1/location?key=INSERT-YOUR-KEY

and if so where do i put it?
0
 
BardobraveCommented:
That snippet seems to collect data somehow on your site. But I'm not sure what do you want to do with it?
0
 
jonathanduane2010Author Commented:
i want to display it, is that possible?
0
 
BardobraveCommented:
Well... if you make an AJAX call to

https://www.googleapis.com/latitude/v1/location?key=INSERT-YOUR-KEY

I supose that it will return something to you, then is up to you what do you do with that response. You can show it embeded on any container on your page or extract any info from it (I supose it will response a JSON object, so you should be able to get any specific info).

Just make the call on your client code and manage the return of the request to insert it where you want to show it.
0
 
jonathanduane2010Author Commented:
how do i make an AJAX call to it?? and can i display it on a HTML page?
0
 
BardobraveCommented:
If you are using jQuery make an AJAX call is as easy as:

$.ajax({ async: false,
    url: "https://www.googleapis.com/latitude/v1/location?key=INSERT-YOUR-KEY",
    success: function (variableThatWillStoreTheResponse) {
       //Here you can put code to display the result where you want to
    }
});

If you are not using jQuery... well... you should do it. It's probably the best javascript framework out there. Easy, powerful and well documented. Take a look at it:

www.jquery.com
0
 
jonathanduane2010Author Commented:
and do i put it before the html code? and in this line

//Here you can put code to display the result where you want to
    }

do i put in the web address? as i wherever i have the page hosted?
0
 
BardobraveCommented:
Let's see... I think we have here some type of misunderstanding.

As far as I'm understanding your question:

You want to ask to a google's server for some info. This info is located at a RESTful service accesible by this url: https://www.googleapis.com/latitude/v1/location?key=INSERT-YOUR-KEY

If you paste that url into your web browser you should be able to see the response that google's server return to you.

By making the AJAX call what you do is to call that url from within your page without redirecting your browser to it, and store the response (whatever you've seen when you've pasted it on your browsers url bar) in a javascript variable (if it's a JSON response, which it'll probably be you will be able to load it into a javascript object).

You also want (as far as I'm understanding you) to load that response info (or a part of it) into your webpage.

To do so what you have to do is to use your javascript code to load the info you want to show from the responsed object into the container you want into your page.

Do you understand what I'm trying to state?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now