Skip to content

Instantly share code, notes, and snippets.

@taktamur
Created October 17, 2012 14:53
Show Gist options
  • Save taktamur/3905956 to your computer and use it in GitHub Desktop.
Save taktamur/3905956 to your computer and use it in GitHub Desktop.
YMKMapViewの拡張
#pragma mark - YMKMapViewを拡張
// 「表示されている地図」の範囲を「YOLPのローカルサーチ」で探す場合、
// 表示されているエリアの左下と右上の緯度経度が必要となるので、
// YMKMapViewを拡張して取得できるようにする。
@implementation YMKMapView(PMMapViewController)
// mapViewの「左下」の緯度経度を取得する
-(CLLocationCoordinate2D)leftBottomCoordinate{
return [self convertPoint:CGPointMake(0,self.bounds.size.height)
toCoordinateFromView:self];
}
// mapViewの「右上」の緯度経度を取得
-(CLLocationCoordinate2D)rightTopCoordinate{
return [self convertPoint:CGPointMake(self.bounds.size.width,0)
toCoordinateFromView:self];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment