无法在MapBox中找到MarkerView。

问题描述 投票:0回答:1

我在这个github库中找不到MapBox中的markerview。https:/github.comreact-native-mapbox-glmaps。,所以有谁能帮帮我好吗?

不然我在里面用PointAnnotation是这样的。

               <MapboxGL.MapView style={{ flex: 1 }}>
                        <MapboxGL.Camera centerCoordinate={[22.470701, 70.057732]} zoomLevel={14} >

                        </MapboxGL.Camera>
                        <MapboxGL.PointAnnotation
                            id="foo1"
                            coordinate={[22.470701, 70.057732]}
                            title={'Hello'}>
                            <View style={{ flexWrap: 'wrap', backgroundColor: 'blue' }}>
                                <Image source={require('./chat.png')} style={styles.tinyLogo} />
                                <Text style={{ color: 'white', margin: 10 }}>$50.00</Text>
                            </View>
                            <MapboxGL.Callout style={{ borderRadius: 20, width: 150, height: 120 }}>
                                <View style={{ width: '100%', height: '100%', backgroundColor: 'white' }}>
                                    <Text style={{ marginHorizontal: 10, marginTop: 10 }}>123, Main st,</Text>
                                    <Text style={{ marginHorizontal: 10, marginBottom: 10 }}>Chicago, IL 6061</Text>
                                    <TouchableOpacity style={{ backgroundColor: 'orange', margin: 10, alignItems: 'center' }}>
                                        <Text style={{ margin: 10, color: 'white' }}>Select Shop</Text>
                                    </TouchableOpacity>
                                </View>
                            </MapboxGL.Callout>
                        </MapboxGL.PointAnnotation>   
             </MapboxGL.MapView>

但是那张图片不显示,所以谁能帮帮我,我应该怎么做呢?"先谢谢了。

react-native maps mapbox-gl-js
1个回答
1
投票

有一个MarkerView的使用实例 此处 MarkerView的文档可以在下面找到 此处

从该文件中可以看出

如果您有静态视图,可以考虑使用PointAnnotation或SymbolLayer,它们会提供更好的性能。

所以,如果你在这种情况下,似乎你做得很好。

© www.soinside.com 2019 - 2024. All rights reserved.