Looks like it can be done with no geo-coding
http://code.google.com/apis/kml/documentation/kmlreference.html#address
header('Content-type: application/vnd.google-earth.kml+xml');
utf8_encode() the xml

Example q=*.kml working
http://maps.google.com/maps?q=http://code.google.com/apis/kml/documentat...

Something like this should work if in a kml file with the correct info; If the lat/long is there I should include it.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
	<Folder>
		<name>Addresses</name>
		<Placemark>
			<name>Space Needle</name>
			<address>400 Broad St 98109</address>
		</Placemark>

		<Placemark>
			<name>Whitehouse</name>
			<address>1600 Pennsylvania Ave NW 20006</address>
		</Placemark>
	</Folder>
</Document>
</kml>

Comments

mikeytown2’s picture

Status: Active » Closed (won't fix)

Lame... google requires lat/long in order for this to work.

This works because there is a point.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
	<name>test2.kml</name>
	<Folder>
		<name>Addresses</name>
		<Placemark>
			<name>Space Needle</name>
			<address>400 Broad St 98109</address>
			<Point>
				<coordinates>-122.348406,47.620137,0</coordinates>
			</Point>
		</Placemark>
		<Placemark>
			<name>Whitehouse</name>
			<address>1600 Pennsylvania Ave NW 20006</address>
			<Point>
				<coordinates>-77.036455,38.897596,0</coordinates>
			</Point>
		</Placemark>
	</Folder>
</Document>
</kml>

It also displays this warning when viewing the map

The content displayed below and overlaid onto this map is provided by a third party, and Google is not responsible for it. Information you enter below may become available to the third party.

So much for simple driving directions kml file stuff. I wouldn't enter my address if I saw that warning.