function initialize() {
  var encounterIds = {};
  var latlng = new google.maps.LatLng(35.643757,139.826647);
  var opts = {
    zoom: 18,
    center: latlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("mypoke"), opts);
  // console.log(map.getCenter().lat());

  var socket = io.connect();
  $('#search').click(function() {
    if(!$('#search').hasClass('disabled')) {
      $('#search').addClass('disabled');
      var center = map.getCenter();
      socket.emit('search', { latitude: center.lat(), longitude: center.lng() });
      setTimeout(function() {
        $('#search').removeClass('disabled');
      }, 30000);  
    }
  });

  socket.on('pokemons', function(pokes) {
    $.each(pokes, function(eid, rawPokemon) {
      var pokemon = pokemons[rawPokemon.pokemon_id.toString()];
      console.log(eid);
      console.log(rawPokemon);
      console.log(pokemon);
      if (!encounterIds[eid]) {
        encounterIds[eid] = true;
        var latlng = new google.maps.LatLng(rawPokemon.lat ,rawPokemon.lng);
        var image = {
          url : pokemon.img,
          scaledSize : new google.maps.Size(32, 32)
        }
        var mopts = {
          position: latlng,
          map: map,
          icon: image,
          title: pokemon.ja
        };
        var marker = new google.maps.Marker(mopts);
        var vanishDate = new Date(rawPokemon.expiration_time);
        var content = "Name: " + pokemon.ja + "<br>" + "Vanished: " + vanishDate.toLocaleString();
        var infowindow = new google.maps.InfoWindow({
          content: content
        });
        marker.addListener('click', function() {
          infowindow.open(map, marker);
        });
        console.log(rawPokemon.expiration_time - Date.now())
        setTimeout(function() {
          marker.setMap(null);
        }, rawPokemon.expiration_time - Date.now());
      }
    })
  });

}

@@ -677,18 +677,16 @@
  30000);
-  
 %0A    %7D%0A 
@@ -691,16 +691,301 @@
 %0A  %7D);%0A%0A
+  setInterval(function() %7B%0A    $.each(encounterIds, function(eid, pokemon) %7B%0A      if (Date.now() %3E pokemon.raw.expiration_time) %7B%0A        console.log(%22pokemon was deleted by cleaner%22)%0A        pokemon.marker.setMap(null);%0A        delete encounterIds%5Beid%5D;%0A      %7D%0A    %7D);%0A  %7D, 5000);%0A%0A
   socket
@@ -1138,24 +1138,32 @@
     
-console.log(eid)
+pokemon.raw = rawPokemon
 ;%0A  
@@ -1178,26 +1178,19 @@
 ole.log(
-rawPokemon
+eid
 );%0A     
@@ -1248,42 +1248,8 @@
 ) %7B%0A
-        encounterIds%5Beid%5D = true;%0A
     
@@ -1618,16 +1618,49 @@
 mopts);%0A
+        pokemon.marker = marker;%0A
         
@@ -2184,16 +2184,53 @@
 now());%0A
+        encounterIds%5Beid%5D = pokemon;%0A
       %7D%0A

Add cleaner to client