Commit 87123d6c authored by Qiu Xiang's avatar Qiu Xiang

实现 iOS 自定义 InfoWindow

parent 6b7e7214
#import <Foundation/Foundation.h>
#import <React/RCTView.h>
@interface AMapInfoWindow : RCTView
@end
\ No newline at end of file
#import "AMapInfoWindow.h"
@implementation AMapInfoWindow {
}
@end
\ No newline at end of file
#import <React/RCTViewManager.h>
#import <React/RCTUIManager.h>
#import "AMapInfoWindow.h"
#pragma ide diagnostic ignored "OCUnusedClassInspection"
@interface AMapInfoWindowManager : RCTViewManager
@end
@implementation AMapInfoWindowManager {
}
RCT_EXPORT_MODULE()
- (UIView *)view {
return [AMapInfoWindow new];
}
@end
......@@ -3,11 +3,13 @@
#import <React/RCTComponent.h>
#import "AMapView.h"
#import "AMapOverlay.h"
#import "AMapInfoWindow.h"
#pragma ide diagnostic ignored "OCUnusedPropertyInspection"
@class AMapView;
@class AMapOverlay;
@class AMapInfoWindow;
@interface AMapMarker : MAAnnotationView <MAAnnotation, AMapOverlayDelegate>
......
......@@ -34,6 +34,7 @@
_pinView.zIndex = self.zIndex;
_pinView.draggable = self.draggable;
_pinView.canShowCallout = self.canShowCallout;
_pinView.customCalloutView = self.customCalloutView;
return _pinView;
}
......@@ -46,6 +47,9 @@
_iconView = (AMapOverlay *)subview;
_iconView.delegate = self;
}
if ([subview isKindOfClass:[AMapInfoWindow class]]) {
self.customCalloutView = [[MACustomCalloutView alloc] initWithCustomView:(id) subview];
}
}
#pragma mark AMapOverlayDelegate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment