How to add apple map marker via query string in the url?

二次信任 提交于 2019-12-12 09:43:02

问题


I want add map marker (like google map) in the map app when I use a url link to open the map on the iPhone from my app.

like this : <a href="http://maps.apple.com?ll=latitude,longtitude">

I can open the apple map and the map center is on the location I want, but how to add a marker at the same time? I am not sure how query string I can add on the url

I have already read the doc below

https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html#//apple_ref/doc/uid/TP40007899-CH5-SW1

Thanks in advance!


回答1:


If you wanna use internal map app (Apple Map), you should change your protocol for maps.

Like:

maps://maps.apple.com/?q={latitude},{longitude}

Now http://maps.apple.com query will redirect to google map :O




回答2:


I use this url format:

http://maps.apple.com/?ll={lat},{long}&z={zoom}&q={label+name}

The url opens the internal maps app in the position indicated with a marker that shows a label with the text indicated in querystring



来源:https://stackoverflow.com/questions/19740194/how-to-add-apple-map-marker-via-query-string-in-the-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!