how to integrate google latitude into a google map - google-maps

I am setting up a website that shows a Google map and the location of various Google Latitude users on that map via markers.
Thing is, I can't find the exact code to do that. I have trawled through the Google API docs which are extensive but lacking in examples, actual examples of how a finished page might look.
So, I have my Google Map in place and I have registered an account on the Google API and set up OAUTH2 (got my clientID etc.) but I am stuck as to what to do next.
Any suggestions much appreciated.

The Latitude API documentation will tell you all the specific things it can do. It won't do general things for you like "put markers on a Google map"- it is meant to be used rather separately from Maps API. Your application will have to get Latitude oauth authorization for each of the users and use access tokens to request their locations. Only then will you start using Maps API to plot markers of those locations.
It sounds like you have no prior knowledge of any particular framework, so I'll outline how I would do it with Rails, which I believe to be easiest:
Build Omniauth into a new application, so that the user can sign in with Google. There are tutorials to assist you. The sign-in will result in an access token being stored in your database.
Add the latitude 'scope' to your omniauth implementation. The scope can be found in the latitude documentation, and the syntax to add it is found in the omniauth documentation.
For security reasons peculiar to latitude, you'll have to store the 'refresh token' that's supplied only on the first google sign-in for each user and exchange it hourly for a new access token as explained in the google oauth documentation.
Once you have a valid access token for each user at all times, you can use a library such as HTTParty to complete the GET described in the latitude documentation and retrieve a location.
Build a Google Map into a rails view as described in the Maps API documentation. In the controller action that processes that view, you can pass in the user locations for use as markers.
Good luck.

Related

Geo coding google maps API with udacity

I recently started a google maps API course with Udacity, one of the questions involves geocoding and I have hit a brick wall with it.
the task that I have asked to do is "Using geocode WEB SERVICE request in your browser find the fun place that the following coordinate describes"
the coordinates being LAT:33.1262476 LNG:-117.3115765 the videos on the course didn't go into to much detail.
Any help?
Read about Google's geocoding API, and in particular the reverse lookup of lat/long coordinates -> addresses and/or named locations.
https://developers.google.com/maps/documentation/geocoding/intro#reverse-example
For your case, it will be something like making a request to this URL:
https://maps.googleapis.com/maps/api/geocode/json?key=YOUR_API_KEY&latlng=33.1262476,-117.3115765
Note that YOUR_API_KEY is something you'll have to create by registering a Google developer account (which is free).

Nearby Places, Distance and Route between two places using Google Maps API for Web

I am developing a website which uses Google Maps place API to get an area from the user and need to show nearest restaurants, hotels,etc. I also need to show the distance and route between those places from the user selected area.
Can anyone help me to give some suggestions, links, or a tutorial to do that?
Well, I coundn't provide you all codes, but i can help you to build code, Kindly follow the following guidance. It might be help you.
Basically you required two APIs for this solutions:
1) Google Directions API
2) Google Places API
3) Javascript - GEOLocation (auto detect user location, Works if website hosted with ssl cert - https )
Step 1:
Here first you need to detect user current location from browser (using HTML5 navigator.geolocation ):
http://www.w3schools.com/html/html5_geolocation.asp
Step 2:
Now you required to search nearby hotels,restaurants, etc using Google Places API. Please check following doc where you can see that places api required location coordinates as a input and will respond you accordingly,
Web Service API Doc OR JavaScript API Doc
Step 3:
Directions API will works on between two points, So here it's better to build dynamic route between two Points (user location and particular restaurant/hotel/etc location) using Direction API. You can build route using marker click event.
Google Direction API - Javascript Example
I hope that i have tried to explain better as i can, Kindly ignore formatting and spelling mistakes, Just focus on step i given, Ignore other stuff!!

Can I get old photos use Google streetview API?

Recently, Google map could go back in time Street View by "TimeMachine".
I couldn't find the way in the APIs.
Is their TimeMachine parameter for change the time?
Have I any other way if we don't have API to get the data of "TimeMachine"?
For example, enter a URL of Street View directly.
To my knowledge, this is not possible using the API.
This feature request from the official Google Maps API bug tracker covers exactly this funcitonality:
Issue 6718: Feature Request: Access to Street View images from different times
It it open since May 2014.

Access locations in My Places of a particular account through Google Maps API

The Google Maps allow a user to add and group places in My Places. I would like to access the locations in a user's My Places programmatically instead of manually download the KML file. I did some search but could not find much helpful documentation or discussion on this topic. Apparently this is possible because this iOS app seems to be able to access it. The question is what Google Maps API or web services can provide this information?
No one answers this question. I found how to do it after a few days of search.
Use google client login to get access_token for scope https://maps.google.com/maps/feeds/. Search Using OAuth 2.0 for Client-side Applications for documentation.
Access google maps data with the access token at https://maps.google.com/maps/feeds/maps/default/full?access_token=xxx.

Google Places API vs AJAX Search API and Local Search Control

I've started developing a small app which main goal is to draw a map using Google Maps API (v3), and to show business in the area drawn (bars, restaurants and so on).
I found the Google Places API that was supposed to be released this month but it hasn't been. As far as I know the point of that API is to offer results from the Google's database of business, so later we could put those business in the map.
However now I've found this sample which is using the AJAX Search API and Local Search Control for Google Maps to do the same thing.
So the question is, what is the point of the new Google Places API?
Thank you in advance!
The Places API returns a list of locations near a specific lat/lng, while the Local Search API allows for an arbitrary search of Google's database of business listings and other POIs.