MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / clearStaleMarkers

Function clearStaleMarkers

static/js/map.js:766–794  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

764}
765
766function 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
796function showInBoundsMarkers (markers, type) {
797 $.each(markers, function (key, value) {

Callers 2

updateMapFunction · 0.85
map.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected