長按地圖事件

長按地圖事件

長按地圖觸發事件,於長按地圖時觸發,長按地圖觸發事件程式範例說明如下:

- (void)mapView:(TGMapView *)mapView

didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate  //長按地圖時觸發事件

{

   

NSString * txt = @"LongPress : WGS84 = %f,%f , TWD97 = %f,%f , Screen = %f,%f";

PointD *twd97 = [TGTransformation wgs84ToTWD97:coordinate];

CGPoint ScreenPt = [mapView_.projection pointForCoordinate:coordinate];

txt = [NSString stringWithFormat:txt,coordinate.latitude,coordinate.longitude,twd97.X,twd97.Y,ScreenPt.x,ScreenPt.y];

[self setLabelTxt:txt];

NSLog(@"%@",txt);

   

[self addMarker:coordinate];

}

回到上方