I am trying to embed a Google Map into a dynamic webpage. The only variable the map depends on is the address of a business. That address es from the website's database. I cannot just statically generate embed code for each dynamic page using the same set up. Is there a way I can embed a map based on that address and show a marker/bubble showing Google's information on that business?
So far, I have explored a few options including using the Google Map API and the Google Data API or just messing with the embed code given by Google. If I use the APIs it seems I have to design my own types of markers and maybe even supply my own data.
It doesn't look like there is an easy solution.
Any ideas?
Thanks.
EDIT: I'm not hung up on going from an address to a longitude and a latitude. I want the info window or "bubble" for a marker to show Google's information of a business.
EDIT: On Roy's suggestion I have been trying to use the map and search API together to achieve what I want. However, the only way I can execute a search with searchControl.execute('business name here'); is if the SearchControl is drawn. Thing is though I don't want to show any search controls. I have been able to hide it, but that just seems like an inefficient hack way of solving this.
I am trying to embed a Google Map into a dynamic webpage. The only variable the map depends on is the address of a business. That address es from the website's database. I cannot just statically generate embed code for each dynamic page using the same set up. Is there a way I can embed a map based on that address and show a marker/bubble showing Google's information on that business?
So far, I have explored a few options including using the Google Map API and the Google Data API or just messing with the embed code given by Google. If I use the APIs it seems I have to design my own types of markers and maybe even supply my own data.
It doesn't look like there is an easy solution.
Any ideas?
Thanks.
EDIT: I'm not hung up on going from an address to a longitude and a latitude. I want the info window or "bubble" for a marker to show Google's information of a business.
EDIT: On Roy's suggestion I have been trying to use the map and search API together to achieve what I want. However, the only way I can execute a search with searchControl.execute('business name here'); is if the SearchControl is drawn. Thing is though I don't want to show any search controls. I have been able to hide it, but that just seems like an inefficient hack way of solving this.
Share Improve this question edited Mar 4, 2010 at 18:12 Will M asked Mar 4, 2010 at 15:50 Will MWill M 2,1454 gold badges22 silver badges32 bronze badges 2- Are you using the Javascript Maps API? The static images one? It sounds like this really shouldn't be too hard. Is your difficulty in generating marker coordinates from the address? – Matt Ball Commented Mar 4, 2010 at 15:52
- 1 I am the Javascript Maps API. I want the map to be interactive. My difficulty is not geocoding the address or business name. I just want Google's data to be used for the information "bubble" assigned to the location's map marker. – Will M Commented Mar 4, 2010 at 16:02
1 Answer
Reset to default 2Don't just use the embed code. Write a bit of Javascript that will draw a map for you and pass it the address.
Loads of examples here: http://code.google./apis/maps/documentation/examples/index.html
I'm not sure which bit you're stuck on, but you don't need to design your own markers. Google can also create a marker from an address and it can find local business information if it has it (using local search API I think).