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
e881cd01
Commit
e881cd01
authored
Jun 04, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉颜色代码 HUE_ 前缀
parent
a43880e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
AMapMarker.kt
android/src/main/java/cn/qiuxiang/react/amap3d/AMapMarker.kt
+13
-13
marker.js
example/src/marker.js
+1
-1
No files found.
android/src/main/java/cn/qiuxiang/react/amap3d/AMapMarker.kt
View file @
e881cd01
...
...
@@ -78,10 +78,10 @@ class AMapMarker(context: ThemedReactContext) : ReactViewGroup(context) {
}
fun
setIcon
(
icon
:
String
)
{
if
(
icon
.
startsWith
(
"HUE_"
))
{
bitmapDescriptor
=
COLORS
[
icon
]
?.
let
{
BitmapDescriptorFactory
.
defaultMarker
(
it
)
}
marker
?.
setIcon
(
bitmapDescriptor
)
bitmapDescriptor
=
COLORS
[
icon
.
toUpperCase
()]
?.
let
{
BitmapDescriptorFactory
.
defaultMarker
(
it
)
}
marker
?.
setIcon
(
bitmapDescriptor
)
}
fun
sendEvent
(
name
:
String
,
data
:
WritableMap
)
{
...
...
@@ -120,16 +120,16 @@ class AMapMarker(context: ThemedReactContext) : ReactViewGroup(context) {
companion
object
{
private
val
COLORS
=
mapOf
(
"
HUE_
AZURE"
to
BitmapDescriptorFactory
.
HUE_AZURE
,
"
HUE_
BLUE"
to
BitmapDescriptorFactory
.
HUE_BLUE
,
"
HUE_
CYAN"
to
BitmapDescriptorFactory
.
HUE_CYAN
,
"
HUE_
GREEN"
to
BitmapDescriptorFactory
.
HUE_GREEN
,
"
HUE_
MAGENTA"
to
BitmapDescriptorFactory
.
HUE_MAGENTA
,
"
HUE_
ORANGE"
to
BitmapDescriptorFactory
.
HUE_ORANGE
,
"
HUE_
RED"
to
BitmapDescriptorFactory
.
HUE_RED
,
"
HUE_
ROSE"
to
BitmapDescriptorFactory
.
HUE_ROSE
,
"
HUE_
VIOLET"
to
BitmapDescriptorFactory
.
HUE_VIOLET
,
"
HUE_
YELLOW"
to
BitmapDescriptorFactory
.
HUE_YELLOW
"AZURE"
to
BitmapDescriptorFactory
.
HUE_AZURE
,
"BLUE"
to
BitmapDescriptorFactory
.
HUE_BLUE
,
"CYAN"
to
BitmapDescriptorFactory
.
HUE_CYAN
,
"GREEN"
to
BitmapDescriptorFactory
.
HUE_GREEN
,
"MAGENTA"
to
BitmapDescriptorFactory
.
HUE_MAGENTA
,
"ORANGE"
to
BitmapDescriptorFactory
.
HUE_ORANGE
,
"RED"
to
BitmapDescriptorFactory
.
HUE_RED
,
"ROSE"
to
BitmapDescriptorFactory
.
HUE_ROSE
,
"VIOLET"
to
BitmapDescriptorFactory
.
HUE_VIOLET
,
"YELLOW"
to
BitmapDescriptorFactory
.
HUE_YELLOW
)
}
}
example/src/marker.js
View file @
e881cd01
...
...
@@ -39,7 +39,7 @@ export default class MarkerExample extends Component {
/
>
<
Marker
selected
icon
=
'
HUE_RED
'
icon
=
'
red
'
infoWindowWidth
=
{
100
}
coordinate
=
{{
latitude
:
39.806901
,
...
...
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