{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/react-native-maps/issues/100","repository_url":"https://api.github.com/repos/airbnb/react-native-maps","labels_url":"https://api.github.com/repos/airbnb/react-native-maps/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/react-native-maps/issues/100/comments","events_url":"https://api.github.com/repos/airbnb/react-native-maps/issues/100/events","html_url":"https://github.com/airbnb/react-native-maps/issues/100","id":136732822,"number":100,"title":"Images inside Marker views are not always rendered on Android","user":{"login":"priithaamer","id":194640,"avatar_url":"https://avatars3.githubusercontent.com/u/194640?v=3","gravatar_id":"","url":"https://api.github.com/users/priithaamer","html_url":"https://github.com/priithaamer","followers_url":"https://api.github.com/users/priithaamer/followers","following_url":"https://api.github.com/users/priithaamer/following{/other_user}","gists_url":"https://api.github.com/users/priithaamer/gists{/gist_id}","starred_url":"https://api.github.com/users/priithaamer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/priithaamer/subscriptions","organizations_url":"https://api.github.com/users/priithaamer/orgs","repos_url":"https://api.github.com/users/priithaamer/repos","events_url":"https://api.github.com/users/priithaamer/events{/privacy}","received_events_url":"https://api.github.com/users/priithaamer/received_events","type":"User","site_admin":false},"labels":[{"id":318657339,"url":"https://api.github.com/repos/airbnb/react-native-maps/labels/Android","name":"Android","color":"009800","default":false},{"id":305036006,"url":"https://api.github.com/repos/airbnb/react-native-maps/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":41,"created_at":"2016-02-26T15:50:02Z","updated_at":"2017-07-05T20:14:24Z","closed_at":null,"body":"When using images within custom views on Markers like this, they are not always rendered on Android (sometimes they appear though):\n\n``` jsx\n<MapView.Marker coordinate={...}>\n  <View>\n    <Image source={require('./image.png')} />\n  </View>\n</MapView.Marker>\n```\n\nWith `adb logcat` i always see this error when image is not rendered:\n\n```\nE/unknown:DraweeEventTracker(19143): 1b82b058: Draw requested for a non-attached controller e80013b. DraweeHolder{controllerAttached=false, holderAttached=false, drawableVisible=true, activityStarted=true, events=[ON_SET_HIERARCHY, ON_SET_CONTROLLER]}\n```\n\nImages on markers only appear correctly on Android, when using `<Marker image=\"...\" />`\n\nI'm using React Native 0.20\n"},"comment":{"url":"https://api.github.com/repos/airbnb/react-native-maps/issues/comments/313213888","html_url":"https://github.com/airbnb/react-native-maps/issues/100#issuecomment-313213888","issue_url":"https://api.github.com/repos/airbnb/react-native-maps/issues/100","id":313213888,"user":{"login":"tugorez","id":7821057,"avatar_url":"https://avatars0.githubusercontent.com/u/7821057?v=3","gravatar_id":"","url":"https://api.github.com/users/tugorez","html_url":"https://github.com/tugorez","followers_url":"https://api.github.com/users/tugorez/followers","following_url":"https://api.github.com/users/tugorez/following{/other_user}","gists_url":"https://api.github.com/users/tugorez/gists{/gist_id}","starred_url":"https://api.github.com/users/tugorez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tugorez/subscriptions","organizations_url":"https://api.github.com/users/tugorez/orgs","repos_url":"https://api.github.com/users/tugorez/repos","events_url":"https://api.github.com/users/tugorez/events{/privacy}","received_events_url":"https://api.github.com/users/tugorez/received_events","type":"User","site_admin":false},"created_at":"2017-07-05T20:14:24Z","updated_at":"2017-07-05T20:14:24Z","body":"Im sorry not to being enough prepared (I'm not an Android nor IOS developer) to fix this bug :/ .\r\nI think as a workaround is better to handle it locally on the custom marker component. \r\nWriting a custom component like this avoids the images problem (at least in Android 5 & 6 with RN43).\r\n\r\n```javascript\r\nimport React, { Component, PropTypes } from 'react';\r\nimport { Image, View } from 'react-native';\r\nimport MapView from 'react-native-maps';\r\nimport Icon from 'components/Icon';\r\nimport styles from './styles';\r\n\r\nclass Marker extends Component {\r\n  constructor(props) {\r\n    super(props);\r\n    this.state = { loaded: false };\r\n  }\r\n\r\n  onLoad() {\r\n    this.setState({ loaded: true });\r\n  }\r\n\r\n  render() {\r\n    const { image, latitude, longitude, onPress } = this.props;\r\n    const loaded = image && this.state.loaded;\r\n    const onLoad = this.onLoad.bind(this);\r\n    return (\r\n      <MapView.Marker coordinate={{ latitude, longitude }} onPress={onPress}>\r\n        <View style={styles.container}>\r\n          { loaded &&\r\n            <Image source={{ uri: image }} style={styles.image} />\r\n          }\r\n          { !loaded &&\r\n            <View style={styles.logo}>\r\n              <Icon name=\"logo\" color=\"#4A0063\" size={35} />\r\n              <Image source={{ uri: image }} onLoad={onLoad} />\r\n            </View>\r\n          }\r\n      </MapView.Marker>\r\n    );\r\n  }\r\n}\r\n\r\nMarker.propTypes = {\r\n  image: PropTypes.string,\r\n  latitude: PropTypes.number,\r\n  longitude: PropTypes.number,\r\n  onPress: PropTypes.func,\r\n};\r\n\r\nexport default Marker;\r\n```\r\nSorry for my bad english."}}
{"actor":{"display_login":"tugorez"}}