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
22538e45
Commit
22538e45
authored
Jun 05, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
c181df86
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
AMapMarker.kt
android/src/main/java/cn/qiuxiang/react/amap3d/AMapMarker.kt
+9
-14
AMapView.kt
android/src/main/java/cn/qiuxiang/react/amap3d/AMapView.kt
+1
-1
No files found.
android/src/main/java/cn/qiuxiang/react/amap3d/AMapMarker.kt
View file @
22538e45
...
...
@@ -81,19 +81,7 @@ class AMapMarker(context: ThemedReactContext) : ReactViewGroup(context) {
private
val
eventEmitter
:
RCTEventEmitter
=
context
.
getJSModule
(
RCTEventEmitter
::
class
.
java
)
fun
addToMap
(
map
:
AMap
)
{
marker
=
map
.
addMarker
(
markerOptions
)
if
(
active
)
{
marker
?.
showInfoWindow
()
}
else
{
marker
?.
hideInfoWindow
()
}
}
val
markerId
:
String
?
get
()
=
marker
?.
id
private
val
markerOptions
:
MarkerOptions
get
()
=
MarkerOptions
()
marker
=
map
.
addMarker
(
MarkerOptions
()
.
setFlat
(
flat
)
.
icon
(
bitmapDescriptor
)
.
alpha
(
opacity
)
...
...
@@ -101,7 +89,14 @@ class AMapMarker(context: ThemedReactContext) : ReactViewGroup(context) {
.
position
(
position
)
.
title
(
title
)
.
infoWindowEnable
(
infoWindowEnabled
)
.
snippet
(
snippet
)
.
snippet
(
snippet
))
if
(
active
)
{
marker
?.
showInfoWindow
()
}
else
{
marker
?.
hideInfoWindow
()
}
}
fun
setIcon
(
icon
:
String
)
{
bitmapDescriptor
=
COLORS
[
icon
.
toUpperCase
()]
?.
let
{
...
...
android/src/main/java/cn/qiuxiang/react/amap3d/AMapView.kt
View file @
22538e45
...
...
@@ -84,7 +84,7 @@ class AMapView(context: ThemedReactContext) : MapView(context) {
fun
addMarker
(
marker
:
AMapMarker
)
{
marker
.
addToMap
(
map
)
markers
.
put
(
marker
.
marker
I
d
!!
,
marker
)
markers
.
put
(
marker
.
marker
?.
i
d
!!
,
marker
)
}
fun
addPolyline
(
polyline
:
AMapPolyline
)
{
...
...
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