简体   繁体   中英

Set a label on a marker with iOS map links api

I'm trying to set a label on a map marker using the map links api. According to apple's docs if I use the 'q' param with the 'address' param it will take the 'q' param as a label. But I can't make it to work.

Blockquote The q parameter can also be used as a label if the location is explicitly defined in the ll or address parameters docs .

This is the url I've tried

http://maps.apple.com/?address=San+Jose&q=Blah

I want it to say 'Blah' as the marker's label.

Thanks.

I just ran into this issue and submitted a bug report to Apple. According to their docs, the combination of the q and address parameters should set the marker label to the value of q .

In the meantime, you can get this working by using the ll parameter:

http://maps.apple.com/?q=Blah&ll=34.0836834,-118.3468481

More on the ll parameter:

A comma-separated pair of floating point values that represent latitude and longitude (in that order).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM