1

带有 react-native 的 MapBox。

如何知道一个点是在“水”(海洋)还是陆地上。

找不到visibleFeatures功能react-native

var LocationSelect = function(props) {
    const mapContainer = useRef(null);

    function onMapPointSelect(data) {
          /// Get if point is water or land
        mapContainer.visibleFeatures(data.geometry.coordinates, styleLayerIdentifiers: ["water"]);
    }

    return (
        <View style={styles.mapContainer}>

            <MapboxGL.MapView style={styles.map}
            onLayout={onLayout}
            onPress={onMapPointSelect}
            ref={el => (mapContainer.current = el)} >

            </MapboxGL.MapView>

        </View>
    );

}

非常感谢

4

0 回答 0