title: How to use ajax on PruneCluster
body: <p>I use ajax to update location of markers every 10seconds with <a href="https://github.com/SINTEF-9012/PruneCluster" rel="nofollow noreferrer">PruneCluster</a></p>
  
  <pre><code>       (function update() {
          $.ajax({
              url: 'https://wanderdrone.appspot.com/',
              dataType: 'json',  //The data type expected of the server response.
              success: function (data) {
  
                  var leafletView = new PruneClusterForLeaflet();
                  leafletView.BuildLeafletClusterIcon = function (cluster) {
                      var e = new L.Icon.MarkerCluster();
                      e.stats = cluster.stats;
                      e.population = cluster.population;
                      cluster.ENABLE_MARKERS_LIST = true
                      return e;
                  };
  
                  var markers = [];
                  var myServerData = data;  //server response
                  console.log(data);
                  map.setView(new L.LatLng((myServerData.geometry.coordinates[1]), (myServerData.geometry.coordinates[0])), 12)
                  var marker = new PruneCluster.Marker((myServerData.geometry.coordinates[1]), (myServerData.geometry.coordinates[0]));
                  markers.push(marker);
                  leafletView.RegisterMarker(marker);
                  leafletView.ProcessView();
                  map.addLayer(leafletView)
  
              }
  
          })
              .then(function () {           // on completion, restart
                  setTimeout(update, 10000);  // function refers to itself
              });
      })();
  </code></pre>
  
  <p>I have new marker's location update but it doesn't seem to delete the previous's marker's layer. The new markers keep drawing on top of the old one and they are still there. 
  I keep getting the new markers and cluster drawing ontop of the old one. I am wondering how can I delete the previous marker's later and using the new one. </p>