简体   繁体   English

使用iOS地图链接API在标记上设置标签

[英]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. 我正在尝试使用地图链接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. 根据苹果公司的文档,如果我将“ q”参数与“ address”参数一起使用,它将以“ q”参数作为标签。 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 . 如果在ll或address参数docs中明确定义了位置,则q参数也可以用作标签。

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. 我要说“ Blah”作为标记的标签。

Thanks. 谢谢。

I just ran into this issue and submitted a bug report to Apple. 我刚遇到这个问题,并向Apple提交了错误报告。 According to their docs, the combination of the q and address parameters should set the marker label to the value of q . 根据他们的文档, qaddress参数的组合应将标记标签设置为q的值。

In the meantime, you can get this working by using the ll parameter: 在此期间,您可以使用ll参数来使其工作:

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

More on the ll parameter: 有关ll参数的更多信息:

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 https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html#//apple_ref/doc/uid/TP40007899-CH5-SW1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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