nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

TypeError: undefined is not an object (evaluating '_helpers.default.point') #1494

Closed cedricdelpoux closed 5 years ago

cedricdelpoux commented 5 years ago

Hello, I have an error when I try to center the map but the same error happen for everything

Without centerCoordinate prop:

<MapboxGL.MapView
        ref={c => (this._map = c)}
        zoomLevel={15}
        styleURL={MapboxGL.StyleURL.Street}
      />
screenshot 2019-01-31 at 14 03 21

With centerCoordinate prop:

<MapboxGL.MapView
        ref={c => (this._map = c)}
        centerCoordinate={[1.43738, 43.63331]}
        zoomLevel={15}
        styleURL={MapboxGL.StyleURL.Street}
      />
screenshot 2019-01-31 at 14 02 39

build.gradle:

    implementation project(':mapbox-react-native-mapbox-gl') {
        implementation ('com.squareup.okhttp3:okhttp:3.6.0') {
            force = true
        }
    }

settings.gradle:

include ':mapbox-react-native-mapbox-gl'
project(':mapbox-react-native-mapbox-gl').projectDir = new File(rootProject.projectDir, '../node_modules/@mapbox/react-native-mapbox-gl/android/rctmgl')
nitaliano commented 5 years ago

that error is telling you that it can't find @turf/helpers are you sure it's installed?

cedricdelpoux commented 5 years ago

Is it mandatory per default ? I did not see it in the doc

kristfal commented 5 years ago

Likely your NPM/Yarn install failed. This lib depends on turf as a dependency, make sure it is in node_modules under /node_modules/@mapbox/react-native-mapbox-gl