-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathYMKMapView+ClusterKit.h
65 lines (44 loc) · 1.75 KB
/
YMKMapView+ClusterKit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#import <YandexMapKit/YMKMapKit.h>
#import <ClusterKit/CKMap.h>
#import <ClusterKit/CKCluster.h>
NS_ASSUME_NONNULL_BEGIN
/**
The YMKMapViewDataSource protocol is adopted by an object that mediates the YMKMap’s data. The data source provides the placemarks that represent clusters on map.
*/
@protocol YMKMapViewDataSource <NSObject>
@optional
/**
Asks the data source for a marker that represent the given cluster.
@param mapView A map view object requesting the marker.
@param cluster The cluster to represent.
@return An object inheriting from GMSMarker that the map view can use for the specified cluster.
*/
- (__kindof YMKPlacemarkMapObject *)mapView:(YMKMapView *)mapView placemarkForCluster:(CKCluster *)cluster;
@end
/**
YMKPlacemarkMapObject category adopting the CKAnnotation protocol.
*/
@interface YMKPlacemarkMapObject (ClusterKit)
/**
The cluster that the marker is related to.
*/
@property (nonatomic, weak, nullable) CKCluster *cluster;
@end
@interface YMKMapView (ClusterKit) <CKMap>
/**
Data source instance that adopt the YMKMapViewDataSource.
*/
@property(nonatomic, weak) IBOutlet id<YMKMapViewDataSource> dataSource;
/**
Returns the placemark representing the given cluster.
@param cluster The cluster for which to return the corresponding placemark.
@return The value associated with cluster, or nil if no value is associated with cluster.
*/
- (nullable __kindof YMKPlacemarkMapObject *)placemarkForCluster:(CKCluster *)cluster;
- (YMKCameraPosition *)cameraPositionThatFits:(CKCluster *)cluster;
- (YMKCameraPosition *)cameraPositionThatFits:(CKCluster *)cluster edgePadding:(UIEdgeInsets)insets;
@end
@interface YMKPoint (ClusterKit)
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@end
NS_ASSUME_NONNULL_END