Last Good Quote: Son's are the seasoning on our lives. - Someone on Facebook

Friday, September 20

Create Your Own Google Map

To create a google map do the following:

Get an Google Maps API Key, feel free to use your normal gmail account. Without this you can't use google maps.

Next insert this into the head of your html. Replacing "YOUR_KEY" with your key.


Next, create a map div tag. Where ever you put this code, is where the map will actually display. The width and height tags will dictate the width and height of the map. This can be included in any other div tag or HTML tag.


Next copy this bit of code in the bottom of your page. (Why the bottom? because it has to happen AFTER the divMap. There are ways around this. Hint: try creating an onload body event)



And that's it.

So of course your going what is this? 3.907787,-79.359741 ???

Those are geocodes, they map to a specific point on the earth's globe. If you want to map to an address you will have to convert the address to a geocode. Google does this as well, but its not so simple. So I'll save it for a whole other post.

In the mean time, use this.

0 comments:

Post a Comment

Followers