Commit dc63c879 authored by Qiu Xiang's avatar Qiu Xiang

优化 iOS 代码

parent e001df62
#import <Foundation/Foundation.h>
#import <MAMapKit/MAMapKit.h>
#import <RCTComponent.h>
#import <React/RCTComponent.h>
@interface AMapView : MAMapView
@property (nonatomic, copy) RCTBubblingEventBlock onReady;
......
......@@ -3,6 +3,7 @@
#import "AMapView.h"
#pragma ide diagnostic ignored "OCUnusedClassInspection"
#pragma ide diagnostic ignored "-Woverriding-method-mismatch"
@interface AMapViewManager : RCTViewManager <MAMapViewDelegate>
@end
......
#import <MAMapKit/MAMapView.h>
#import <React/RCTConvert.h>
@interface RCTConvert (AMapView)
+ (CLLocationCoordinate2D)CLLocationCoordinate2D:(id)json;
@end
\ No newline at end of file
#import "RCTConvert+AMapView.h"
#import <MAMapKit/MAMapView.h>
#import <React/RCTConvert.h>
@implementation RCTConvert (AMapView)
......@@ -10,14 +11,4 @@ RCT_ENUM_CONVERTER(MAMapType, (@{
@"bus": @(MAMapTypeBus),
}), MAMapTypeStandard, integerValue)
RCT_CONVERTER(CLLocationDegrees, CLLocationDegrees, doubleValue);
RCT_CONVERTER(CLLocationDistance, CLLocationDistance, doubleValue);
+ (CLLocationCoordinate2D)CLLocationCoordinate2D:(id)json {
return CLLocationCoordinate2DMake(
[self CLLocationDegrees:json[@"latitude"]],
[self CLLocationDegrees:json[@"longitude"]]);
}
@end
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