{"action":"created","issue":{"url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/215","repository_url":"https://api.github.com/repos/lelandrichardson/react-native-maps","labels_url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/215/comments","events_url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/215/events","html_url":"https://github.com/lelandrichardson/react-native-maps/issues/215","id":153461704,"number":215,"title":"Reordering markers has no effect on the map","user":{"login":"madox2","id":15847857,"avatar_url":"https://avatars.githubusercontent.com/u/15847857?v=3","gravatar_id":"","url":"https://api.github.com/users/madox2","html_url":"https://github.com/madox2","followers_url":"https://api.github.com/users/madox2/followers","following_url":"https://api.github.com/users/madox2/following{/other_user}","gists_url":"https://api.github.com/users/madox2/gists{/gist_id}","starred_url":"https://api.github.com/users/madox2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madox2/subscriptions","organizations_url":"https://api.github.com/users/madox2/orgs","repos_url":"https://api.github.com/users/madox2/repos","events_url":"https://api.github.com/users/madox2/events{/privacy}","received_events_url":"https://api.github.com/users/madox2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-06T14:24:02Z","updated_at":"2016-05-06T19:39:28Z","closed_at":null,"body":"I am trying to display multiple markers on the map where one can be selected (pin color is red). If there are markers close to each other I want selected marker to be in foreground.\r\n\r\nI have tried to push selected marker to the end of the array in order to be rendered last:\r\n\r\n```javascript\r\nrender() {\r\n  const { selected } = this.state;\r\n  const points = [\r\n    ...this.data.filter(p => p.id !== selected.id),\r\n    ...this.data.filter(p => p.id === selected.id)\r\n  ];\r\n  return (\r\n    <MapView style={styles.map} initialRegion={this.initialRegion} ref=\"map\">\r\n    {points.map(p => (\r\n      <Marker\r\n        pinColor={p.id === selected.id ? 'red' : 'blue'}\r\n        onPress={() => this.onPointSelect(p)}\r\n        coordinate={{ latitude: p.latitude, longitude: p.longitude }} />\r\n    ))}\r\n    </MapView>\r\n  );\r\n}\r\n```\r\nI can see that `points` has the expected order in log output, but order on the device remains the same.\r\n\r\nI have also tried to add `key` property:\r\n\r\n```javascript\r\n<Marker\r\n  key={p.id}\r\n  pinColor={p.id === selected.id ? 'red' : 'blue'}\r\n  onPress={() => this.onPointSelect(p)}\r\n  coordinate={{ latitude: p.latitude, longitude: p.longitude }} />\r\n```\r\n\r\nIt doesn't work too and furthermore the color of marker is not changed on select. I suppose there is a bug when using `key` property because it doesn't re-render markers at all. I have tried this on android device.\r\n\r\nIs there any other way how to force one marker to be displayed above others?"},"comment":{"url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/comments/217539558","html_url":"https://github.com/lelandrichardson/react-native-maps/issues/215#issuecomment-217539558","issue_url":"https://api.github.com/repos/lelandrichardson/react-native-maps/issues/215","id":217539558,"user":{"login":"benhoyt","id":999033,"avatar_url":"https://avatars.githubusercontent.com/u/999033?v=3","gravatar_id":"","url":"https://api.github.com/users/benhoyt","html_url":"https://github.com/benhoyt","followers_url":"https://api.github.com/users/benhoyt/followers","following_url":"https://api.github.com/users/benhoyt/following{/other_user}","gists_url":"https://api.github.com/users/benhoyt/gists{/gist_id}","starred_url":"https://api.github.com/users/benhoyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benhoyt/subscriptions","organizations_url":"https://api.github.com/users/benhoyt/orgs","repos_url":"https://api.github.com/users/benhoyt/repos","events_url":"https://api.github.com/users/benhoyt/events{/privacy}","received_events_url":"https://api.github.com/users/benhoyt/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T19:39:28Z","updated_at":"2016-05-06T19:39:28Z","body":"Yep, I'm seeing this exact same issue (and tried the same solution). Markers seem to have a bit of trouble updating in certain cases, for example, if you set a style attribute in a marker based on a prop, and then change the prop it won't update."}}