go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  A slight variation
 
Subject: A slight variation
Author: WebSpider
In response to: That's it.
Posted on: 06/22/2009 01:42:54 PM

<!DOCTYPE html "-//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 type="text/javascript" src="http://maps.google.com/maps?
  file=api&v=2&sensor=false&key=
ABQIAAKLPDUET0Qt7v3VcSk6JNU1sBSM5jMcmVqUpI7aqV99cW1cHHCiThQYkcZUPRJn9vy_TWxWvuLbBfSGDw" 
></script> 

<script type="text/javascript"> 
function initialize() { 
	if (GBrowserIsCompatible()) { 
		var map = new GMap2(document.getElementById("map")); 
		map.setCenter(new GLatLng(37.4419, -122.1419), 8); 
		map.setUIToDefault(); 
	} 
} 
</script> 

</head> 


<body onload="initialize()" onunload="GUnload()"> 
	<div id="map" style="width: 550px; height: 450px"></div> 
</body> 


</html>



 

> On 06/19/2009 09:44:04 PM WebSpider wrote:

That's the all you need to display a google map in your website. Let's put those steps together.


<html>

  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Google Maps</title>
    <script  type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=
ABQIAAKLPDUET0Qt7v3VcSk6JNU1sBSM5jMcmVqUpI7aqV99cW1cHHCiThQYkcZUPRJn9vy_TWxWvuLbBfSGDw"></script>
  </head>


<body onunload="GUnload()">

    Google map goes here:

    <div id="map" style="width: 550px; height: 450px"></div>

    <script type="text/javascript">
      // Display the map, with the initial location 
      var map = new GMap2(document.getElementById("map"));
      map.setCenter(new GLatLng(37.4419, -122.1419), 8);
    </script>

</body>

</html>





References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.