Jump to content

Using Google Maps API in dynamic webpage


nmrudolph

Recommended Posts

I'm not a new comer to web design, but to date all of my experience has been in content management based systems (Joomla, Wordpress etc...)

 

I was recently approached by a client to add a page to his existing website and after some research I think that using Google Maps API would be the easiest way to implement what he needs.

 

Basically he wants to have a map of the USA with an icon for each of his office locations. (There are about 70 across the states) Once clicked on, each of the locations will pop up with all the info for that office, and if there are any job openings there. I would like for it to be all in one page, dynamically changing as the user manipulates the map. I found the perfect example for this at ZipCar.com

 

http://www.zipcar.com/nyc/find-cars

 

Everything fits within one simple page, the user can zoom in and out, and all the pertinent information shows up with along the side without anything reloading.

 

I was basically hoping someone could point me in the right direction as to the steps that would be needed to get this done. I don't want someone to hold my hand through the whole process, I'm just fairly new to PHP and HTML and wondering what all will be involved with completing a project like this.

 

Consider my first born child yours for the person who can help me out with this...

Link to comment
Share on other sites

Ahhh, I've used the Google Maps API quite a bit.

 

I'm not sure how much you know about the web programming world, but if you're new to javascript, that'll be an absolute must if you want to use the Google Maps API.  So check out a tutorial on tizag.com or w3schools.com

 

If you're interested in doing this project right, I'd recommend learning the MooTools javascript framework and developing your code in OOP.  But that's advanced and not really necessary if you're a beginner to this stuff.  It is easier to code with, though, once you get the hang of it.

 

If/when you've got javascript down, check out the Google Maps API V3 (V2 was recently deprecated).  Get an API key/install it and then open up the developer's guide.

 

For updating the map dynamically when the user interacts with the form, add an event listener to the form (onSubmit, for example) and tie it to a function that'll update the map.

 

The icons that would represent his office locations are called "markers"--they're in the developer guide.

Link to comment
Share on other sites

That's exactly the kind of help I was looking for. I guess it's finally time for me to actually learn some java.

 

java and javascript are two totally different beasts. no need to learn any java for the google maps stuff.

 

when you start writing the javascript, one of the things you'll need to deal with is *where* to put your code. check out this site:

 

http://spotwalla.com

 

view any public trip and then view the source html. you'll find just about everything you need to get through your project. each time a user views a trip, the database is queried for the location data and the html/javascript is generated dynamically.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.