Thursday, January 26, 2012

Populate a google map with data from a mysql database?

OK, I've got a MySQL database with pieces of data (zip codes) that I would like to show on a google map. I have an API, I just have no clue how to show this. It's for internal uses at the moment (I want a visual of where our customers are located by zip in the US), so it doesn't need to be fancy.



I know very little about working with API's, but I do have the logins for the database. Is their any fancy application or easy tutorial that will allow me to show this data easily on a google map?



Thanks~!Populate a google map with data from a mysql database?
You need to write server-side code (CGI, Java, ASP, whatever) that serves up the content. (Or use something like Ruby on Rails to make the data-delivery easier)



And you'll need to write client-side javascript to place the data on the map. (see google maps api link)



Hopefully your table has latitude/longitude data in it (if not, you'll have to Geocode the results), and if so you can take the lat/long pairs and create GMarkers for each point that you want to show.



The main API classes you'll need are GMap2, GMarker, and GLatLong.



Happy mapping!
  • cheap cosmetics
  • No comments:

    Post a Comment