<?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 for you.arenot.me</title>
	<atom:link href="http://you.arenot.me/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://you.arenot.me</link>
	<description>A blog by Colin Wiseman</description>
	<lastBuildDate>Thu, 02 Sep 2010 15:39:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Colin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-413</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 15:39:59 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-413</guid>
		<description>Glad you are happy :) and I have been there with the sanity thing...hence why I wrote this post!

No thanks on the scripts side of things, and don&#039;t worry about putting my name on things - all this is out for the world to take and play with as they please.</description>
		<content:encoded><![CDATA[<p>Glad you are happy <img src='http://you.arenot.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  and I have been there with the sanity thing&#8230;hence why I wrote this post!</p>
<p>No thanks on the scripts side of things, and don&#8217;t worry about putting my name on things &#8211; all this is out for the world to take and play with as they please.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Sorin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-412</link>
		<dc:creator>Sorin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 15:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-412</guid>
		<description>Finally got it to work properly. Hurray! :) I rewrote the whole thing from scratch using your ideas (for which, your name will go in the comments in the JS file :)). 

Only thing I added was an clearOverlay() function to delete all the markers from the map on every &#039;idle&#039; event, right before new markers are added to the map. I&#039;m not 100% sure it&#039;s really necessary, though. In any case, it seems the &#039;idle&#039; event, as well as the &#039;bounds_changed&#039; event, are firing way too quickly (because of tile loading) and sometimes markers are &quot;doubled&quot; on the map. Can&#039;t do much about that, it seems...

I have the brand new implementation at http://cud.dvartora.ro/inprogress, and I&#039;ll keep it there for a few hours (then I&#039;ll put the working script in the root folder and continue working, cause I have some other stuff to do for this website). If you want to copy and scripts, you can do that. Or if you want me to email them to you, just let me know.

Many many thanks again. You&#039;ve saved my sanity today... :) Take care.</description>
		<content:encoded><![CDATA[<p>Finally got it to work properly. Hurray! <img src='http://you.arenot.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I rewrote the whole thing from scratch using your ideas (for which, your name will go in the comments in the JS file <img src='http://you.arenot.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). </p>
<p>Only thing I added was an clearOverlay() function to delete all the markers from the map on every &#8216;idle&#8217; event, right before new markers are added to the map. I&#8217;m not 100% sure it&#8217;s really necessary, though. In any case, it seems the &#8216;idle&#8217; event, as well as the &#8216;bounds_changed&#8217; event, are firing way too quickly (because of tile loading) and sometimes markers are &#8220;doubled&#8221; on the map. Can&#8217;t do much about that, it seems&#8230;</p>
<p>I have the brand new implementation at <a href="http://cud.dvartora.ro/inprogress" rel="nofollow">http://cud.dvartora.ro/inprogress</a>, and I&#8217;ll keep it there for a few hours (then I&#8217;ll put the working script in the root folder and continue working, cause I have some other stuff to do for this website). If you want to copy and scripts, you can do that. Or if you want me to email them to you, just let me know.</p>
<p>Many many thanks again. You&#8217;ve saved my sanity today&#8230; <img src='http://you.arenot.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Take care.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Colin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-411</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 15:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-411</guid>
		<description>I think it is working.  I searched for &quot;număr&quot; and the mapped zoomed into a blank spot.  But I zoomed out and there were couple of hundred points across Africa.

I click one or two and the windows open and closed as expected...on some of them.  But others not. 

Are you somehow adding the points more than once?  

Well I have your code, and data, I might try something tonight as you now have my attention.</description>
		<content:encoded><![CDATA[<p>I think it is working.  I searched for &#8220;număr&#8221; and the mapped zoomed into a blank spot.  But I zoomed out and there were couple of hundred points across Africa.</p>
<p>I click one or two and the windows open and closed as expected&#8230;on some of them.  But others not. </p>
<p>Are you somehow adding the points more than once?  </p>
<p>Well I have your code, and data, I might try something tonight as you now have my attention.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Sorin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-410</link>
		<dc:creator>Sorin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 14:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-410</guid>
		<description>Thanks. Did you have a chance to take a look at http://cud.dvartora.ro/youarenotme yet? That is, as far as I was trying to make it, based entirely on your solution/implementation. Can you give me a hint why THAT isn&#039;t working?

In any case, I will try to start again from scratch, following your 6 steps. Hopefully, I will be successful. If not, I&#039;ll bother you again. :)

Many thanks again,
Sorin</description>
		<content:encoded><![CDATA[<p>Thanks. Did you have a chance to take a look at <a href="http://cud.dvartora.ro/youarenotme" rel="nofollow">http://cud.dvartora.ro/youarenotme</a> yet? That is, as far as I was trying to make it, based entirely on your solution/implementation. Can you give me a hint why THAT isn&#8217;t working?</p>
<p>In any case, I will try to start again from scratch, following your 6 steps. Hopefully, I will be successful. If not, I&#8217;ll bother you again. <img src='http://you.arenot.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Many thanks again,<br />
Sorin</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Colin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-409</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 14:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-409</guid>
		<description>I think you are baffling yourself.

Here are the steps:

1.  Create your map
2.  Get your data for your markers
3.  For each bit of data, create a marker, add it to your map
4.  For each marker add the click event
5.  Create a global info window variable
6.  When the click happens, set the content in the infowindow, and then call the open method with the map and the marker.  

That&#039;s it.  Stray from that, and you will get into bother.

What you seem to be doing is creating a bunch of markers, and then an infowindow for EACH marker and storing the infowindow in an array.  You then open the associated infowindow when you click a marker.  Thus the previous infowindow stays open as it doesn&#039;t know (or really care) another info window has opened.

If you use 1 info window only, it will react properly when you call the open method again with a different marker.

So follow the steps above, and see.  Any bother you can hire me to rewrite your code (am cheap, a pint and bit of dinner generally enough).</description>
		<content:encoded><![CDATA[<p>I think you are baffling yourself.</p>
<p>Here are the steps:</p>
<p>1.  Create your map<br />
2.  Get your data for your markers<br />
3.  For each bit of data, create a marker, add it to your map<br />
4.  For each marker add the click event<br />
5.  Create a global info window variable<br />
6.  When the click happens, set the content in the infowindow, and then call the open method with the map and the marker.  </p>
<p>That&#8217;s it.  Stray from that, and you will get into bother.</p>
<p>What you seem to be doing is creating a bunch of markers, and then an infowindow for EACH marker and storing the infowindow in an array.  You then open the associated infowindow when you click a marker.  Thus the previous infowindow stays open as it doesn&#8217;t know (or really care) another info window has opened.</p>
<p>If you use 1 info window only, it will react properly when you call the open method again with a different marker.</p>
<p>So follow the steps above, and see.  Any bother you can hire me to rewrite your code (am cheap, a pint and bit of dinner generally enough).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Sorin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-408</link>
		<dc:creator>Sorin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 13:59:31 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-408</guid>
		<description>Ok, good point. I was hoping that by closing all the infowindows and by emptying the infowindows array before I open a new one on marker click, that would be solved. In any case, I have the close() method in a for

for (var i=0; i &lt; markers.length; i++) {
  infowindows[i].close();
} // end for loop
infowindows.clear();

so it should work, no? Only then I do: 
infowindows.push(infoWindow);

Also, in the other implementation, based on your solution (http://cud.dvartora.ro/youarenotme), where only one infowindow should be opened and &quot;moved&quot; from marker to marker, there are ALSO multiple infowindows open at one time. Also, there, the script generates multiple markers too, at the same location.

I&#039;m really baffled with both implementations, each in its own way...</description>
		<content:encoded><![CDATA[<p>Ok, good point. I was hoping that by closing all the infowindows and by emptying the infowindows array before I open a new one on marker click, that would be solved. In any case, I have the close() method in a for</p>
<p>for (var i=0; i &lt; markers.length; i++) {<br />
  infowindows[i].close();<br />
} // end for loop<br />
infowindows.clear();</p>
<p>so it should work, no? Only then I do:<br />
infowindows.push(infoWindow);</p>
<p>Also, in the other implementation, based on your solution (<a href="http://cud.dvartora.ro/youarenotme" rel="nofollow">http://cud.dvartora.ro/youarenotme</a>), where only one infowindow should be opened and &quot;moved&quot; from marker to marker, there are ALSO multiple infowindows open at one time. Also, there, the script generates multiple markers too, at the same location.</p>
<p>I&#039;m really baffled with both implementations, each in its own way&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Colin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-407</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 13:44:44 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-407</guid>
		<description>Just quickly noticed you are doing this:

var infoWindow = new google.maps.InfoWindow({ 
                            content: infoWindowContent[number]
                  });
/* other code */
infowindows.clear();
infowindows.push(infoWindow);


Then you are essentially adding a new info window each time.  You will notice my code uses only 1 info window, and applies the marker to it, when the marker is clicked:

for (var i = 0; i &lt; markers.length; i++) {
var marker = markers[i];

// I really should move this outside the loop as it would be cleaner, but i got lazy!
var infowindow = new google.maps.InfoWindow({
content: &quot;holding...&quot;
});

google.maps.event.addListener(marker, &#039;click&#039;, function () {
// where I have added .html to the marker object.
infowindow.setContent(this.html);
infowindow.open(map, this);
});
}

The Google api then closes the current info window, applies the html, and reopens it at the new marker point.

So that&#039;s possibly why the info windows don&#039;t close, you are creating a new one each time, and a close event isn&#039;t sent to the other infowindows.</description>
		<content:encoded><![CDATA[<p>Just quickly noticed you are doing this:</p>
<p>var infoWindow = new google.maps.InfoWindow({<br />
                            content: infoWindowContent[number]<br />
                  });<br />
/* other code */<br />
infowindows.clear();<br />
infowindows.push(infoWindow);</p>
<p>Then you are essentially adding a new info window each time.  You will notice my code uses only 1 info window, and applies the marker to it, when the marker is clicked:</p>
<p>for (var i = 0; i < markers.length; i++) {<br />
var marker = markers[i];</p>
<p>// I really should move this outside the loop as it would be cleaner, but i got lazy!<br />
var infowindow = new google.maps.InfoWindow({<br />
content: &#8220;holding&#8230;&#8221;<br />
});</p>
<p>google.maps.event.addListener(marker, &#8216;click&#8217;, function () {<br />
// where I have added .html to the marker object.<br />
infowindow.setContent(this.html);<br />
infowindow.open(map, this);<br />
});<br />
}</p>
<p>The Google api then closes the current info window, applies the html, and reopens it at the new marker point.</p>
<p>So that&#8217;s possibly why the info windows don&#8217;t close, you are creating a new one each time, and a close event isn&#8217;t sent to the other infowindows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Colin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-405</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 12:58:39 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-405</guid>
		<description>Give me until the weekend to look into if that&#039;s ok.  Bit tied down with work currently - well they pay my wages!  But one thing I&#039;d say just from the quick scan of your js...get yourself jQuery in there.  Will help no end even with just reduceing document.getElementById(x) to $(&quot;#x&quot;).  Speak soon.</description>
		<content:encoded><![CDATA[<p>Give me until the weekend to look into if that&#8217;s ok.  Bit tied down with work currently &#8211; well they pay my wages!  But one thing I&#8217;d say just from the quick scan of your js&#8230;get yourself jQuery in there.  Will help no end even with just reduceing document.getElementById(x) to $(&#8220;#x&#8221;).  Speak soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Sorin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-404</link>
		<dc:creator>Sorin</dc:creator>
		<pubDate>Thu, 02 Sep 2010 12:18:16 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-404</guid>
		<description>Hi, Colin, and many thanks for your post. I&#039;ve tried a lot of ways, but yours seems the easiest and most intelligible. It helped me a lot...

Now, I am working on an implementation at http://cud.dvartora.ro and can&#039;t seem to make it work as it should. The script is at http://cud.dvartora.ro/gmap.js . Basically, I am loading the markers from a mySQL database dynamically via XML (depending on the area of the map being shown). If the map bounds change, the script is supposed to clear the markers and load the new markers for that particular area from the database. So, the sites array needs to be dynamically generated each time the bounds of the viewport change.

For some reason, the clearing of previous markers doesn&#039;t work properly. I get multiple markers at the same (or almost the same) location, as shown by the fact that the shadow seems to darken, and gets bigger. Just enter &quot;Bucharest, Romania&quot; in the search field, click &quot;Cautare&quot; (Search), zoom out a few times and you&#039;ll see what I mean.

Also, in your example, the infoWindow &quot;moved&quot; when you clicked on another marker. In my implementation, a new infoWindow is open and the ones that are already open for other markers stay open, which is not what I want.

I am sure I am missing something. Any and all help will be greatly appreciated, as I have done all I know and I&#039;ve been pulling my hair with this for 3 days in a row already...

Many thanks.</description>
		<content:encoded><![CDATA[<p>Hi, Colin, and many thanks for your post. I&#8217;ve tried a lot of ways, but yours seems the easiest and most intelligible. It helped me a lot&#8230;</p>
<p>Now, I am working on an implementation at <a href="http://cud.dvartora.ro" rel="nofollow">http://cud.dvartora.ro</a> and can&#8217;t seem to make it work as it should. The script is at <a href="http://cud.dvartora.ro/gmap.js" rel="nofollow">http://cud.dvartora.ro/gmap.js</a> . Basically, I am loading the markers from a mySQL database dynamically via XML (depending on the area of the map being shown). If the map bounds change, the script is supposed to clear the markers and load the new markers for that particular area from the database. So, the sites array needs to be dynamically generated each time the bounds of the viewport change.</p>
<p>For some reason, the clearing of previous markers doesn&#8217;t work properly. I get multiple markers at the same (or almost the same) location, as shown by the fact that the shadow seems to darken, and gets bigger. Just enter &#8220;Bucharest, Romania&#8221; in the search field, click &#8220;Cautare&#8221; (Search), zoom out a few times and you&#8217;ll see what I mean.</p>
<p>Also, in your example, the infoWindow &#8220;moved&#8221; when you clicked on another marker. In my implementation, a new infoWindow is open and the ones that are already open for other markers stay open, which is not what I want.</p>
<p>I am sure I am missing something. Any and all help will be greatly appreciated, as I have done all I know and I&#8217;ve been pulling my hair with this for 3 days in a row already&#8230;</p>
<p>Many thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Maps API v3.0 &#8211; Multiple Markers, Multiple Infowindows by Colin</title>
		<link>http://you.arenot.me/2010/06/29/google-maps-api-v3-0-multiple-markers-multiple-infowindows/comment-page-1/#comment-398</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Sun, 29 Aug 2010 04:49:34 +0000</pubDate>
		<guid isPermaLink="false">http://you.arenot.me/?p=291#comment-398</guid>
		<description>Here, I have thrown a full example up on a url using your code above to show it is working properly.  Not sure what you are doing wrong though as everything looks great.

&lt;a href=&quot;http://ratemyyogateacher.co.uk/map.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://ratemyyogateacher.co.uk/map.html&lt;/a&gt;

Let me know how you get on with that,

Colin</description>
		<content:encoded><![CDATA[<p>Here, I have thrown a full example up on a url using your code above to show it is working properly.  Not sure what you are doing wrong though as everything looks great.</p>
<p><a href="http://ratemyyogateacher.co.uk/map.html" target="_blank" rel="nofollow">http://ratemyyogateacher.co.uk/map.html</a></p>
<p>Let me know how you get on with that,</p>
<p>Colin</p>
]]></content:encoded>
	</item>
</channel>
</rss>
