[英]Apple maps cant locate an address,IOS6
Out應用程序正在調用Apple地圖以在地圖上查找地址,這就是我們向地圖發送地址的方式
http://maps.apple.com/?q=1858 East Pike Street,(Old Route 50),Clarksburg,WV 26302 (Harry Green Chevrolet)&ll=39.278,-80.299
上面寫着“找不到數據錯誤! 但是在Google地圖上可以找到相同的位置有人可以建議我如何在Apple地圖上找到提到的位置嗎?
首先,測試獨立的Apple Maps應用程序是否真的可以識別輸入的地址。 如果沒有,請使用獨立應用程序,直到找出導致服務混亂的原因。 Google為其提供服務的時間已經更長……而且,它們是一家搜索公司-很自然,他們的專業知識包括高級語言處理。
第二點,我還建議您使用新的iOS 6 API打開地圖。 這就是我從坐標路由的方式。
// if you know the coordinates:
MKPlacemark * srcPlacemark =
[[[MKPlacemark alloc] initWithCoordinate:src
addressDictionary:[NSDictionary dictionary]] autorelease];
MKMapItem * srcObj = [[[MKMapItem alloc] initWithPlacemark:srcPlacemark] autorelease];
// alternatively, if you want to use "user's current location":
// MKMapItem * srcObj = [MKMapItem mapItemForCurrentLocation];
// if you know the address:
NSDictionary * dstDict = [NSDictionary dictionaryWithObjectsAndKeys:
self.addressLabel.text, kABPersonAddressStreetKey,
self.city ? self.city : @"", kABPersonAddressCityKey,
self.country ? self.country : @"", kABPersonAddressCountryKey,
nil];
MKPlacemark * dstPlacemark = [[[MKPlacemark alloc] initWithCoordinate:dst addressDictionary:dstDict] autorelease];
MKMapItem * dstObj = [[[MKMapItem alloc] initWithPlacemark:dstPlacemark] autorelease];
return [MKMapItem openMapsWithItems:[NSArray arrayWithObjects:srcObj, dstObj, nil]
launchOptions:[NSDictionary dictionaryWithObject:MKLaunchOptionsDirectionsModeDriving
forKey:MKLaunchOptionsDirectionsModeKey]];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.