Jonathan
Jonathan

Reputation: 710

How can I put Google map markers with info windows on my personal map?

I am building a website where students at my university can find housing (check it out at www.thehousingspot.com). I want to be able to add a layer onto the map that shows the location of local restaurants, gas stations, grocery stores, and entertainment hot spots so that students can see what's in the vicinity of the place they're looking to live.

Now, I recognize that I could build a database with the local locations just like what I have already done with the housing data. However, I would prefer to have my website pull the data down from Google, with all of the review information and everything that shows up in the info window when you click on it. Is anyone aware of a way that I could do this? Does google have an API for this that I've been blind to find?

Upvotes: 0

Views: 734

Answers (2)

Jonathan
Jonathan

Reputation: 710

Ok, I figured it out. Here's what I did:

  1. Turn off the regular points of interest on the map, as discussed here
  2. Apply and obtain a Google API key. After getting the key, enable the Google Places API
  3. Use the Places Search Request to check to find information about the advertiser. Mainly, what I get from this request is a Reference ID that I can use to validate that the information that I want matches what Google is supplying. What I mean by this is if I wanted to find the information for a local pizza joint, I do the search request to see if they have it in Google's database. When I get the response, I look at the data they have (like the name, address, etc.) to see if it matches the local advertiser information.
  4. If everything matches up, then I can use the Reference ID I retrieved from the previous query to get details about the place (Place Detail Response) as a JSON object and use that to recreate the pop-up window on my custom map, just like they have it on google maps. This detailed information includes everything from owner data to websites to reviews to hours of operation. It's pretty awesome.

Let me know if you have questions - I'd be glad to help. 8 hours of research, paid in full.

Upvotes: 2

Mark Willis
Mark Willis

Reputation: 1741

Google already places its own google places information in made maps. You would need to find a service provider or some fusion tables with the data already loaded to get the data to put on your map

Upvotes: 0

Related Questions