<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: MarkerClusterer clearMarkers bugfix</title>
	<atom:link href="http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/</link>
	<description>// MAXB.NET LABS</description>
	<lastBuildDate>Tue, 22 Nov 2011 17:06:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Markerclusterer clearMarkers &#8211; (function() {</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-13526</link>
		<dc:creator>Markerclusterer clearMarkers &#8211; (function() {</dc:creator>
		<pubDate>Mon, 29 Mar 2010 14:23:16 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-13526</guid>
		<description>[...] the last two posts, I described a bug but later I realized it was a false positive. There was no bug in the [...]</description>
		<content:encoded><![CDATA[<p>[...] the last two posts, I described a bug but later I realized it was a false positive. There was no bug in the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-13259</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Mon, 15 Mar 2010 16:41:56 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-13259</guid>
		<description>Thanks for that additional information.


I just saw this:

http://code.google.com/p/gmaps-utility-library-dev/source/detail?r=1214

It appears the bug may have been addressed in r1214 which was just committed last week.

I&#039;m going to check out 1214 now and see how it goes.

Cheers</description>
		<content:encoded><![CDATA[<p>Thanks for that additional information.</p>
<p>I just saw this:</p>
<p><a href="http://code.google.com/p/gmaps-utility-library-dev/source/detail?r=1214" rel="nofollow">http://code.google.com/p/gmaps-utility-library-dev/source/detail?r=1214</a></p>
<p>It appears the bug may have been addressed in r1214 which was just committed last week.</p>
<p>I&#8217;m going to check out 1214 now and see how it goes.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Massimiliano Balestrieri</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-13255</link>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
		<pubDate>Mon, 15 Mar 2010 14:05:06 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-13255</guid>
		<description>@Nick

http://maxb.net/blog/2010/03/15/markerclusterer-clearmarkers-bug-demo/

http://code.google.com/p/gmaps-utility-library-dev/issues/detail?id=196</description>
		<content:encoded><![CDATA[<p>@Nick</p>
<p><a href="http://maxb.net/blog/2010/03/15/markerclusterer-clearmarkers-bug-demo/" rel="nofollow">http://maxb.net/blog/2010/03/15/markerclusterer-clearmarkers-bug-demo/</a></p>
<p><a href="http://code.google.com/p/gmaps-utility-library-dev/issues/detail?id=196" rel="nofollow">http://code.google.com/p/gmaps-utility-library-dev/issues/detail?id=196</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-13190</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sat, 13 Mar 2010 02:21:20 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-13190</guid>
		<description>I just wanted to say a deep and heartfelt thanks for this patch! This issue was driving me crazy today.

Have you submitted this or a bug report to the project? The fact the documented call is not functional will likely hit others it would be great to see this fix incorporated.</description>
		<content:encoded><![CDATA[<p>I just wanted to say a deep and heartfelt thanks for this patch! This issue was driving me crazy today.</p>
<p>Have you submitted this or a bug report to the project? The fact the documented call is not functional will likely hit others it would be great to see this fix incorporated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Massimiliano Balestrieri</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-11975</link>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
		<pubDate>Fri, 15 Jan 2010 09:28:27 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-11975</guid>
		<description>@simon

see here
http://www.piemonteitalia.eu/index.php?option=com_mappet

the &quot;main&quot; of the application is here:
http://www.piemonteitalia.eu/components/com_mappet/views/mappet/js/mappet.js

when i submit the form I invoke processJson
in function &quot;processJson&quot; I call 
markerCluster.destroy();

I hope I have been of help to you</description>
		<content:encoded><![CDATA[<p>@simon</p>
<p>see here<br />
<a href="http://www.piemonteitalia.eu/index.php?option=com_mappet" rel="nofollow">http://www.piemonteitalia.eu/index.php?option=com_mappet</a></p>
<p>the &#8220;main&#8221; of the application is here:<br />
<a href="http://www.piemonteitalia.eu/components/com_mappet/views/mappet/js/mappet.js" rel="nofollow">http://www.piemonteitalia.eu/components/com_mappet/views/mappet/js/mappet.js</a></p>
<p>when i submit the form I invoke processJson<br />
in function &#8220;processJson&#8221; I call<br />
markerCluster.destroy();</p>
<p>I hope I have been of help to you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-11806</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 07 Jan 2010 18:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-11806</guid>
		<description>Hi
I&#039;m &lt;a href=&quot;http://www.speich.net/photo/photodb/photo-mapsearch.php&quot; rel=&quot;nofollow&quot;&gt;using the MarkerClusterer to display my photos&lt;/a&gt;. At one point I always have to completely recreate the clusterer, because the clearMarkersMarkers() method doesn&#039;t seem to work. Searching google I found your patch.  I added you patch, but It doesn&#039;t seem to make a difference. as NeerjuGupta I don&#039;t understand your code. You added:
[code]
...
 this.destroy = function() {
		this.clearMarkers();
		GEvent.removeListener(mcfn_);
		mcfn_ = null;
		me_ = null;
	}
...
[/code]
but this.destroy get&#039;s never called?</description>
		<content:encoded><![CDATA[<p>Hi<br />
I&#8217;m <a href="http://www.speich.net/photo/photodb/photo-mapsearch.php" rel="nofollow">using the MarkerClusterer to display my photos</a>. At one point I always have to completely recreate the clusterer, because the clearMarkersMarkers() method doesn&#8217;t seem to work. Searching google I found your patch.  I added you patch, but It doesn&#8217;t seem to make a difference. as NeerjuGupta I don&#8217;t understand your code. You added:</p>
<pre class="brush: plain; title: ; notranslate">
...
 this.destroy = function() {
		this.clearMarkers();
		GEvent.removeListener(mcfn_);
		mcfn_ = null;
		me_ = null;
	}
...
</pre>
<p>but this.destroy get&#8217;s never called?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NeerjuGupta</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-11365</link>
		<dc:creator>NeerjuGupta</dc:creator>
		<pubDate>Tue, 15 Dec 2009 17:45:03 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-11365</guid>
		<description>Hi,

Faced few more issues after applying  above patch. I was trying to clear the markers and readd them based on some criteria.Problem was after calling &#039;destroy&#039; it removed the listener and never added it back.So for newly added markers cluster stopped redrawing itself.have fixed the issues as follows.

    3.38 @@ -375,22 +379,43 @@
    3.39     * @param {Array of GMarker} markers The markers you want to add.
    3.40     */
    3.41    this.addMarkers = function (markers) {
    3.42 -	
    3.43      for (var i = 0; i &lt; markers.length; ++i) {
    3.44        this.addMarker(markers[i], true);
    3.45      }
    3.46      this.redraw_();
    3.47 +	//##neerjug fixed for clearMarkers.
    3.48 +	if (!mcfn_  &#124;&#124; mcfn_=== null) {
    3.49 +		mcfn_ = GEvent.addListener(map_, &quot;moveend&quot;, function(){
    3.50 +				me_.resetViewport();
    3.51 +			});
    3.52 +	}
    3.53    };
    3.54  
    3.55    // initialize
    3.56    if (typeof opt_markers === &quot;object&quot; &amp;&amp; opt_markers !== null) {
    3.57      this.addMarkers(opt_markers);
    3.58 +	
    3.59    }
    3.60 +    // when map move end, regroup.
    3.61 +	//neerjug modified.it was a bug. moveend was not behaving properly after clearmarkers if fired.
    3.62 +//			mcfn_ = GEvent.addListener(map_, &quot;moveend&quot;, function(){
    3.63 +//				me_.resetViewport();
    3.64 +//			});
    3.65 +  //###max
    3.66 +  this.destroy = function(){
    3.67 +	this.clearMarkers();
    3.68 +	if (mcfn_ != null) {
    3.69 +		GEvent.removeListener(mcfn_);
    3.70 +		mcfn_ = null;
    3.71 +		//me_ = null;
    3.72 +	}
    3.73 +	
    3.74 +	
    3.75 +  }
    3.76 +  //###max
    3.77  
    3.78 -  // when map move end, regroup.
    3.79 -  mcfn_ = GEvent.addListener(map_, &quot;moveend&quot;, function () {
    3.80 -    me_.resetViewport();
    3.81 -  });
    3.82 +  //##neerjug end of fixes for clear markers.
    3.83 + 
    3.84  }</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Faced few more issues after applying  above patch. I was trying to clear the markers and readd them based on some criteria.Problem was after calling &#8216;destroy&#8217; it removed the listener and never added it back.So for newly added markers cluster stopped redrawing itself.have fixed the issues as follows.</p>
<p>    3.38 @@ -375,22 +379,43 @@<br />
    3.39     * @param {Array of GMarker} markers The markers you want to add.<br />
    3.40     */<br />
    3.41    this.addMarkers = function (markers) {<br />
    3.42 -<br />
    3.43      for (var i = 0; i &lt; markers.length; ++i) {<br />
    3.44        this.addMarker(markers[i], true);<br />
    3.45      }<br />
    3.46      this.redraw_();<br />
    3.47 +	//##neerjug fixed for clearMarkers.<br />
    3.48 +	if (!mcfn_  || mcfn_=== null) {<br />
    3.49 +		mcfn_ = GEvent.addListener(map_, &quot;moveend&quot;, function(){<br />
    3.50 +				me_.resetViewport();<br />
    3.51 +			});<br />
    3.52 +	}<br />
    3.53    };<br />
    3.54<br />
    3.55    // initialize<br />
    3.56    if (typeof opt_markers === &quot;object&quot; &amp;&amp; opt_markers !== null) {<br />
    3.57      this.addMarkers(opt_markers);<br />
    3.58 +<br />
    3.59    }<br />
    3.60 +    // when map move end, regroup.<br />
    3.61 +	//neerjug modified.it was a bug. moveend was not behaving properly after clearmarkers if fired.<br />
    3.62 +//			mcfn_ = GEvent.addListener(map_, &quot;moveend&quot;, function(){<br />
    3.63 +//				me_.resetViewport();<br />
    3.64 +//			});<br />
    3.65 +  //###max<br />
    3.66 +  this.destroy = function(){<br />
    3.67 +	this.clearMarkers();<br />
    3.68 +	if (mcfn_ != null) {<br />
    3.69 +		GEvent.removeListener(mcfn_);<br />
    3.70 +		mcfn_ = null;<br />
    3.71 +		//me_ = null;<br />
    3.72 +	}<br />
    3.73 +<br />
    3.74 +<br />
    3.75 +  }<br />
    3.76 +  //###max<br />
    3.77<br />
    3.78 &#8211;  // when map move end, regroup.<br />
    3.79 &#8211;  mcfn_ = GEvent.addListener(map_, &quot;moveend&quot;, function () {<br />
    3.80 &#8211;    me_.resetViewport();<br />
    3.81 &#8211;  });<br />
    3.82 +  //##neerjug end of fixes for clear markers.<br />
    3.83 +<br />
    3.84  }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlo</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-11356</link>
		<dc:creator>Carlo</dc:creator>
		<pubDate>Tue, 15 Dec 2009 07:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-11356</guid>
		<description>@NeerjuGupta:  you can download the original js at the following uri

http://code.google.com/p/gmaps-utility-library-dev/source/browse/trunk/markerclusterer/src/markerclusterer.js</description>
		<content:encoded><![CDATA[<p>@NeerjuGupta:  you can download the original js at the following uri</p>
<p><a href="http://code.google.com/p/gmaps-utility-library-dev/source/browse/trunk/markerclusterer/src/markerclusterer.js" rel="nofollow">http://code.google.com/p/gmaps-utility-library-dev/source/browse/trunk/markerclusterer/src/markerclusterer.js</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NeerjuGupta</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-11345</link>
		<dc:creator>NeerjuGupta</dc:creator>
		<pubDate>Mon, 14 Dec 2009 22:30:46 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-11345</guid>
		<description>I modified the markerclusterer.js with this patch. but  think something is missing.cant figure out where are you calling the destroy.Is it possible to get the complete updated version of js file.could not find it on gmaps-utility-library-dev.

Thanks,
Neerju</description>
		<content:encoded><![CDATA[<p>I modified the markerclusterer.js with this patch. but  think something is missing.cant figure out where are you calling the destroy.Is it possible to get the complete updated version of js file.could not find it on gmaps-utility-library-dev.</p>
<p>Thanks,<br />
Neerju</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NeerjuGupta</title>
		<link>http://maxb.net/blog/2009/12/01/markerclusterer-clearmarkers-bugfix/comment-page-1/#comment-11343</link>
		<dc:creator>NeerjuGupta</dc:creator>
		<pubDate>Mon, 14 Dec 2009 22:03:34 +0000</pubDate>
		<guid isPermaLink="false">http://maxb.net/blog/?p=521#comment-11343</guid>
		<description>Thank You.I wasted two days to debug this issue. Hope ur bug fix helps.</description>
		<content:encoded><![CDATA[<p>Thank You.I wasted two days to debug this issue. Hope ur bug fix helps.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

