2017-01-08 2 views
0

したがって、0,0でないように、マップボックスの初期中心座標を設定しようとしています。 APIのそれはmapboxがネイティブのマップボックスに反応します。gl最初の中心座標

initialCenterCoordinate object Optional Initial latitude/longitude the map will load at. { latitude:0, longitude: 0 } 

の小道具は、だから私はこの}は期待して、予期しないトークンを言って私にその行にエラーを与えている

<Mapbox 
    initialCenterCoordinate={latitude: 40.444328, longitude: -79.953155} .... other props/> 

をしてい見込んで言います。

私は

<Mapbox 
    initialCenterCoordinate={{latitude: 40.444328, longitude: -79.953155}} .... other props/> 

ような何かをするたびにそれはまだ0,0に私の最初のスポットを設定します。誰でもアイデアはありますか?

EDIT:あなたのコンストラクタでhttps://github.com/mapbox/react-native-mapbox-gl

答えて

0

PAGE- gitのハブに リンクを試してください:

this.state = { 
    position : { 
     latitude: 49.437090, 
     longitude: 1.097456, 
    } 
}; 

そして:

<MapView initialCenterCoordinate={this.state.position}> </MapView> 
関連する問題