Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

遍历生成MapView,后面的MapView会出现黑屏现象,能否提供一个解决思路 #836

Open
Jhh910 opened this issue Sep 25, 2024 · 0 comments

Comments

@Jhh910
Copy link

Jhh910 commented Sep 25, 2024

遍历生成MapView,后面的MapView会出现黑屏现象,Modal中的MapView也会出现黑屏现象,能否提供一个解决思路 这是版本 "react-native-amap3d": "^3.2.4",
` {logs.map((item, index) => (
<View style={styles.container} key={'description' + index}>
{item.lat && item.lon && (
<View style={{width: '100%', height: 100, marginTop: 10}}>
<MapView
initialCameraPosition={{
target: {
latitude: Number(item?.lat),
longitude: Number(item?.lon),
},
zoom: 14,
}}
onPress={() => {
setClickLatLon({lat: Number(item?.lat), lon: Number(item?.lon)})
setMapVisible(true)
}}>
<Marker
position={{
latitude: Number(item?.lat),
longitude: Number(item?.lon),
}}>
<Image
style={{width: 30, height: 30}}
alt="state"
source={require('../../../../pic/common/maploc.png')}
/>



)}

                  <Modal
    popup
    visible={mapVisible}
    animationType="slide-up"
    onClose={() => setMapVisible(false)}
    maskClosable={true}
    closable={false}
    style={{borderTopLeftRadius: 20, borderTopRightRadius: 20}}
    transparent={false}>
    <View
      style={{
        width: '100%',
        height: height * 0.8,
        borderTopLeftRadius: 20,
        borderTopRightRadius: 20,
        overflow: 'hidden',
      }}>
      <MapView
        initialCameraPosition={{
          target: {
            latitude: clickLatLon.lat,
            longitude: clickLatLon.lon,
          },
          zoom: 16,
        }}>
        <Marker
          position={{
            latitude: clickLatLon.lat,
            longitude: clickLatLon.lon,
          }}>
          <Image
            style={{width: 30, height: 30}}
            alt="state"
            source={require('../../../../pic/common/maploc.png')}
          />
        </Marker>
      </MapView>
    </View>
  </Modal>`

c526c23dc44572b37495fd79f68289f
b91307389bb92508adf12a9fb4483c4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant