Inline Map image
Posted: Tue Jun 28, 2005 12:29 pm
I have a PHP class and method that will take an address as input and strip it down to provide a link to the map of the location on yahoo maps. Now i was wondering if there is any way I can make that image inline so people dont have to actually click on the link to view the map. Let me know if there is a way. Any help will be appreciated. Thanks
Code: Select all
class Map {
var $addr;
var $csz;
var $country;
var $base_link = "http://maps.yahoo.com/maps_result";
var $link;
function Map() {
$this->addr = $_POST['address'];
$this->csz = $_POST['csz'];
$this->country = $_POST['country'];
$this->link = $this->base_link .
$this->parseURL(
array('addr'=>$this->addr,
'csz'=>$this->csz,
'country'=>$this->country,
'new'=>'1')
);
}
function parseURL($array) {
$output = '?';
$first = true;
foreach($array as $key => $value) {
if (!$first) {
$output .= '&';
} else {
$first = false;
}
$output .= $key;
$output .= '=';
$output .= urlencode($value);
}
return $output;
}
function displayLink() {
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Link to the Map</title>
</head><body>
<p>address - <?=$_POST[address]?></p>
<p><a href="<?php echo $this->link; ?>" class="five">Link to the Map</a></p>
</body></html>
<?
}
}
$map = new Map;
$map->displayLink();