This commit is contained in:
DDIsFriend
2023-08-18 17:28:57 +08:00
commit f0e8a1709d
4282 changed files with 192396 additions and 0 deletions
@@ -0,0 +1,15 @@
//
// DriveRouteCustomAnnotationView.h
// DDCategoryKit_Private
// Created by DDIsFriend on 2023/2/3.
#import <AMapNaviKit/MAMapKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface DriveRouteCustomAnnotationView : MAAnnotationView
@property (nonatomic, strong)UILabel *customTextLabel;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,37 @@
//
// DriveRouteCustomAnnotationView.m
// DDCategoryKit_Private
// Created by DDIsFriend on 2023/2/3.
#import "DriveRouteCustomAnnotationView.h"
@interface DriveRouteCustomAnnotationView ()
@end
@implementation DriveRouteCustomAnnotationView
- (id)initWithAnnotation:(id <MAAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
if (self) {
[self addSubview:self.customTextLabel];
self.customTextLabel.translatesAutoresizingMaskIntoConstraints = NO;
[NSLayoutConstraint activateConstraints:@[
[self.customTextLabel.heightAnchor constraintEqualToConstant:30],
[self.customTextLabel.bottomAnchor constraintEqualToAnchor:self.topAnchor constant:0],
[self.customTextLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
]];
}
return self;
}
// MARK: <Lazy>
- (UILabel *)customTextLabel{
if (_customTextLabel == nil) {
_customTextLabel = [[UILabel alloc] init];
}
return _customTextLabel;
}
@end