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
f3f4f6c3
Commit
f3f4f6c3
authored
Jul 10, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提供 OnInfoWindowPress 失效时的解决方案
parent
ceb0acce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
Marker.js
components/Marker.js
+1
-0
marker.js
example/src/examples/marker.js
+13
-4
AMapMarker.m
ios/AMapMarker.m
+1
-1
No files found.
components/Marker.js
View file @
f3f4f6c3
...
@@ -107,6 +107,7 @@ export default class Marker extends Component {
...
@@ -107,6 +107,7 @@ export default class Marker extends Component {
/**
/**
* 信息窗体点击事件
* 信息窗体点击事件
* 使用自定义 View 会使该事件失效,这时候可以用 Touchable* 代替
*/
*/
onInfoWindowPress
:
React
.
PropTypes
.
func
,
onInfoWindowPress
:
React
.
PropTypes
.
func
,
}
}
...
...
example/src/examples/marker.js
View file @
f3f4f6c3
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
Alert
,
Text
,
Image
,
View
}
from
'react-native'
import
{
StyleSheet
,
Alert
,
Text
,
Image
,
View
,
TouchableOpacity
,
}
from
'react-native'
import
{
MapView
,
Marker
}
from
'react-native-amap3d'
import
{
MapView
,
Marker
}
from
'react-native-amap3d'
export
default
class
MarkerExample
extends
Component
{
export
default
class
MarkerExample
extends
Component
{
...
@@ -44,9 +51,11 @@ export default class MarkerExample extends Component {
...
@@ -44,9 +51,11 @@ export default class MarkerExample extends Component {
latitude
:
39.806901
,
latitude
:
39.806901
,
longitude
:
116.297972
,
longitude
:
116.297972
,
}}
>
}}
>
<
View
style
=
{
styles
.
customInfoWindow
}
>
<
TouchableOpacity
activeOpacity
=
{
0.9
}
onPress
=
{()
=>
Alert
.
alert
(
'Custom View InfoWindow onPress'
)}
>
<
Text
>
Custom
View
InfoWindow
<
/Text
>
<
View
style
=
{
styles
.
customInfoWindow
}
>
<
/View
>
<
Text
>
Custom
View
InfoWindow
<
/Text
>
<
/View
>
<
/TouchableOpacity
>
<
/Marker
>
<
/Marker
>
<
Marker
<
Marker
icon
=
{()
=>
icon
=
{()
=>
...
...
ios/AMapMarker.m
View file @
f3f4f6c3
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
_callout
=
(
AMapOverlay
*
)
subview
;
_callout
=
(
AMapOverlay
*
)
subview
;
_callout
.
delegate
=
self
;
_callout
.
delegate
=
self
;
UIButton
*
button
=
[
[
UIButton
alloc
]
initWithFrame
:
CGRectZero
];
UIButton
*
button
=
[
UIButton
new
];
[
button
addSubview
:
_callout
];
[
button
addSubview
:
_callout
];
_annotationView
.
customCalloutView
=
[[
MACustomCalloutView
alloc
]
initWithCustomView
:
button
];
_annotationView
.
customCalloutView
=
[[
MACustomCalloutView
alloc
]
initWithCustomView
:
button
];
...
...
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