Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 785
Ofir D Avatar asked Aug 09 '16 15:08

Ofir D


People also ask

How do I create a label in Apple Maps?

Show labels in satellite view: Click the Map button in the toolbar, click Satellite, then select Labels.

What property is used to define the location of a marker?

The anchor property is required in order for the marker to render correctly when the zoom level changes. Learn more about using Symbols to create vector-based icons for markers (and polylines).


1 Answers

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

like image 121
Zach Avatar answered Oct 10 '22 16:10

Zach