Archive for the ‘Google Maps Javascript API’ Category

Google Maps Continued

November 8, 2006

I have found a few sites like this now that take you through the procedure of including maps and things within your website and that also give you the code to copy and paste. I think this is really good and I am hoping that I will be able to find a site with the scripting, code and instructions to use for some of the things I want to include within my project so I will keep looking.

Google Maps JavaScript API

November 8, 2006

While looking at Google maps I dug a little bit deeper within the site and found their JavaScript API for embedding a Google map within your website. The site takes you through a detailed guide of how to include the map and gives you the scripting to do so. The only problem is it says you need to know about JavaScript programming to be able to follow the guide and I don’t have a clue at the moment. The site also provides you with the code for adding things such as controls to the map.

Example of script from Google Maps JavaScript API website:

The “Hello, World” of Google MapsThe easiest way to start learning about this API is to see a simple example. The following web page displays a 500×300 map centered on Palo Alto, California:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>

<meta http-equiv=”content-type” content=”text/html; charset=utf-8″/>

<title>Google Maps JavaScript API Example</title>

<script src=”http://maps.google.com/maps?file=api&v=2&key=abcdefg” mce_src=”http://maps.google.com/maps?file=api&v=2&key=abcdefg”

type=”text/javascript”></script>

<script type=”text/javascript”>

//<![CDATA[

function load() {

if (GBrowserIsCompatible()) {

var map = new GMap2(document.getElementById("map"));

map.setCenter(new GLatLng(37.4419, -122.1419), 13);

}

}

//]]>

</script>

</head>

<body onload=”load()” onunload=”GUnload()”>

<div id=”map” style=”width: 500px; height: 300px”></div>

</body>

</html>

Bibliography:

Websites: