首页 > 解决方案 > 用户图标出现在地图标记后面

问题描述

如图所示,我的用户图标当前出现在地图标记的后面。我尝试添加 flex:1 但没有任何运气。当我在 android 中使用 showsUserLocation={true} 时,它似乎工作正常。有没有办法将用户位置图标推送到地图标记的前面?也经历了这里的选项,但仍然没有运气 github.com/react-native-maps/react-native-maps/issues/1668

地图图标出现在 showUserLocation 图标的前面

               <Map
                ref={refMap}
                onPress={onDeselectVenue}
                provider={PROVIDER_GOOGLE}
                customMapStyle={MAP_STYLE}
                showsMyLocationButton={false}
                showsUserLocation={true}
                initialRegion={{
                    latitude: coordinates.latitude,
                    longitude: coordinates.longitude,
                    latitudeDelta: 0.05,
                    longitudeDelta: 0.05,
                }}>
                {
                    state.clubLocations.map((clubLocation) => <ClubMarker key={clubLocation.clubId} inactive={isInactive(clubLocation)} onPress={onSelectLocation(clubLocation)} coordinate={clubLocation.location} />)
                }
            </Map>

标签: iosreactjsreact-nativereact-native-maps

解决方案


推荐阅读