company logo  TIPS IT Consulting

                                                            Note: TIPS IT Consulting acquired TIPS BF Consulting on Jan. 6, 2011




Here is a sample how to call Google map with an address.
You are welcome to copy and paste this script into your editor.


<!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" xmlns:v="urn:schemas-microsoft-com:vml">
<head>

<title>Simple way to call Google Maps</title>
<script type="text/javascript">

function displayMap()
{
var origString = document.form1.addresstype.value;

alert("displayMap--" + origString);
var inCharComma = ",";
//alert("displayMap--" + inChar);
var outCharSpace = " ";
var newString = origString.split(inCharComma);
newString = newString.join(outCharSpace);
//alert("No comma displayMap--" + newString);
var inChar = " ";
var outChar = "+";
newString = newString.split(inChar);
newString = newString.join(outChar);
//alert("newString--" + newString);
window.location.href=("http://maps.google.com/?q=" + newString);
}

</script>
</head>

<form name="form1" method="post" action="">
Enter address:&nbsp;<input type="text" id="addresstype" size="50">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" onclick="displayMap()" value="Submit">
<br>
<br>
<div id="map_canvas" style="width: 700px; height: 500px"></div>
</form>
</body>
</html>