954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Google Maps & PHP Integration?

I'm not sure if this should be in this forum but I figured it was a good starting place. I am creating a database that, among other things, allows users to input a store's location (e.g. name, address, etc). Once a store has been added, there is an ability to go into a single store's "page" to view all of it's information including name, contact info, reviews, comments, etc. What I would really like is the ability for a Google Map to generate automatically when the page loads with the store's name and address listed (and pulled up in the window).

Does anyone have any idea as to how this might work or, better yet, anyone have any experience doing this first hand?

Thanks!

jrotunda85
Junior Poster
144 posts since Feb 2011
Reputation Points: 19
Solved Threads: 7
 
chrishea
Nearly a Posting Virtuoso
1,428 posts since Sep 2008
Reputation Points: 210
Solved Threads: 230
 

I believe this one has a simpler approach. What you need is two columns in your table latitude and longitude then just use them to insert a Google map with them as location. Before that get acquaintance with Google Map and make your own JavaScript function to make it easy for you (in order PHP to call only these functions with longitude / latitude). Of course after that you could make a step further adding what kind of icon you like for spot and what info for the bubble box in your database.

jkon
Posting Whiz in Training
281 posts since Jan 2009
Reputation Points: 77
Solved Threads: 47
 
I believe this one has a simpler approach. What you need is two columns in your table latitude and longitude then just use them to insert a Google map with them as location. Before that get acquaintance with Google Map and make your own JavaScript function to make it easy for you (in order PHP to call only these functions with longitude / latitude). Of course after that you could make a step further adding what kind of icon you like for spot and what info for the bubble box in your database.

I guess the next question then would be how to I figure out Longitude/Latitude based on a complete address?

jrotunda85
Junior Poster
144 posts since Feb 2011
Reputation Points: 19
Solved Threads: 7
 

You could do worse than look at the Google Maps API. I suppose you have a Google account. Example page: http://code.google.com/apis/maps/documentation/staticmaps/

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

Hi,

Its very simple you just need to create database in MySQL. Suppose your database will be as under.

You need to make database which contains following:

Store Name
Add1
Add2
City
Pincode
Latitude
Longitude

After creating and filling some data in it you need to Integrate google map in to your website which work based on Lan & Lon.

When ever the particular store link clicked, the Lat,and Lon retrieved based on store id and passed to Google Map to display marker at that Lat & Lon.

See the step by step tutorial How To integrate Google Map. On this tutorial Google Map implimantation explained with example.

keval_hack
Junior Poster in Training
Banned
66 posts since Jan 2010
Reputation Points: 8
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: