带有react-native-mapbox-gl模块的iOS设备上不会触发onRegionDidChange回调

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

我在MapboxGL.MapView上添加了onRegionDidChange属性。 因此,当我更改may on pan并在地图上放大/缩小时,将调用此方法。 它在Android设备上可以完美运行,但在某种程度上不能在iOS设备上运行。

<MapboxGL.MapView
        key = {"mapId"}
        ref={map => { this.map = map }}
        textureMode = {true}
        zoomLevel={this.props.zoomLevel}
        styleURL={'https://free.tilehosting.com/styles/bright/style.json?key=VJidzi1RXgsZY6MIfdAE'}
        centerCoordinate={this.state.centerCoordinate || this.state.origin}
        onPress={()=>DismissKeyboard()}
        onLongPress={this.onPress}
        attributionEnabled={false}
        animated={true}
        onRegionDidChange={this.onRegionWillChange}

我用于react-native应用程序的版本:

  • @ mapbox / react-native-mapbox-gl:6.1.2

  • 反应本机:0.55.4

我也尝试过使用@mapbox/react-native-mapbox-gl: 6.1.3 mapbox模块的@mapbox/react-native-mapbox-gl: 6.1.3 npm版本,但仍然面临相同的问题。

我想在地图的更改区域上获得visiblebound,以获取两个坐标之间的最长距离。

ios react-native mapbox-gl
© www.soinside.com 2019 - 2024. All rights reserved.