Guest User

Untitled

a guest
May 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. // MapTools Component
  2. <View style={[styles.container, top && styles.top,]}>
  3. <TouchableOpacity hitSlop={{ top: 8, left: 8, right: 8, bottom: 8, }} onPress={onPress}>
  4. {children}
  5. </TouchableOpacity>
  6. </View>
  7.  
  8.  
  9. // MapTools styles
  10. export default StyleSheet.create({
  11. container: {
  12. ...Platform.select({
  13. android: {
  14. backgroundColor: 'white',
  15. borderRadius: 40,
  16. elevation: 2,
  17. height: 40,
  18. marginTop: 8,
  19. width: 40,
  20. },
  21. ios: {
  22. borderTopColor: colors.border,
  23. borderTopWidth: 1,
  24. height: 48,
  25. width: 48,
  26. },
  27. }),
  28.  
  29. alignItems: 'center',
  30. justifyContent: 'center',
  31. },
  32. top: Platform.select({
  33. android: { marginTop: 0, },
  34. ios: { borderTopWidth: 0, },
  35. }),
  36. })
  37.  
  38. // Integration with the map:
  39. <View style={styles.container}>
  40. <MapTools onLocatePress={this.onLocateMe} tracking={this.state.isTracking} />
  41. {mapbox}
  42. </View>
  43.  
  44. // Map container styles
  45. const styles = StyleSheet.create({
  46. container: {
  47. // <MapboxGL.MapView> doesn't seem to like other position absolute views
  48. ...StyleSheet.absoluteFillObject,
  49. alignItems: 'flex-end',
  50. flex: 1,
  51. paddingHorizontal: Platform.select({ android: 16, ios: 8, }),
  52. paddingVertical: 16,
  53. zIndex: 1,
  54. }
  55. })
Add Comment
Please, Sign In to add comment