Got it ! thank you so much Rossko and everyone who helped me found
out ! ;-)
 - I was actually having a "&" problem. I'm now catching the
"_render=" from yahoo pipes and rebuilding the url.
 - and I was also using the kml output from my pipe, instead of the
(geo)rss.
=> it now works great.
here is the code for those who would be interested in converting yahoo
pipes to google maps with custom icons.

You can also have a look on http://activitypedia.org (in French).

<?php

  function startElement($parser, $name, $attribs) {
    global $latitude, $longitude, $currentTag, $withinItem, $icon,
$kml;
    $currentTag = strtolower($name);
    switch ($currentTag) {

        case "item":
             $withinItem = true;
             $kml[] = "<Placemark>";
             if ($icon) {
               $kml[] = "<styleUrl>#icon</styleUrl>";
             }
             $latitude = 0;
             $longitude = 0;
             break;

        case "title":
             if ($withinItem) {
               $kml[] = "<name>";
             }
             break;

        case "description":
             if ($withinItem) {
               $kml[] = "<description>";
             }
             break;
    }
  }

  function endElement($parser, $name) {
    global $latitude, $longitude, $currentTag, $withinItem, $kml;
    switch (strtolower($name)) {

        case "item":
              $withinItem = false;
              $kml[] =   "<Point><coordinates>$longitude,$latitude,0</
coordinates></Point>";
              $kml[] = "</Placemark>";
              break;

        case "title":
              if ($withinItem) {
                $kml[] = "</name>";

              }
              break;

        case "description":
              if ($withinItem) {
                $kml[] = "</description>";
              }
              break;
    }
    $currentTag = "";
  }

  function characterData($parser, $data) {
    global $latitude, $longitude, $currentTag, $withinItem, $kml;
    switch ($currentTag) {

        case "item":
        case "title":
        case "description":
              if ($withinItem) {
                $kml[] = htmlspecialchars(trim($data));
              }
              break;

        case "geo:lat":
              $latitude = $data;
              break;

        case "geo:long":
              $longitude = $data;
              break;
    }
  }

$file = $_GET['url'];
$icon = $_GET["icon"];
$render = $_GET["_render"];
  if ($render) {
     $file=$file.'&_render='.$render;
  }
$currentTag = "";
$withinItem = false;
$latitude = 0;
$longitude = 0;

$kml = array();
$kml[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
$kml[] = "<kml xmlns=\"http://www.opengis.net/kml/2.2\";>";
$kml[] = "<Document>";

if ($icon) {
  $kml[] = "<Style id=\"icon\">";
  $kml[] =   "<IconStyle>";
  $kml[] =   "<scale>10</scale>";
  $kml[] =     "<Icon><href>$icon</href></Icon>";
  $kml[] =   "</IconStyle>";
  $kml[] = "</Style>";
}

$xmlParser = xml_parser_create();
xml_set_element_handler($xmlParser, "startElement", "endElement");
xml_set_character_data_handler($xmlParser, "characterData");

//Initialize the Curl session

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $file);
//Execute the fetch
$xml_data = curl_exec($ch);
curl_close($ch);

xml_parse($xmlParser, $xml_data, true);
xml_parser_free($xmlParser);

$kml[] = "</Document>";
$kml[] = "</kml>";

header("Content-Type: application/vnd.google-earth.kml
+xml;charset=UTF-8");
echo implode($kml);
?>

On 13 juil, 12:18, Rossko <[email protected]> wrote:
> The URL to get the data from 'pipes' has & encoded into it.  I'd be
> suspicious about how your php script is interpreting the GET
> parameters supplied to it, and then passing them on to yahoo.  Check
> what URL you actually call, you may need to de-encode it.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to