Commit 6f84b859 authored by Qiu Xiang's avatar Qiu Xiang

添加 iOS 基本控制接口

parent 183af05c
#import <Foundation/Foundation.h>
#import <MAMapKit/MAMapKit.h>
@interface AMapView : MAMapView
@end
\ No newline at end of file
#import "AMapView.h"
@implementation AMapView {
}
- (void)setShowsTraffic:(BOOL)shows {
[super setShowTraffic:shows];
}
- (void)setTiltEnabled:(BOOL)enabled {
[super setRotateCameraEnabled:enabled];
}
@end
#import <MAMapKit/MAMapKit.h> #import <MAMapKit/MAMapKit.h>
#import <React/RCTViewManager.h> #import <React/RCTViewManager.h>
#import "AMapView.h"
@interface AMapViewManager : RCTViewManager @interface AMapViewManager : RCTViewManager
@end @end
...@@ -10,21 +11,24 @@ RCT_EXPORT_MODULE() ...@@ -10,21 +11,24 @@ RCT_EXPORT_MODULE()
- (UIView *)view - (UIView *)view
{ {
return [[MAMapView alloc] init]; AMapView *mapView = [[AMapView alloc] init];
mapView.centerCoordinate = CLLocationCoordinate2DMake(39.9042, 116.4074);
mapView.zoomLevel = 10;
return mapView;
} }
RCT_EXPORT_VIEW_PROPERTY(showsCompass, BOOL) RCT_EXPORT_VIEW_PROPERTY(showsCompass, BOOL)
RCT_EXPORT_VIEW_PROPERTY(showsScale, BOOL) RCT_EXPORT_VIEW_PROPERTY(showsScale, BOOL)
RCT_EXPORT_VIEW_PROPERTY(showsIndoorMap, BOOL) RCT_EXPORT_VIEW_PROPERTY(showsIndoorMap, BOOL)
// RCT_EXPORT_VIEW_PROPERTY(showsLabels, BOOL) RCT_EXPORT_VIEW_PROPERTY(showsLabels, BOOL)
// RCT_EXPORT_VIEW_PROPERTY(showsBuildings, BOOL) RCT_EXPORT_VIEW_PROPERTY(showsTraffic, BOOL)
// RCT_EXPORT_VIEW_PROPERTY(showsTraffic, BOOL) RCT_EXPORT_VIEW_PROPERTY(showsBuildings, BOOL)
RCT_EXPORT_VIEW_PROPERTY(zoomLevel, CGFloat) RCT_EXPORT_VIEW_PROPERTY(zoomLevel, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, CGFloat) RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(minZoomLevel, CGFloat) RCT_EXPORT_VIEW_PROPERTY(minZoomLevel, CGFloat)
// RCT_EXPORT_VIEW_PROPERTY(zoomEnabled, BOOL) RCT_EXPORT_VIEW_PROPERTY(zoomEnabled, BOOL)
// RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL) RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL)
// RCT_EXPORT_VIEW_PROPERTY(rotateEnabled, BOOL) RCT_EXPORT_VIEW_PROPERTY(rotateEnabled, BOOL)
// RCT_EXPORT_VIEW_PROPERTY(tiltEnabled, BOOL) RCT_EXPORT_VIEW_PROPERTY(tiltEnabled, BOOL)
@end @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