Learn the Google Maps API in a hurry

By | | Web Tech

(Via Flash Insider, Google Maps Mania) SFSurvey.com, a restaurant review site, has produced a sample script and accompanying video tutorial that lets you integrate Google Maps into your website using the Google Maps API. The sample script lets you build a database of locations that you can click on to display dynamic Google Maps on your site.

The good news: the video tutorial is ideal for those of you who have been “meaning to learn Google Maps” and just don’t have time to work through a detailed article on the subject.

The bad news: the script presented by the tutorial is written in ASP and uses Access for the database, rather than more current choices like PHP/MySQL or ASP.NET/MSDE. The code, which is presented in Dreamweaver, is downright scary from a best practices point of view, too… but I guess if you’re using ASP that’s not your biggest concern.

Still, it’s a good way to get a bird’s eye view (if you’ll pardon the expression) of the Google Maps API.

Visit the tutorial page to get started. Remember, there is a video for each of the two steps of the tutorial–I was a little confused at the end of the first video, which made it sound like the end of the whole tutorial.

Written By:

Kevin Yank

Kevin began developing for the Web in 1995 and is a highly respected technical author. He wrote Build your own Database Driven Website using PHP and MySQL, a practical step-by-step guide published by SitePoint, and he's co-author of the SitePoint Tech Times, a bi-weekly newsletter for technically-minded web developers. Kev believes that any good webmaster should have seen at least one episode of MacGyver.

Website
>> More Posts By Kevin Yank

 

{ 23 comments }

anoop April 18, 2009 at 4:06 pm

can any one help me to integrate google map in vb.net…i dont want to use asp.net nor flash nor javascript…is it possible to integrate google map???? please reply to this post or mail me at anooopfriend4u@gmail.com
and also tell me is it requried to have google earth to create a kml file???if not requried then how to create it

Tanapon November 21, 2008 at 5:22 pm

Please see how I use google map in my business directory website:-)

http://www.yourplacemark.com

Your comment is really important to improve it!

Best Regards,

Audy
Tanapon Arsakit

Anonymous September 27, 2008 at 6:14 am

Patronising Nob

Ravi April 4, 2008 at 4:55 pm

how to get client location in c#

edr September 27, 2005 at 9:25 pm

Just a quick note to mention that the snipe at ASP developers is not appreciated. Not everyone uses PHP and MySQL as their development platform and there are plenty of ASP and .NET coders bent on developing to standards as much as the next guy. There is nothing about coding in ASP that automatically puts you in a camp of developers without concern for best practices. I agree the code style in this sample leaves much to be desired, but had it been written in PHP would that mention have even been made?

kalin September 21, 2005 at 10:37 am

on http://www.topspot-ornot.com there is a nice project which makes a combination of google maps, hotornot and wikipedia. i found a lot of cool hacks of the google maps api in there. they did quite neat things with the info windows and the markers

Ryan September 18, 2005 at 8:08 pm

I noticed some people were asking how to implement the Google Maps API using PHP. I did the PHP implementation of Google Maps at GymPost.com, which I think is a pretty polished an advanced implementation. If you have specific questions, please email me using the “Contact Us” form accessible in the header and I’ll try to respond.

This implementation uses AJAX, XML, and a number of the API tools.

Ryan
http://www.gympost.com

MarkB September 7, 2005 at 3:38 am

Hey Michael – thanks for the info.

I neglected to mention I wanted it for the UK (although US would be useful, too).

Thanks :)
Mark

michaelphipps September 6, 2005 at 8:18 pm

Does anyone know how to use the API, and generate the Long/Lat values from just a postcode?

I haven’t used the api, but I have found databases with lat/long values, and cities, which could be combined with city / postcode info.

Depends where you are – in Australia, that information will cost you around $1500 (that’s the cheapest I could find – if anyone knows of a cheaper alternative I’d love to hear about it). For America I stumbled across a free worldwide lat / long / city database, but I don’t think it really does anywhere outside America very accurately.

Let me know if you want more details.

dschultz September 6, 2005 at 1:27 pm

If you go here: http://www.flashearth.com, you can actually grab some source code that lets you do this all from within flash (no server side required). There is also a free online webservice available here that will take a US location (i.e 123 Broadway, New York) and return long / lat. Try it out it’s pretty sweet!

amelvin1968 September 5, 2005 at 6:41 am

It’s easy to criticise but if the code works and is for demonstration purposes why is the coding even mentioned?

Well done, Wayne Lambright, I intend to use the expression ‘version one is better than version none’ repeatedly from now on – it is something of an extension of my favourite Calvin Coolidge quote about persistence being more important than talent, genius or education.

From the comments it’s clear that there are a lot of talented geniuses out there who are a bit too quick to sneer.

csi95 September 2, 2005 at 10:13 pm

but I guess if you’re using ASP that’s not your biggest concern.

Such ignorance.

Wayne Lambright -map creator September 2, 2005 at 12:23 pm

Hello and thanks for your comments about the google maps.

My goal was to get the maps working, and that they do. Is the code scary? Only if you don’t understand it, could it have been written better? Absolutely. Will I write a better commented, more conscience version? Probably.

For your consideration I have a philosophy when it comes to new features. “Version 1, is better then version none!“

Cheers

Wayne lambright
Sfsurvey.com

digitalbart September 1, 2005 at 12:44 pm

In case anyone is interested there is a php program already for this:
Phoogle Maps

Marcus Tucker September 1, 2005 at 11:40 am

Yes, absolutely dire ASP code there, shockingly bad.

However, I am intrigued by the rather flippant line

but I guess if you’re using ASP that’s not your biggest concern.

So what *should* my biggest concern be, as someone who has always written functional, modular, efficient and scalable web applications using ASP (and still does)?

MarkB September 1, 2005 at 11:31 am

(Not entirely off-topic, but…) Does anyone know how to use the API, and generate the Long/Lat values from just a postcode?

flyingpylon September 1, 2005 at 10:44 am

The code, which is presented in Dreamweaver, is downright scary from a best practices point of view, too… but I guess if you’re using ASP that’s not your biggest concern.

Sorry, but that’s just a really stupid comment. If the code is bad, then say so and leave it at that.

Halo-13 September 1, 2005 at 10:41 am

I wondered if this was possible… but i’m not an ASP guy so I will have to watch out for a PHP version.

Chicago Pete September 1, 2005 at 8:26 am

Hey,
Any chance of anyone posting information on how to pull this off using PHP? My friend and I have a server that has Apache and PHP. Thanks in advance.

Chicago Pete

oldwebgeek September 1, 2005 at 7:45 am

I have to admin, I was slightly stunned by the coding style portrayed in this tutorial. Not all ASP code is written like that.

WebDevGuy September 1, 2005 at 6:49 am

This is cool stuff. I’d like to see a PHP tutorial where you already have the lat/long and just need to incorporate the map into your app.

Dr Livingston September 1, 2005 at 5:11 am

> The bad news: the script presented by the tutorial is written in ASP and uses Access for the database,

:lol: … much later … :lol:

> but I guess if you’re using ASP that’s not your biggest concern.

Nope, I don’t suppose it would be ;) One concern would be why your still using ASP in the first place :lol:

Interesting blogs btw Kevin, Google seams to be doing some ground breaking stuff nowadays huh

RaS! September 1, 2005 at 3:48 am

Oh well, the script presented is so simple that lots of coder won’t have difficult to port it in PHP… :)

Comments on this entry are closed.