Skip to content

Commit c1f3531

Browse files
Update App.js
1 parent 4718a65 commit c1f3531

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

App.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const Toast = (message) => {
2222
);
2323
}
2424

25-
const MAPS_API_KEY = ''
25+
const MAPS_API_KEY = 'your-api-key'
2626
const PlacesAPIURL = (lat,lng) => `https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=${lat},${lng}&radius=50&key=${MAPS_API_KEY}`;
2727

2828
const distanceBetweenPoints = (p1, p2) => {
@@ -181,9 +181,11 @@ class HelloWorldSceneAR extends Component {
181181
const distance = distanceBetweenPoints(this.state.location, {latitude: item.lat, longitude: item.lng});
182182
return (
183183
<ViroNode key={item.id} scale={[scale, scale, scale]} rotation={[0, 0, 0]} position={[coords.x, 0, coords.z]}>
184-
<ViroImage source={{uri: item.icon}} position={[0,1,0]}/>
185-
<ViroText text={item.title} style={styles.helloWorldTextStyle} />
186-
<ViroText text={`${Number(distance).toFixed(2)} km away`} style={styles.helloWorldTextStyle} position={[0, -0.75, 0]}/>
184+
<ViroFlexView style={{alignItems: 'center', justifyContent: 'center'}}>
185+
<ViroText width={4} height={0.5} text={item.title} style={styles.helloWorldTextStyle} />
186+
<ViroText width={4} height={0.5} text={`${Number(distance).toFixed(2)} km`} style={styles.helloWorldTextStyle} position={[0, -0.75, 0]}/>
187+
<ViroImage width={1} height={1} source={{uri: item.icon}} position={[0,-1.5,0]}/>
188+
</ViroFlexView>
187189
</ViroNode>
188190
)
189191
});

0 commit comments

Comments
 (0)