mop-flutter-sdk/ios/Classes/FinAppletExt/ExtensionApi/Map/FATExt_updateNativeMapMarke...

40 lines
1.3 KiB
Dart
Raw Normal View History

2023-12-06 14:56:29 +08:00
//
// FATExt_updateNativeMapMarkers.m
// FinAppletExt
//
// Created by 滔 on 2022/9/18.
// Copyright © 2022 finogeeks. All rights reserved.
//
#import "FATExt_updateNativeMapMarkers.h"
#import "FATMapViewDelegate.h"
@implementation FATExt_updateNativeMapMarkers
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *, id> *successResult))success
failure:(void (^)(NSDictionary *failResult))failure
cancel:(void (^)(NSDictionary *cancelResult))cancel {
if (self.context && [self.context respondsToSelector:@selector(getChildViewById:)]) {
UIView *targetView = [self.context getChildViewById:self.param[@"mapId"]];
if (targetView && [targetView conformsToProtocol:@protocol(FATMapViewDelegate)]) {
UIView<FATMapViewDelegate> *mapView = (UIView<FATMapViewDelegate> *)targetView;
if (mapView && [mapView respondsToSelector:@selector(updateNativeMapMarkers:)]) {
[mapView updateNativeMapMarkers:self.param];
} else {
if (failure) {
NSDictionary *dictParam = @{};
failure(dictParam);
}
}
}
} else {
if (failure) {
NSDictionary *dictParam = @{};
failure(dictParam);
}
}
}
@end