Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-amap3d
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
放牛的园子
react-native-amap3d
Commits
a41c45e1
Commit
a41c45e1
authored
Jun 13, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现 iOS 中心坐标设置接口
parent
412c14d2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
10 deletions
+37
-10
AMapView.m
ios/AMapView.m
+4
-0
AMapViewManager.m
ios/AMapViewManager.m
+3
-10
RCTConvert+AMapView.h
ios/RCTConvert+AMapView.h
+7
-0
RCTConvert+AMapView.m
ios/RCTConvert+AMapView.m
+23
-0
No files found.
ios/AMapView.m
View file @
a41c45e1
...
...
@@ -11,4 +11,8 @@
[
super
setRotateCameraEnabled
:
enabled
];
}
-
(
void
)
setCoordinate
:
(
CLLocationCoordinate2D
)
json
{
super
.
centerCoordinate
=
json
;
}
@end
ios/AMapViewManager.m
View file @
a41c45e1
...
...
@@ -2,19 +2,10 @@
#import <React/RCTViewManager.h>
#import "AMapView.h"
#pragma ide diagnostic ignored "OCUnusedClassInspection"
@interface
AMapViewManager
:
RCTViewManager
@end
@implementation
RCTConvert
(
AMapView
)
RCT_ENUM_CONVERTER
(
MAMapType
,
(@{
@"standard"
:
@
(
MAMapTypeStandard
),
@"satellite"
:
@
(
MAMapTypeSatellite
),
@"navigation"
:
@
(
MAMapTypeNavi
),
@"night"
:
@
(
MAMapTypeStandardNight
),
@"bus"
:
@
(
MAMapTypeBus
),
}),
MAMapTypeStandard
,
integerValue
)
@end
@implementation
AMapViewManager
{
AMapView
*
mapView
;
}
...
...
@@ -56,4 +47,6 @@ RCT_EXPORT_VIEW_PROPERTY(tiltEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY
(
mapType
,
MAMapType
)
RCT_EXPORT_VIEW_PROPERTY
(
coordinate
,
CLLocationCoordinate2D
)
@end
ios/RCTConvert+AMapView.h
0 → 100644
View file @
a41c45e1
#import <MAMapKit/MAMapView.h>
#import <React/RCTConvert.h>
@interface
RCTConvert
(
AMapView
)
+
(
CLLocationCoordinate2D
)
CLLocationCoordinate2D
:(
id
)
json
;
@end
\ No newline at end of file
ios/RCTConvert+AMapView.m
0 → 100644
View file @
a41c45e1
#import "RCTConvert+AMapView.h"
@implementation
RCTConvert
(
AMapView
)
RCT_ENUM_CONVERTER
(
MAMapType
,
(@{
@"standard"
:
@
(
MAMapTypeStandard
),
@"satellite"
:
@
(
MAMapTypeSatellite
),
@"navigation"
:
@
(
MAMapTypeNavi
),
@"night"
:
@
(
MAMapTypeStandardNight
),
@"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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment