2013-08-26 48 views
1

蘋果採取了從ios的谷歌地圖6.0版onwards.Apple使用的MKMapView那還不是那麼清晰的像谷歌map..I使用GoogleMapOverlay它顯示在谷歌地圖中的MkMapView..GoogleMapOverlay顯示我想要使用經緯度移動到特定位置的worldMap ...如果我在GoogleMapOverlay中指定緯度和經度位置,例如我將矩形形狀疊加在後面的特定位置,我可以看到我的mkmapview ......任何一個可以請指導我解決this..Thank你如何在iOS 6.0及以上版本的谷歌地圖

回答

1

您可以通過添加一個UIWebView並在其上添加地圖用在iOS 6谷歌地圖。

1

您可以使用谷歌地圖的SDK> = iOS6的

https://developers.google.com/maps/documentation/ios/

here is sample code from google sdk ios 

#import "YourViewController.h" 
#import <GoogleMaps/GoogleMaps.h> 

@implementation YourViewController { 
    GMSMapView *mapView_; 
} 

// You don't need to modify the default initWithNibName:bundle: method. 

- (void)loadView { 
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:24.451794 longitude:54.391412 zoom:12]; 
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera]; 
mapView_.myLocationEnabled = YES; 
self.view = mapView_; 
GMSMarker *marker = [[GMSMarker alloc] init]; 
marker.position=CLLocationCoordinate2DMake(24.451794,54.391412); 
marker.snippet = @"Abu Dhabi"; 
marker.title = @"Al Jazira Sports and Cultural Club"; 
marker.map = mapView_; 
} 


@end 
output: 

enter image description here

+0

@ Pradeep-我用谷歌地圖SDK適用於iOS 6.O只有遵循這個鏈接..我可以看到在我的模擬器的谷歌地圖,但在iPad設備觀看它的應用程序關閉它只是... IPAD設備SDK版本 - 6.1.3 – Vaishu

+0

能否請您粘貼代碼,這樣我可以檢查出了什麼問題 – Pradeep

+0

確保ip廣告設備已安裝谷歌地圖,仍存在問題,然後從https://dl.google.com/geosdk/GoogleMaps-iOS-1.4.2.zip下載SDK。此zip文件夾包含示例代碼,您可以參考並製作您自己的課程或項目,並確保您從https://code.google.com/apis/console/獲得Google API密鑰,否則您的prj將崩潰 – Pradeep