1
如何在URL上的新iOS 6 Maps上引入自定义标题(注释)?URL上的Apple Maps注释
{} http://maps.apple.com/?q=cupertino
所以,我该怎么做才能增加一个网站链接到这个iOS 6的地图自定义标题,并直接与自定义标题原生地图应用程序打开?
如何在URL上的新iOS 6 Maps上引入自定义标题(注释)?URL上的Apple Maps注释
{} http://maps.apple.com/?q=cupertino
所以,我该怎么做才能增加一个网站链接到这个iOS 6的地图自定义标题,并直接与自定义标题原生地图应用程序打开?
您并不一定需要使用自定义URL。 Apple为他们的iOS 6地图框架添加了一个名为MKMapItem的类。您将使用此类的方式是在将地图叠加层添加到地图应用程序时添加所需的必要信息。
下面是一个例子:
MKPlacemark *placemark=[[MKPlacemark alloc] initWithCoordinate:theCoordinate addressDictionary:theCoordinatePlaceDictionaryRepresentation];
MKMapItem *item=[[MKMapItem alloc] initWithPlacemark:placemark];
[item setName:theCustomTitleYouWant];
[item setPhoneNumber:phoneNumberIfAny];
[item setUrl:aWebSiteToThePlaceToVisitIfAny];
[item openInMapsWithLaunchOptions:aLaunchOptionDictionaryIfAny];
检查的启动选项字典中的键:
MKLaunchOptionsDirectionsModeKey; MKLaunchOptionsMapTypeKey; MKLaunchOptionsMapCenterKey; MKLaunchOptionsMapSpanKey; MKLaunchOptionsShowsTrafficKey;
它允许您自定义地图的外观和工作方式。
希望这会有所帮助。
编辑:这与本机iOS代码有关。你可以找到关于url链接的信息here
非常感谢你的帮助, 但我只想问你,请问我该如何补充? 它在页面的头部或什么?因为我不想在Safari浏览器中打开它,而是在本机iOS 6地图应用程序中打开它,所以我想将它添加到HTML页面或PHP中。 谢谢, – user2649642
请参阅编辑和新链接。 – J2theC