Как перенести ориентацию карты благодаря данным гироскопа (датчика) в приложении GoogleMap?(React-родной) - PullRequest
0 голосов
/ 11 февраля 2019

Кто-нибудь знает, как перенести ориентацию карты благодаря данным гироскопа (x, y и z) как приложение GoogleMap?

Здесь я получаю эти значения, но я не знаю, как реализовать их в response-native-maps ...

Итак, у меня есть следующий код:

componentWillMount() {

    this._toggle();
}

_subscribe = () => {
    this._subscription = Gyroscope.addListener((result) => {
        this.setState({gyroscopeData: result});
    });
};

_unsubscribe = () => {
    this._subscription && this._subscription.remove();
    this._subscription = null;
};


render() {
    let { x, y, z } = this.state.gyroscopeData;
    //console.log(this.round(x), this.round(y), this.round(z));
    return (
        <View style={styles.container}>
            <MapView
                style={styles.map}
                followsUserLocation
                showsUserLocation
                showsMyLocationButton
                loadingEnabled
                initialRegion={this.state.mapRegion}
                mapType="none"
                >
                <UrlTile
                urlTemplate="https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"/>

                {this.props.children}

            </MapView>


        </View>

    );

}

Спасибо заранее!

...