套疊圖片影像檔

套疊圖片影像檔

圖片影像套疊功能設定,如設定套疊圖片之大小及位置等,並可設定透明度,套疊圖片影像檔程式範例如下:

- (void)loadView

{

mapView_ = [[TGMapView alloc] initWithFrame:CGRectZero];

self.view =  mapView_;

mapView_.viewer =[TGViewerPosition viewerWithLatitude:25.054 longitude:121.541 zoom:10];

 

TGGroundOverlayOptions *groundOps2 = [TGGroundOverlayOptions options]; 

//建立TGGroundOverlayOptions物件

TGLatLngBounds *bounds = [[TGLatLngBounds alloc]       

initWithCoordinate:CLLocationCoordinate2DMake(25.057927121.536691)

andCoordinate:CLLocationCoordinate2DMake(25.049646121.547141)];

groundOps2.bounds = bounds;  //設定Ground的範圍

groundOps2.icon = [UIImage imageNamed:@"ZhongShan97.jpg"]; 

//設定Ground的圖片

groundOps2.transparency = 0.8;  //設定透明度(0.0-1.0

overlay_ = [mapView_ addGroundOverlayWithOptions:groundOps2]; 

//將圖片影像加入地圖

}

 

回到上方