Location: PHPKode > scripts > Zip2Map, map your zip code > zip2map/map.htm
<!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>Zip2Map</title>
	<script language="JavaScript" type="text/javascript" src="js/jquery-latest.pack.js"></script>
<script language="JavaScript" type="text/javascript" src="js/y-news.js"></script>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAn8Pod4rAwvWPEKtM6ASglBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQv__cNJ2VCnluyOLQt8jHoNqnM6Q"
      type="text/javascript"></script>
	  <!--<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAn8Pod4rAwvWPEKtM6ASglBTBKXkwsf0xdgPnvkQrIpwNb8OPbxQYBDBIba-2WEmldQbOjvunL2ocVQ"
      type="text/javascript"></script>-->
    <script type="text/javascript">

    //<![CDATA[

    function loadMap(lat, long) {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl());
        map.setCenter(new GLatLng(lat, long), 13);
      }
    }

	function jumpMap(d)
	{
		//alert(d);
		if(d!='-1')
		{
		//alert();
		d = d.split(',');
		//loadMap(d[0], d[1]);
		if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
		map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		map.addControl(new GOverviewMapControl());
        map.setCenter(new GLatLng(d[0], d[1]), 13);
/*		var mgrOptions = { borderPadding: 50, maxZoom: 15, trackMarkers: true };
		var mgr = new GMarkerManager(map, mgrOptions);
		var posn = new GLatLng(d[0], d[1]);
		mgr.addMarkers(posn, 8);
  		mgr.refresh();*/
		//getNews(d[2]+'+'+d[3]);
		//searchYahoo(d[2]+'+'+d[3]);
		//alert(newsResults);
		var infoTabs = [
		  new GInfoWindowTab("Place", d[2]+', '+d[3]+'<br />'+d[0]+','+d[1]),
		  new GInfoWindowTab("News", "<div align='left' id='ynews'><img src='images/ajax-loader.gif' alt='Loading . . .' /></div>")
		];

		var marker = new GMarker(map.getCenter(), {title:"Click to view details!"});
		  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowTabsHtml(infoTabs, {onOpenFn: searchYahoo(d[2]+' '+d[4])});

  });
		
		map.addOverlay(marker);

		//map.openInfoWindow(map.getCenter(), document.createTextNode(''+d[2]+', '+d[4]+'\n'+d[0]+','+d[1]));
		
		
		//var marker = new GMarker(center, {draggable: true});
		//map.addOverlay(marker);
		}
		}
		else
		{
		alert('Sorry! this zip is not available.');
		}
		$('#loading').hide();
	}
	/*function getNews(newsStr)
	{
	$.getJSON('http://search.yahooapis.com/NewsSearchService/V1/newsSearch?appid=gautam&query='+newsStr+'&results=5&language=en&output=json', function(jsn){getData(jsn);});
	}
	function getData(ynj)
	{
		//alert(ynj);
		var news = '<ul>';
		//alert(ynj.ResultSet.Result[0].Title);
		for(i=0;i<ynj.ResultSet.Result.length;i++)
		{
			news += '<li><a target="_blank" href="'+ ynj.ResultSet.Result[i].Url +'">'+ynj.ResultSet.Result[i].Title + '</a></li>'
		}
		//alert(ynj.ResultSet[0].Result[0].Title);
		//alert(ynj.parseJSON());
		//alert();
		news += '</ul>';
		//$('body').html(news);
		//alert(news);
		return news;
	}*/
    //]]>
    </script>
    <link href="css/mapStyle.css" rel="stylesheet" type="text/css" />
</head>
  <body onload="loadMap(37.4419, -122.1419)" onunload="GUnload()"> 
     <div id="topMost">
      <a href="http://www.eulogik.com"><img src="images/zip2map-logo.jpg"  alt="Zip2Map | map your zip code" name="zip2mapLogo" width="300" border="0" id="zip2mapLogo" title="Zip2Map | map your zip code" /></a><!--Zip<span class="style1">2</span>Map&nbsp;&nbsp;|<span id="h12">&nbsp;&nbsp;map your zip code</span> -->
  </div>
  <div id="content" align="center">

    <div id="top">
     <!-- <form id="form1" method="post" action="">-->
        <table width="100%" border="0" cellspacing="0" cellpadding="3">
          <tr>
            <td align="center"><form action="" onsubmit="$('#loading').show();$.get('getMap.php?zipCode='+$('#zipCode').val(), function(data){jumpMap(data);});return false;">
<input name="zipCode" type="text" id="zipCode" size="10" maxlength="5" />
            <input name="goButt" type="submit" id="goButt" onclick="" value="Go" />
</form></td>
            <td width="20" align="center"><img id="loading" style="display:none" src="images/ajax-loader.gif" alt="" width="16" height="16" /></td>
          </tr>
          <tr>
            <td colspan="2" align="center">(U.S. Cities only, e.g. 35043)</td>
          </tr>
        </table>
   <!--   </form>-->
    </div>
    <div id="map"></div>
  </div><br />
<br />
<br />

  <div id="hid">
    <div align="center">©<a href="http://www.eulogik.com">Eulogik</a> ,2007</div>
  </div>
  </body>
</html>
Return current item: Zip2Map, map your zip code