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
ab76c214
Commit
ab76c214
authored
Feb 02, 2018
by
7c00
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update readme
parent
db3850ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
README.md
README.md
+14
-1
marker.js
example/examples/marker.js
+5
-4
No files found.
README.md
View file @
ab76c214
...
@@ -140,7 +140,20 @@ const coordinate = {
...
@@ -140,7 +140,20 @@ const coordinate = {
</MapView
.Marker
>
</MapView
.Marker
>
```
```
[
更多示例
](
https://github.com/qiuxiang/react-native-amap3d/tree/master/example/examples
)
。
### 更多示例
[examples](https://github.com/qiuxiang/react-native-amap3d/tree/master/example/examples)
#### Android
```
bash
$ yarn
$ yarn run-android
```
#### iOS
```
bash
$ yarn
$ cd ios && pod install && cd ..
$ yarn run-ios
```
## 接口
## 接口
...
...
example/examples/marker.js
View file @
ab76c214
...
@@ -68,9 +68,9 @@ export default class MarkerExample extends Component {
...
@@ -68,9 +68,9 @@ export default class MarkerExample extends Component {
},
},
]
]
_on
InfoWindowPress
=
()
=>
Alert
.
alert
(
'信息窗口点击事件
'
)
_on
MarkerPress
=
()
=>
Alert
.
alert
(
'onPress
'
)
_on
CustomInfoWindowPress
=
()
=>
Alert
.
alert
(
'自定义信息窗口点击事件
'
)
_on
InfoWindowPress
=
()
=>
Alert
.
alert
(
'onInfoWindowPress
'
)
_onDragEvent
=
({
nativeEvent
})
=>
Alert
.
alert
(
`
新坐标:
${
nativeEvent
.
latitude
}
,
${
nativeEvent
.
longitude
}
`
)
_onDragEvent
=
({
nativeEvent
})
=>
Alert
.
alert
(
`
${
nativeEvent
.
latitude
}
,
${
nativeEvent
.
longitude
}
`
)
render
()
{
render
()
{
return
(
return
(
...
@@ -85,7 +85,7 @@ export default class MarkerExample extends Component {
...
@@ -85,7 +85,7 @@ export default class MarkerExample extends Component {
coordinate
=
{
this
.
_coordinates
[
0
]}
coordinate
=
{
this
.
_coordinates
[
0
]}
/
>
/
>
<
MapView
.
Marker
color
=
"green"
coordinate
=
{
this
.
_coordinates
[
1
]}
>
<
MapView
.
Marker
color
=
"green"
coordinate
=
{
this
.
_coordinates
[
1
]}
>
<
TouchableOpacity
activeOpacity
=
{
0.9
}
onPress
=
{
this
.
_on
Custom
InfoWindowPress
}
>
<
TouchableOpacity
activeOpacity
=
{
0.9
}
onPress
=
{
this
.
_onInfoWindowPress
}
>
<
View
style
=
{
styles
.
customInfoWindow
}
>
<
View
style
=
{
styles
.
customInfoWindow
}
>
<
Text
>
自定义信息窗口
<
/Text
>
<
Text
>
自定义信息窗口
<
/Text
>
<
Text
>
{
this
.
state
.
time
.
toLocaleTimeString
()}
<
/Text
>
<
Text
>
{
this
.
state
.
time
.
toLocaleTimeString
()}
<
/Text
>
...
@@ -95,6 +95,7 @@ export default class MarkerExample extends Component {
...
@@ -95,6 +95,7 @@ export default class MarkerExample extends Component {
<
MapView
.
Marker
<
MapView
.
Marker
image
=
"flag"
image
=
"flag"
title
=
"自定义图片"
title
=
"自定义图片"
onPress
=
{
this
.
_onMarkerPress
}
coordinate
=
{
this
.
_coordinates
[
2
]}
coordinate
=
{
this
.
_coordinates
[
2
]}
/
>
/
>
<
MapView
.
Marker
<
MapView
.
Marker
...
...
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