Learn the Google Maps API in a hurry

(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.

Win an Annual Membership to Learnable,

SitePoint's Learning Platform

  • http://www.errewf.it RaS!

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

  • Dr Livingston

    > 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

  • WebDevGuy

    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.

  • http://webdescant.blogspot.com/ oldwebgeek

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

  • Chicago Pete

    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

  • http://www.projectet.com Halo-13

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

  • http://www.flyingpylon.com flyingpylon

    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.

  • MarkB

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

  • Marcus Tucker

    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)?

  • http://www.digitalbart.com digitalbart

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

  • Wayne Lambright -map creator

    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

  • http://www.chameleon-systems.com csi95

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

    Such ignorance.

  • http://www.squarefootball.net amelvin1968

    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.

  • http://www.davidschultz.org dschultz

    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!

  • http://michaelphipps.com michaelphipps

    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.

  • MarkB

    Hey Michael – thanks for the info.

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

    Thanks :)
    Mark

  • Ryan

    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

  • kalin

    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

  • edr

    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?

  • Ravi

    how to get client location in c#

  • Anonymous

    Patronising Nob

  • Tanapon

    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

  • anoop

    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