views:

1022

answers:

1

How does one force the iPhone map application to open when the link on a web page goes to maps.google.com/?q=http://example.com/mapdata.kml?

If I open the map application and specifically put http://example.com/mapdata.kml in the query box, all the data is loaded correctly. But if I use http://maps.google.com/?q=http%3A//example.com/mapdata.kml, the map application loads but no data is loaded and nothing is in the query box.

The typical queries work, like q=cupertino or q=[latitude,longitude]. It seems to be the kml link that's broken.

Has anyone gotten this to work? Is this supported? Do you have to URI encode the query?

Update: I'm upping the ante: the correct answer will get this premium, unused "Proud to be an AmerIcan" sticker that you'll most certainly need at your next cocktail party. I'll mail it to you.

alt text

+3  A: 

Your question interested me so I did a little looking around at the Apple URL Scheme Reference. It says the following:

Although the Maps application supports many of the Google Maps parameters and queries, it does not support them all. The rules for creating a valid map link are as follows:

The domain must be google.com and the subdomain must be maps or ditu.

The path must be /, /maps, /local, or /m if the query contains site as the key and local as the value.

The path cannot be /maps/*.

All parameters must be supported. See Table 1 for list of supported parameters.

A parameter cannot be q=* if the value is a URL (so KML is not picked up).

The parameters cannot include view=text or dirflg=r.

If I'm reading that right, it doesn't look like what you're wanting is supported, however, it's interesting that you can type the full kml URL into the maps app directly and have it work. That seems like a bug on Apple's part. I would just start throwing parameters at it and see what happens. That's always fun. ;-)

Best Regards,

p.s. That is a nice sticker. I'd prefer a bounty, but looks like you haven't racked up enough SO points to offer that yet. ;-)

Matt Long
Argh! I was afraid of that. And I had read the reference looking for an answer before but somehow glanced over that bit. I'll have to look for another method. But you answered the question so the sticker's yours if you want it. Email me at harry at-at harrylove.org. Cheers!
harrylove
Can I use "japanese" text "マクドナルド" as query string. Its not working. How to tackle this problem?
Satyam svv