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
faa051ac
Commit
faa051ac
authored
Jun 20, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现 iOS marker 大头针颜色设置接口
parent
87123d6c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
6 deletions
+24
-6
AMapMarker.h
ios/AMapMarker.h
+1
-1
AMapMarker.m
ios/AMapMarker.m
+10
-5
AMapMarkerManager.m
ios/AMapMarkerManager.m
+1
-0
RCTConvert+AMapMarker.m
ios/RCTConvert+AMapMarker.m
+12
-0
No files found.
ios/AMapMarker.h
View file @
faa051ac
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
@class
AMapOverlay
;
@class
AMapOverlay
;
@class
AMapInfoWindow
;
@class
AMapInfoWindow
;
@interface
AMapMarker
:
MAAnnotationView
<
MAAnnotation
,
AMapOverlayDelegate
>
@interface
AMapMarker
:
MA
Pin
AnnotationView
<
MAAnnotation
,
AMapOverlayDelegate
>
@property
(
nonatomic
,
assign
)
CLLocationCoordinate2D
coordinate
;
@property
(
nonatomic
,
assign
)
CLLocationCoordinate2D
coordinate
;
@property
(
nonatomic
,
copy
)
NSString
*
title
;
@property
(
nonatomic
,
copy
)
NSString
*
title
;
...
...
ios/AMapMarker.m
View file @
faa051ac
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#pragma ide diagnostic ignored "OCUnusedMethodInspection"
#pragma ide diagnostic ignored "OCUnusedMethodInspection"
@implementation
AMapMarker
{
@implementation
AMapMarker
{
MAAnnotationView
*
_pinView
;
MA
Pin
AnnotationView
*
_pinView
;
AMapOverlay
*
_iconView
;
AMapOverlay
*
_iconView
;
BOOL
_active
;
BOOL
_active
;
}
}
...
@@ -15,6 +15,10 @@
...
@@ -15,6 +15,10 @@
}
}
}
}
-
(
void
)
setIcon
:
(
MAPinAnnotationColor
)
color
{
self
.
pinColor
=
color
;
}
-
(
void
)
setDescription
:
(
NSString
*
)
description
{
-
(
void
)
setDescription
:
(
NSString
*
)
description
{
self
.
subtitle
=
description
;
self
.
subtitle
=
description
;
}
}
...
@@ -27,14 +31,15 @@
...
@@ -27,14 +31,15 @@
if
(
_pinView
==
nil
)
{
if
(
_pinView
==
nil
)
{
_pinView
=
[[
MAPinAnnotationView
alloc
]
initWithAnnotation
:
self
reuseIdentifier
:
nil
];
_pinView
=
[[
MAPinAnnotationView
alloc
]
initWithAnnotation
:
self
reuseIdentifier
:
nil
];
_pinView
.
annotation
=
self
;
_pinView
.
annotation
=
self
;
}
if
(
_iconView
!=
nil
)
{
_pinView
.
image
=
nil
;
}
_pinView
.
zIndex
=
self
.
zIndex
;
_pinView
.
zIndex
=
self
.
zIndex
;
_pinView
.
pinColor
=
self
.
pinColor
;
_pinView
.
draggable
=
self
.
draggable
;
_pinView
.
draggable
=
self
.
draggable
;
_pinView
.
canShowCallout
=
self
.
canShowCallout
;
_pinView
.
canShowCallout
=
self
.
canShowCallout
;
_pinView
.
customCalloutView
=
self
.
customCalloutView
;
_pinView
.
customCalloutView
=
self
.
customCalloutView
;
}
if
(
_iconView
!=
nil
)
{
_pinView
.
image
=
nil
;
}
return
_pinView
;
return
_pinView
;
}
}
...
...
ios/AMapMarkerManager.m
View file @
faa051ac
...
@@ -25,6 +25,7 @@ RCT_EXPORT_VIEW_PROPERTY(active, BOOL)
...
@@ -25,6 +25,7 @@ RCT_EXPORT_VIEW_PROPERTY(active, BOOL)
RCT_EXPORT_VIEW_PROPERTY
(
draggable
,
BOOL
)
RCT_EXPORT_VIEW_PROPERTY
(
draggable
,
BOOL
)
RCT_EXPORT_VIEW_PROPERTY
(
infoWindowEnabled
,
BOOL
)
RCT_EXPORT_VIEW_PROPERTY
(
infoWindowEnabled
,
BOOL
)
RCT_EXPORT_VIEW_PROPERTY
(
zIndex
,
NSInteger
)
RCT_EXPORT_VIEW_PROPERTY
(
zIndex
,
NSInteger
)
RCT_EXPORT_VIEW_PROPERTY
(
icon
,
MAPinAnnotationColor
)
RCT_EXPORT_VIEW_PROPERTY
(
onPress
,
RCTBubblingEventBlock
)
RCT_EXPORT_VIEW_PROPERTY
(
onPress
,
RCTBubblingEventBlock
)
RCT_EXPORT_VIEW_PROPERTY
(
onInfoWindowPress
,
RCTBubblingEventBlock
)
RCT_EXPORT_VIEW_PROPERTY
(
onInfoWindowPress
,
RCTBubblingEventBlock
)
...
...
ios/RCTConvert+AMapMarker.m
0 → 100644
View file @
faa051ac
#import <MAMapKit/MAMapKit.h>
#import <React/RCTConvert.h>
@implementation
RCTConvert
(
AMapMarker
)
RCT_ENUM_CONVERTER
(
MAPinAnnotationColor
,
(@{
@"red"
:
@
(
MAPinAnnotationColorRed
),
@"green"
:
@
(
MAPinAnnotationColorGreen
),
@"purple"
:
@
(
MAPinAnnotationColorPurple
),
}),
MAPinAnnotationColorRed
,
integerValue
)
@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