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
8ba0182c
Commit
8ba0182c
authored
Dec 22, 2017
by
7c00
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增 iOS Marker#lockToScreen 接口
相关:#112
parent
7fb5e774
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
6 deletions
+17
-6
AMapMarker.h
ios/maps/AMapMarker.h
+1
-1
AMapMarker.m
ios/maps/AMapMarker.m
+4
-4
AMapMarkerManager.m
ios/maps/AMapMarkerManager.m
+8
-1
Marker.js
src/maps/Marker.js
+4
-0
No files found.
ios/maps/AMapMarker.h
View file @
8ba0182c
...
...
@@ -12,6 +12,6 @@
-
(
MAAnnotationView
*
)
annotationView
;
-
(
MAPointAnnotation
*
)
annotation
;
-
(
void
)
setMapView
:(
AMapView
*
)
mapView
;
-
(
void
)
lockToScreen
;
-
(
void
)
lockToScreen
:(
int
)
x
y
:(
int
)
y
;
@end
ios/maps/AMapMarker.m
View file @
8ba0182c
...
...
@@ -40,7 +40,7 @@
-
(
void
)
setColor
:
(
MAPinAnnotationColor
)
color
{
_pinColor
=
color
;
((
MAPinAnnotationView
*
)
_annotationView
).
pinColor
=
color
;
((
MAPinAnnotationView
*
)
_annotationView
).
pinColor
=
color
;
}
-
(
void
)
setDraggable
:
(
BOOL
)
draggable
{
...
...
@@ -108,7 +108,7 @@
[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
_handleTap
:)]];
}
else
{
_annotationView
=
[[
MAPinAnnotationView
alloc
]
initWithAnnotation
:
_annotation
reuseIdentifier
:
nil
];
((
MAPinAnnotationView
*
)
_annotationView
).
pinColor
=
_pinColor
;
((
MAPinAnnotationView
*
)
_annotationView
).
pinColor
=
_pinColor
;
}
_annotationView
.
canShowCallout
=
YES
;
_annotationView
.
draggable
=
_draggable
;
...
...
@@ -131,9 +131,9 @@
}
}
-
(
void
)
lockToScreen
{
-
(
void
)
lockToScreen
:
(
int
)
x
y
:
(
int
)
y
{
_annotation
.
lockedToScreen
=
YES
;
_annotation
.
lockedScreenPoint
=
CGPointMake
(
100
,
100
);
_annotation
.
lockedScreenPoint
=
CGPointMake
(
x
,
y
);
}
@end
ios/maps/AMapMarkerManager.m
View file @
8ba0182c
#import <React/RCT
View
Manager.h>
#import <React/RCT
UI
Manager.h>
#import "AMapMarker.h"
#pragma ide diagnostic ignored "OCUnusedClassInspection"
...
...
@@ -33,4 +33,11 @@ RCT_EXPORT_VIEW_PROPERTY(onDragStart, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY
(
onDrag
,
RCTBubblingEventBlock
)
RCT_EXPORT_VIEW_PROPERTY
(
onDragEnd
,
RCTBubblingEventBlock
)
RCT_EXPORT_METHOD
(
lockToScreen
:
(
nonnull
NSNumber
*
)
reactTag
x
:
(
int
)
x
y
:
(
int
)
y
)
{
[
self
.
bridge
.
uiManager
addUIBlock
:
^
(
__unused
RCTUIManager
*
uiManager
,
NSDictionary
<
NSNumber
*
,
UIView
*>
*
viewRegistry
)
{
AMapMarker
*
marker
=
(
AMapMarker
*
)
viewRegistry
[
reactTag
];
[
marker
lockToScreen
:
x
y
:
y
];
}];
}
@end
src/maps/Marker.js
View file @
8ba0182c
...
...
@@ -153,6 +153,10 @@ export default class Marker extends BaseComponent {
this
.
_sendCommand
(
'active'
)
}
lockToScreen
(
x
,
y
)
{
this
.
_sendCommand
(
'lockToScreen'
,
[
x
,
y
])
}
componentDidUpdate
()
{
if
(
this
.
_icon
&&
Platform
.
OS
===
'android'
)
{
setTimeout
(()
=>
this
.
_sendCommand
(
'update'
),
0
)
...
...
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