CodeAve.com(AddShape Center Pushpin - Print View)

AddShape Center Pushpin

This is an example of a simple map with a pin (a default pin) added at the center of the map using the addshape method. No longitude or lattitude coordinates are set for this example. The size of the map is set to 640 x 480.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>
CodeAve.com/Maps - AddShape Center Pushpin</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- add a META element with the charset attribute set to "utf-8", as follows Your page must use UTF-8 encoding to create some elements of the map -->
<!-- Reference to the map control -->
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2">
</script>
<script type="text/javascript">

// set the value of the varible map to null
var map = null;
// create a function to load the details of the map function
GetMap() {
// Initialize a new instance of the VEMap class
map = new VEMap('myMap');
// Load the specified map
map.LoadMap();
// set varible pin to VEShape/Type Pushpin with the center of the map as it's location var pin = new VEShape(VEShapeType.Pushpin,map.GetCenter());
// use addshape to add the pin map.AddShape(pin); } </script>
</head>
<!-- Run the
GetMap function to load the map into the page -->
<body bgcolor=#FFFFFF onload="
GetMap();">
<table align=center border=1>
<tr>
<td>
<!-- Add a DIV element to the page to contain the map and assign it a location and size-->
<div id='myMap' style="position:relative; width:640px; height:480px;">
</div>
<!-- If not specified a default width of 600 pixels is used and a default height is 400 pixels -->
</td>
</tr>
</table>
</body>
</html>


http://www.codeave.com/maps/code.asp?u_log=8701