problem with KML coordinates

62 views
Skip to first unread message

Katana.S

unread,
Jun 28, 2010, 6:43:08 AM6/28/10
to KML Developer Support - KML Server Side Scripting
Hi all

I'm developing a "dealer locator" website with a google maps window
i'm having a problem with KML file.
i've done a php file which outputs a simple KML file:
<?php
$kml = array('<?xml version="1.0" encoding="UTF-8"?>');
$kml[] = '<kml xmlns="http://www.opengis.net/kml/2.2">';
$kml[] = '<Placemark>';
$kml[] = ' <name>yyyyyy</name>';
$kml[] = ' <description>XXXXXXXX</description>';
$kml[] = ' <Point>';
$kml[] = ' <coordinates>+13.0166092,+43.8453231</coordinates>';
$kml[] = ' </Point>';
$kml[] = ' </Placemark>';
$kml[] = '</kml>';

$kmlOutput = join("\n", $kml);
header('Content-type: application/vnd.google-earth.kml+xml');
echo $kmlOutput;
?>

but if i copy & paste URL of this file (published on a reachable
server) on the google maps search bar, i get a reversed coordinate
marker.
If i reverse coordinates in the php file, i get the same result: my
marker has reversed coordinates.
If i copy&paste only coordinates from the file above into the search
bar, marker is placed correctly.

Where i am wrong??? please help me

Rossko

unread,
Jun 29, 2010, 12:37:07 PM6/29/10
to KML Developer Support - KML Server Side Scripting
> Where i am wrong??? please help me

No idea. What are you using to parse the KML? Google Maps uses lat
+long order internally, different to KML's long+lat, but so what ...
unless you have written your own parser.
Reply all
Reply to author
Forward
0 new messages