John Dyer

Technology and web development in curly bracket languages {Javascript, C#, ActionScript}

Google Maps (gmaps) :: DTS Church Search

by John Dyer 6. July 2005 09:00

For my first use of the newly released Google Maps API, I hooked up our database of churches with Dallas Seminary grads. We've had a "Find a church" list for a while, but this is much more helpful. Try it out:

The one problem I ran into was the number of flags that could be placed on a page. Below is a picture of what a map looks like with > 300 icons placed on it. It took my P4 3.2 with 1GB RAM about 2 minutes to load the map. It seems that around 50 is about right for a speedy map. Here's a snapshot of the map with tons of churches on it:

Dallas Seminary Find a Church with Google Maps

PS. I relied on Google Maps for geocoding. I wrote some code to lookup the latitude/longitude data for all the church addresses. After doing this, I found out that it might be possible to use geocoder for retreiving this data.

Comments

7/6/2005 9:56:53 AM # Unresolvable Unresolvable | Reply
John,



This site is simply incredible.  I've been playing around with Google Maps for leisure and have to ask... How did you get the distance information?  You are passing the radius and zip to another page, and getting back xml results, but how did you do it?



Thanks!
7/6/2005 10:26:23 AM # Unresolvable Unresolvable | Reply
Thanks for the compliments!



Google Maps works primarily with lat/long data instead of directly with addresses (<a href="mcmanus.typepad.com/.../...o_m.html">yahoo">mcmanus.typepad.com/.../...o_m.html">yahoo's map<a/> lets you use addresses directly). So if you want to use Google's API, you need to get lat/long info for all your addresses.  



Next, you need to have lat/long data for all US zip codes. There are several pay databases available with this information, but I found one <a href="http://www.cfdynamics.com/zipbase/">free">http://www.cfdynamics.com/zipbase/">free database</a> on <a href="www.codeproject.com/.../...pping.asp">Code">www.codeproject.com/.../...pping.asp">Code Project</a>.



When a user types in a zip code, the zip code's lat/long is looked up, then it is compared to the lat/long of all the addresses. You can calculate the distance in a few ways. You can just add the "radius" to the lat and long which makes a square. You can use a^2 + b^2 = c^2 to approximate the distance and get more of a circle (not totally accurate since the earth is a sphere). Or, you can actually use a lat/long distance formula, but it is harder to do a direct SQL query that way.



Hope that helps!



JD
7/9/2005 12:00:03 AM # Unresolvable Unresolvable | Reply
Check it out: All the churches in a 500 mile radius of my zip code with a Dallas Theological Seminary graduate as pastor. Well, sort of. It appears to be U.S. only, and I can tell you that most of Kansas, Missouri, Kentucky and farther south are definitely more than 500 miles away. But it's still cool. The DTS Church Search is a potential new feature for the DTS web site that they're currently testing. John Deyer blogged about setting it up and passed it along to us. It uses...
7/9/2005 2:55:34 AM # Unresolvable Unresolvable | Reply
Our little Google Maps experiment was featured on a few websites this week:



  Google Maps Mania

...
7/20/2005 11:56:09 PM # Unresolvable Unresolvable | Reply
A few weeks ago I went a little crazy

with the new Google Maps API. I also hooked it up to some pictures...
7/20/2005 11:56:41 PM # Unresolvable Unresolvable | Reply
A few weeks ago I went a little crazy

with the new Google Maps API. I also hooked it up to some pictures...
9/2/2006 4:11:23 AM # Unresolvable Unresolvable | Reply
John, did you write this in vb.net? I'd love to see some source code.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Web Statistics