Open the iPhone app with a link to Google maps using KML as a request

How do I get the iPhone map application to open when the link on the webpage 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 request field, all data will be loaded correctly. But if I use http://maps.google.com/?q=http://example.com/mapdata.kml , the map application loads, but the data does not load, and nothing is contained in the query window.

Typical queries work, for example q = cupertino or q = [latitude, longitude]. Broken kml link seems to be.

Has anyone got this to work? Is it supported? Does a URI need to encode a request?

+6
iphone maps google-maps
source share
3 answers

Your question interested me, so I examined the Apple URL Schema Link a bit. This says the following:

Although the Maps application supports many of the options and queries for Google Maps, it does not support all of them. 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 request contains site as the key and local as the value.

The path cannot be / maps / *.

All parameters must be supported. Table 1 lists the supported options.

The parameter cannot be q = * if the value is a URL (therefore KML is not selected).

Parameters cannot include view = text or dirflg = r.

If I understood correctly, this does not seem like what you want, supported, however it is interesting that you can directly enter the complete kml URL into the map application and make it work. This seems like a bug in the Apple part. I would just start throwing options at it and see what happens. It is always fun. ;-)

Yours faithfully,

PS This is a good sticker. I would prefer a reward, but it looks like you have not scored enough SO points to offer this. ;-)

+7
source share

This link will do what you want

<a href="maps:q=http://example.com/mapdata.kml"> 

but it will only work on iOS, so make sure you check the user agent, etc., and use the normal map URL on non-iOS

 <a href="http://maps.google.com?q=http://example.com/mapdata.kml"> 
+2
source share

URL maps in simplest form

maps: Q = GivenTitle @ latitude, longitude

0
source share

All Articles