开发者

iPhone link to map directions using string "current location" not lat and lng for saddr

I know there are numerous questions about how to construct a sharedApplication link to the maps app specifying the start and end address with coordinates. I've got that working no problem.

Has anyone found a way to link with a source address generically specified as "current location".

I ask because the scenario I'm working on having Core Location or a UIMapView would only be necessary in order to determine the user location prior to handing off to the map app where the user locating would seem to just happen again.

I've tried throwing UTF8'd "Current Location" and "[Current Location]" into the saddr parameter which amusingly starts from Current Montana. I've also tried simply excluding the saddr param.

I know this is often tread territory but thi开发者_JAVA技巧s particular situation wasn't covered by anything I found searching here or on mapki. Before I add the core location code I just wanted to make sure there wasn't a more limited way to tackle this.

Thanks


This post is quite old, but recently I had to face a similar issue and I developed a solution.

Using "Current Location" (properly escaped) as source address works perfectly. The downside is that "Current Location" is valid for English language only. If your iPhone is set to use another language, you need to know the exact translation that Apple chose for that particular language.

I wrote a class that can provide the exact translation for "Current Location" in any supported language. You can read my blog post about this.

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜