Как включить высокую точность в react-native-mapbox-gl - PullRequest
0 голосов
/ 06 августа 2020

Я пытаюсь включить высокую точность в react-native-mapbox-gl, но не могу получить высокую точность prop или что-то еще. Это мой код

<MapView styleURL={MapboxGL.StyleURL.Dark} style={styles.map}>
            <Camera zoomLevel={18} followUserLocation />
            <UserLocation visible={true} onUpdate={onUserLocationUpdate} />
            {locationsArray.length > 2 && (
              <ShapeSource
                id={'route'}
                shape={
                  lineString(locationsArray)
                }>
                <LineLayer id={'lineroute'} style={line} />
              </ShapeSource>
            )}
          </MapView>
const onUserLocationUpdate = async (location: MapboxGL.Location) => {
    if (location && isActive) {
      locationsArray.push([
        location.coords.longitude,
        location.coords.latitude
      ])
      if (location.coords.altitude) {
        if (fakeAltitude !== 0) {
          setAltitude(altitude + fakeAltitude - location.coords.altitude)
        }
        setFakeAltitude(location.coords.altitude)
      }
      if (location.coords.speed) {
        setSpeed(location.coords.speed)
      }
    }
    if (locationsArray.length > 2) {
      setDistance(Math.round(length(lineString(locationsArray), { units: 'kilometers' }) * 100) / 100)
    }
  }
...