PHPBuilder - MapQuest Maps



RSS Twitter
Snippets Other

MapQuest Maps

by: Nicholas LaDieu
|
March 21, 2002

Version: 1

Type: Function

Category: Other

License: GNU General Public License

Description: This function creates a url you can use in an image tag to pull up a mapquest map



<?
function get_map($street,$city,$state,$zip)
{
	$fd = fopen ("http://www.mapquest.com/maps/map.adp?".
	"country=US&address=".urlencode($street)."&city=".urlencode($city)."state=".urlencode($state)."&zipcode=".
	urlencode($zip)."&homesubmit.x=0&homesubmit.y=0", "r");
	while (!feof ($fd)) {
   	 $buffer .= fgets($fd, 4096);
    	//echo $buffer;
	}
	fclose ($fd);
	
	$ar=split("mq-mapgend.websys.aol.com",$buffer);
	$ar2=split(" width=356 height=249",$ar[1]);
	return "http://mq-mapgend.websys.aol.com".(substr($ar2[0],0,(strlen($ar2[0])-1)))."";;
}
?>

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Nicholas LaDieu

Comment:



Comment:

(Maximum characters: 1200). You have characters left.