Commit f75bfb88 authored by Qiu Xiang's avatar Qiu Xiang

实现 iOS 地图类型接口

parent 6f84b859
......@@ -5,30 +5,55 @@
@interface AMapViewManager : RCTViewManager
@end
@implementation AMapViewManager
@implementation RCTConvert (AMapView)
RCT_ENUM_CONVERTER(MAMapType, (@{
@"standard": @(MAMapTypeStandard),
@"satellite": @(MAMapTypeSatellite),
@"navigation": @(MAMapTypeNavi),
@"night": @(MAMapTypeStandardNight),
@"bus": @(MAMapTypeBus),
}), MAMapTypeStandard, integerValue)
@end
@implementation AMapViewManager {
AMapView *mapView;
}
RCT_EXPORT_MODULE()
- (UIView *)view
{
AMapView *mapView = [[AMapView alloc] init];
- (UIView *)view {
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(showsScale, BOOL)
RCT_EXPORT_VIEW_PROPERTY(showsIndoorMap, BOOL)
RCT_EXPORT_VIEW_PROPERTY(showsLabels, BOOL)
RCT_EXPORT_VIEW_PROPERTY(showsTraffic, BOOL)
RCT_EXPORT_VIEW_PROPERTY(showsBuildings, BOOL)
RCT_EXPORT_VIEW_PROPERTY(zoomLevel, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(maxZoomLevel, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(minZoomLevel, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(zoomEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(rotateEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(tiltEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(mapType, MAMapType)
@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