| 764 | } |
| 765 | |
| 766 | function clearStaleMarkers () { |
| 767 | $.each(mapData.pokemons, function (key, value) { |
| 768 | if (mapData.pokemons[key]['disappear_time'] < new Date().getTime() || |
| 769 | excludedPokemon.indexOf(mapData.pokemons[key]['pokemon_id']) >= 0) { |
| 770 | if (mapData.pokemons[key].marker.rangeCircle) { |
| 771 | mapData.pokemons[key].marker.rangeCircle.setMap(null) |
| 772 | delete mapData.pokemons[key].marker.rangeCircle |
| 773 | } |
| 774 | mapData.pokemons[key].marker.setMap(null) |
| 775 | delete mapData.pokemons[key] |
| 776 | } |
| 777 | }) |
| 778 | |
| 779 | $.each(mapData.lurePokemons, function (key, value) { |
| 780 | if (mapData.lurePokemons[key]['lure_expiration'] < new Date().getTime() || |
| 781 | excludedPokemon.indexOf(mapData.lurePokemons[key]['pokemon_id']) >= 0) { |
| 782 | mapData.lurePokemons[key].marker.setMap(null) |
| 783 | delete mapData.lurePokemons[key] |
| 784 | } |
| 785 | }) |
| 786 | |
| 787 | $.each(mapData.scanned, function (key, value) { |
| 788 | // If older than 15mins remove |
| 789 | if (mapData.scanned[key]['last_modified'] < (new Date().getTime() - 15 * 60 * 1000)) { |
| 790 | mapData.scanned[key].marker.setMap(null) |
| 791 | delete mapData.scanned[key] |
| 792 | } |
| 793 | }) |
| 794 | } |
| 795 | |
| 796 | function showInBoundsMarkers (markers, type) { |
| 797 | $.each(markers, function (key, value) { |