getting maps to accept a dynamically generated KML file?
Posted
by arc
on Stack Overflow
See other posts from Stack Overflow
or by arc
Published on 2010-03-18T15:19:07Z
Indexed on
2010/03/18
15:21 UTC
Read the original article
Hit count: 312
Hi.
I have a button that launches the google maps app on my device via an intent. I want to be able to pass it a php page that generates a KML file.
I have done this on a website before using the googlemaps api in JS - but it doesn't seem to work on Android.
My php file is as follows;
<?php
echo '<kml xmlns="http://www.google.com/earth/kml/2">';
echo '<Placemark>';
echo '<name>Google Inc.</name>';
echo '<description>1600 Amphitheatre Parkway, Mountain View, CA 94043</description>';
echo '<Point>';
echo '<coordinates>-122.0841430, 37.4219720, 0</coordinates>';
echo '</Point>';
echo '</Placemark>';
echo '</kml>';
?>
Launching with:
final Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("geo:0,0?q=http://website.com/kml_gen.php"));
startActivity(myIntent);
It launches maps, finds the file - but won't display it 'because it contains errors'.
Is this just not possible, or are there other ways to construct the intent that might work?
© Stack Overflow or respective owner