jpsim/JPSThumbnailAnnotation
소개
이미지와 세부 정보를 표시하는 간단한 MapKit 어노테이션입니다.
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalJPSThumbnailAnnotation
JPSThumbnailAnnotation is a simple mapkit annotation view for displaying images with clean design and animations. It is 100% programmatically drawn and styled for iOS 7.
![]()
Installation
From CocoaPods
Add pod 'JPSThumbnailAnnotation' to your Podfile.
Manually
Copy the JPSThumbnailAnnotation folder to your Xcode project and link the MapKit, QuartzCore and CoreLocation libraries.
Usage
(see sample Xcode project in /Demo)
You add an JPSThumbnailAnnotation just like any other MKAnnotation. The annotations take in a JPSThumbnail object to display an image, title, subtitle at a specific coordinate. You can also set a block to be run when the disclosure button is tapped.
JPSThumbnail *thumbnail = [[JPSThumbnail alloc] init];
thumbnail.image = [UIImage imageNamed:@"empire.jpg"];
thumbnail.title = @"Empire State Building";
thumbnail.subtitle = @"NYC Landmark";
thumbnail.coordinate = CLLocationCoordinate2DMake(40.75f, -73.99f);
thumbnail.disclosureBlock = ^{ NSLog(@"selected Empire"); };
[mapView addAnnotation:[JPSThumbnailAnnotation annotationWithThumbnail:thumbnail]];
Usage notes
Make sure the mapView implements the following 3 MKMapViewDelegate methods:
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view {
if ([view conformsToProtocol:@protocol(JPSThumbnailAnnotationViewProtocol)]) {
[((NSObject<JPSThumbnailAnnotationViewProtocol> *)view) didSelectAnnotationViewInMap:mapView];
}
}
- (void)mapView:(MKMapView *)mapView didDeselectAnnotationView:(MKAnnotationView *)view {
if ([view conformsToProtocol:@protocol(JPSThumbnailAnnotationViewProtocol)]) {
[((NSObject<JPSThumbnailAnnotationViewProtocol> *)view) didDeselectAnnotationViewInMap:mapView];
}
}
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
if ([annotation conformsToProtocol:@protocol(JPSThumbnailAnnotationProtocol)]) {
return [((NSObject<JPSThumbnailAnnotationProtocol> *)annotation) annotationViewInMap:mapView];
}
return nil;
}
License
MIT Licensed.
관련 프로젝트 살펴보기
불러오는 중…