title: Canvas not redrawn unless zoom is changed with leaflet and heatmap.js
body: <p>I have a strange bug in my app using the <a href="https://github.com/pa7/heatmap.js" rel="nofollow noreferrer">heatmap.js</a> plugin, and I'm not sure if the problem is in my code, in <a href="http://leafletjs.com/" rel="nofollow noreferrer">leaflet</a>, or in the plugin.</p>
  <p>I'm  dynamically creating new heatmaps. So I want to erase the old one and trace a new one, which should be the default behavior of heatmpa.js. Surprisingly it doesn't erase the old one until I zoom out or in.</p>
  <p>Here is some images to understand what happens:</p>
  <p><strong>Step 1 :</strong> click on a button to draw a heatmap around paris:
  <img src="https://f.cloud.github.com/assets/4759058/716368/5c17b64c-df34-11e2-8e15-2c4d045cf2c8.png" alt="heatmapidf" /></p>
  <p>Result: as expected, a heatmap around Paris.</p>
  <p><strong>Step 2:</strong> click on a button to draw a heatmap in the east:
  <img src="https://f.cloud.github.com/assets/4759058/716375/7f363a68-df34-11e2-822b-a16d5b7a52cb.png" alt="heatmpap2" />
  Result: the second heatmap is added, but the one around paris isn't erased. (Error)</p>
  <p><strong>Step 3:</strong> click on the plus icon to zoom on the map
  <img src="https://f.cloud.github.com/assets/4759058/716386/ac34732c-df34-11e2-958e-41c1829febe0.png" alt="heatmapne" />
  Result: zoom as intended, and the heatmap around Paris disappear.</p>
  <p>Here is the code of the setData function heatmap-leaflet, it replaces data and call redraw:</p>
  <pre><code> setData: function ( dataset )
   {
      var self = this;
      var latLngs = [];
      this._maxValue = 0;
      dataset.forEach( function ( d )
      {
          latLngs.push( new L.LatLng( d.lat, d.lon ) );
          self._maxValue = Math.max( self._maxValue, d.value );
      } );
      this._bounds = new L.LatLngBounds( latLngs );
  
      this._quad = new QuadTree( this._boundsToQuery( this._bounds ), false, 6, 6 );
  
      dataset.forEach( function ( d )
      {
          self._quad.insert( {
              x: d.lon,
              y: d.lat,
              value: d.value
          } );
      } );
      
      this.redraw();
     }
  </code></pre>
  <p><strong>My question</strong></p>
  <p>I would appreciate any advice on how to locate the problem. A soilution would be even better.</p>