Page 1 of 1

Inline Map image

Posted: Tue Jun 28, 2005 12:29 pm
by sulen
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();

Posted: Tue Jun 28, 2005 12:50 pm
by wwwapu
It seems quite hard, but if you can figure out how images MAPDATA is done then sure

Code: Select all

http://image.maps.yahoo.com/mapimage?MAPDATA=FQxgoOd6wXVIvgmdxwt1.N6t4ehttf9DwFBJJtja6k3mgJ5vwfP9b4Njpwa_H_aZHFSbncZX2bKptLeyT6GEL4XfTyIDWTDaro.itA9dZ_TzVYF6T3lDsQqDykpKXlycSEayG8y.HW5sVd7O3ciRm8JxG7iYeQqhKo.t
But before you proceed read carefully
http://help.yahoo.com/help/us/maps/maps-24.html
To me it seems like they are saying a big no for this kind of action.

Posted: Tue Jun 28, 2005 12:51 pm
by sulen
I know ......... I thought of the same thing but the data passed for MAPdata seems too hard to decipher so was wondering if there was an easier way to do this ........ thanks