<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" 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/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:series="http://unfoldingneurons.com/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>In usability we trust</title>
	
	<link>http://www.svennerberg.com</link>
	<description>A blog about web developement and usability.</description>
	<lastBuildDate>Mon, 01 Mar 2010 18:36:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/InUsabilityWeTrust" /><feedburner:info uri="inusabilitywetrust" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>InUsabilityWeTrust</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>A Project Guide to UX Design [Book review]</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/Rc1gd0weens/</link>
		<comments>http://www.svennerberg.com/2010/03/a-project-guide-to-ux-design-book-review/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 18:36:39 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Book reviews]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2449</guid>
		<description><![CDATA[Just like the subtitle: &#8220;For User Experience Designers in the field or in the making&#8221;, implies this is a book for persons that are not yet experts in the UX field. It&#8217;s a wonderful read and really gives a great overview of the UX design role in modern web site development.

One thing to notice is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://media.svennerberg.com/2010/02/UX-design.jpg"><img class="alignright size-full wp-image-2453" title="UX-design_160" src="http://media.svennerberg.com/2010/02/UX-design_160.png" alt="" width="160" height="206" /></a>Just like the subtitle: &#8220;For User Experience Designers in the field or in the making&#8221;, implies this is a book for persons that are not yet experts in the UX field. It&#8217;s a wonderful read and really gives a great overview of the UX design role in modern web site development.</p>
<p><span id="more-2449"></span></p>
<p>One thing to notice is that this book is about processes rather than how to actually design things. So if your looking for a design book this is not it. If on the other hand you&#8217;re looking for a book about the process of coming up with the design for web sites and web applications this is definitely a great book. It doesn&#8217;t go into great detail about each specific part of the process but provides a good overview and includes many great pointers to other resources.</p>
<p>The book is really hands on. It provides lots of descriptions of how to actually do things. Like signing a contract with the customer or choosing the right user research method.</p>
<h3>The structure of the book</h3>
<p>The first few chapters of the book is about the different roles of a UX designer in a project team. It&#8217;s also about how to create proposals and how to plan the project.</p>
<ol>
<li>The Tao of UXD</li>
<li>The Project Ecosystem</li>
<li>Proposals for Consultants and Freelancers</li>
</ol>
<p>Then there&#8217;s a few chapters about how to gather initial business requirements and how to do initial user research. There&#8217;s also a chapter about how Search Engine Optimization fits in the UX process.</p>
<ol start="4">
<li>Project Objectives and Approach</li>
<li>Business Requirements</li>
<li>User Research</li>
<li>Personas</li>
<li>User Experience Design and Search Engine Optimization</li>
</ol>
<p>The last chapters of the book is about how to transition from defining to designing. They describe different techniques and approaches of coming up with the structure and design of the site. Examples of techniques are Site Maps, Task Flows, Wireframes and Prototypes. There&#8217;s also a chapter on how to perform usability tests with users and lastely there&#8217;s a chapter on how to transition from design to the actual development of the site.</p>
<ol start="9">
<li>Transition: From Defining to Designing</li>
<li>Site Maps and Task Flows</li>
<li>Wireframes and Annotations</li>
<li>Prototyping</li>
<li>Design Testing with Users</li>
<li>Transition: From Design to Development and Beyond</li>
</ol>
<h3>Bonus material</h3>
<p>The book comes with a bonus, online-only chapter called <a href="http://projectuxd.com/wp-content/uploads/2009/03/0321607376_a_brief_guide_to_meetings.pdf">A brief Guide to Meetings (pdf)</a>. I suggest that you download that chapter and read it to get a sense of the style of the book. There&#8217;s also an online chapter from the book available at the Peachpit website. The chapter is called <a href="http://www.peachpit.com/articles/article.aspx?p=1332016">Project Objectives and Approach</a>.</p>
<p>Apart from those there&#8217;s additional documents and templates available at the <a href="http://projectuxd.com/?page_id=5">download area of the book site</a>. </p>
<h3>Final thoughts</h3>
<p>The book is really well edited. I haven&#8217;t been able to find a single typo. I found it very enjoyable to read and even if a lot of the information was familiar to me there were still grains of gold to be found. The best chapter for me was <strong>Chapter 9 &#8211; Transition: From Defining to Designing</strong>. It described different approaches on how to come to consensus about what the primary goals of the projects are that I really haven&#8217;t thought of before. </p>
<p>If you want an overview of the UX design process and an introduction to different UX techniques and approaches, read this book! I highly recommend it!</p>
<h3>Book information</h3>
<p>Title: <a href="http://www.amazon.com/gp/product/0321607376?ie=UTF8&amp;tag=inusabiwetrus-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321607376">A Project Guide to UX Design</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&amp;l=as2&amp;o=1&amp;a=0321607376" border="0" alt="" width="1" height="1" /><br />
Author: Carolyn Chandler and Russ Unger<br />
Publisher: New Riders Press; 1 edition (March 23, 2009)<br />
Pages: 288<br />
ISBN: 0-321-60737-6<br />
ISBN-13: 978-0-321-60737-9</p>
<h4>Further resources</h4>
<p><a href="http://projectuxd.com/">The book site</a></p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/Rc1gd0weens" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2010/03/a-project-guide-to-ux-design-book-review/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2010/03/a-project-guide-to-ux-design-book-review/</feedburner:origLink></item>
		<item>
		<title>Rocket Surgery Made Easy [Book review]</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/1MIgsFHWVHQ/</link>
		<comments>http://www.svennerberg.com/2010/01/rocket-surgery-made-easy-book-review/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 09:14:21 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Book reviews]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2414</guid>
		<description><![CDATA[This latest book from Steve Krug is a terrific read and a great companion book to his legendary and highly successful book, Don&#8217;t make me think. Where Don&#8217;t make me think focus on design and the ifs and whys of usability testing, Rocket Surgery Made Easy focuses on how to actually conduct usability test and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://media.svennerberg.com/2010/01/RocketSurgeryMadeEasy.jpg"><img class="alignright size-full wp-image-2420" title="RocketSurgeryMadeEasy_160" src="http://media.svennerberg.com/2010/01/RocketSurgeryMadeEasy_160.png" alt="" width="160" height="205" /></a>This latest book from Steve Krug is a terrific read and a great companion book to his legendary and highly successful book, <strong>Don&#8217;t make me think</strong>. Where <strong>Don&#8217;t make me think</strong> focus on design and the ifs and whys of usability testing, <strong>Rocket Surgery Made Easy</strong> focuses on how to actually conduct usability test and what to do with the results. </p>
<p><span id="more-2414"></span></p>
<p>As always Steve&#8217;s writing style is relaxed but still to the point. He&#8217;s very humorous and there are a lot of things in the book that makes me smile. The book is nicely designed and is rich with illustrations that breaks up the text and make it more enjoyable to read. It&#8217;s not a long book. As he states himself, it&#8217;s short enough to read on a long flight. I think that&#8217;s a good thing. </p>
<p>I really enjoy Steve&#8217;s pragmatic approach to the subject. He manages to demystify the subject and make the case that anyone, well almost anyone, can perform usability tests and benefit greatly from it. Throughout the book he delivers maxims which contains the most important points. Two of my favorites are <strong>&#8220;A morning a month, that&#8217;s all we ask&#8221;</strong> and <strong>&#8220;Start earlier than you think makes sense&#8221;</strong>. </p>
<p>The book also contains lots of extra material, such as sample test scripts, a consent form and a video of him actually performing a usability test. You can <a href="http://www.sensible.com/rocketsurgery/">watch the video yourself</a> from the book&#8217;s companion site. I think that these add greatly to the value of the book since they provide you with concrete tools to get started.</p>
<h3>Conclusion</h3>
<p>If you&#8217;re interested in usability testing, already do them or plan to start doing them, this is definitely a book for you. It does not have all the answers but will provide you with all the information you need to get started. If you&#8217;ve conducted usability test before I&#8217;m sure that you will still find lots of useful information.</p>
<p>All in all this is a great book and I highly recommend it! If you haven&#8217;t read his first book, <a href="http://www.amazon.com/gp/product/0321344758?ie=UTF8&#038;tag=inusabiwetrus-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0321344758">Don&#8217;t Make Me Think</a><img src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&#038;l=as2&#038;o=1&#038;a=0321344758" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> already, I highly recommend that you read it too.</p>
<h3>Book information</h3>
<p><strong>Title:</strong> <a href="http://www.amazon.com/gp/product/0321657292?ie=UTF8&amp;tag=inusabiwetrus-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321657292">Rocket Surgery Made Easy</a><img style="border: none !important; margin: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&amp;l=as2&amp;o=1&amp;a=0321657292" border="0" alt="" width="1" height="1" /><br />
<strong>Author:</strong> Steve Krug<br />
<strong>Publisher:</strong> New Riders Press; 1 edition (December 18, 2009)<br />
<strong>Pages:</strong> 168<br />
<strong>ISBN:</strong> 0-321-65729-2<br />
<strong>ISBN-13:</strong> 978-0-321-65729-9</p>
<h3>Further resources</h3>
<p><a href="http://www.sensible.com/rocketsurgery/">The book site</a></p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/1MIgsFHWVHQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2010/01/rocket-surgery-made-easy-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2010/01/rocket-surgery-made-easy-book-review/</feedburner:origLink></item>
		<item>
		<title>Stripes – An interesting Operating System Concept</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/URmlY2DqZTw/</link>
		<comments>http://www.svennerberg.com/2010/01/stripes-an-interesting-operating-system-concept/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 17:34:11 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2403</guid>
		<description><![CDATA[I&#8217;ve just discovered an interesting concept for a new Operating System. The concept is the brain child of Martin Gimpl and is a part of his master thesis on computer interaction. It uses a zooming interface for windows management and introduces several interesting concepts. In the short video below, Martin shows some of the core [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just discovered an interesting concept for a new Operating System. The concept is the brain child of Martin Gimpl and is a part of his master thesis on computer interaction. It uses a zooming interface for windows management and introduces several interesting concepts. In the short video below, Martin shows some of the core concepts. It is well worth checking out. </p>
<p><object width="601" height="338"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7360019&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7360019&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="601" height="338"></embed></object></p>
<p>Also download the MA Thesis and try out the interactive prototype at<br />
<a href="http://www.martingimpl.com/stripes/" title="Stripes - A conceptual operating system user interface" title="Stripes: A Conceptual Operating System User Interface">www.martingimpl.com/stripes/</a>.</p>
<p>Found through Lukas Mathis blog <a href="http://ignorethecode.net/blog/2009/11/23/stripes/">ignore the code</a> where he shares his thought about the concept.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/URmlY2DqZTw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2010/01/stripes-an-interesting-operating-system-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2010/01/stripes-an-interesting-operating-system-concept/</feedburner:origLink></item>
		<item>
		<title>A List Aparts annual survey</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/tGmcqdCcbyg/</link>
		<comments>http://www.svennerberg.com/2009/12/a-list-aparts-annual-survey/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 07:39:10 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Quick tips]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2396</guid>
		<description><![CDATA[This is starting to be a tradition. For the third year in a row A list apart is conducting a survey for people who make websites. The purpose of the survey is to see how our profession is practiced worldwide. 
Last year over 30.000 people took the survey and A List Apart has made the [...]]]></description>
			<content:encoded><![CDATA[<p>This is starting to be a tradition. For the third year in a row <a href="http://www.alistapart.com/">A list apart</a> is conducting a survey for people who make websites. The purpose of the survey is to see how our profession is practiced worldwide. </p>
<p>Last year over 30.000 people took the survey and A List Apart has made the results <a href="http://www.alistapart.com/articles/findings/" title="Findings from the Web Design Survey, 2008">publicly available</a>. Check it out! It&#8217;s a pretty interesting read.</p>
<p>I took the survey, and so should you! So <a href="http://alistapart.com/articles/survey2009" title="The Survey, 2009">head over there</a> and answer the questions. It only takes about 5 minutes.</p>
<p><a href="http://alistapart.com/articles/survey2009" title="The Survey, 2009"><img src="http://media.svennerberg.com/2009/12/i-took-the-2009-survey.gif" alt="I took it an so should you - The survey for people who makes websites" class="alignnone" /></a></p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/tGmcqdCcbyg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/12/a-list-aparts-annual-survey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/12/a-list-aparts-annual-survey/</feedburner:origLink></item>
		<item>
		<title>Beta chapter from my upcoming book on Google Maps API v3</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/BYS8r24_sFE/</link>
		<comments>http://www.svennerberg.com/2009/11/beta-chapter-from-my-upcoming-book-on-google-maps-api-v3/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 21:42:02 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Google Maps API 3]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2333</guid>
		<description><![CDATA[I am in the process of writing a book about the new Google Maps API v3. I thought that I would make the process a bit more open by releasing beta chapters that some people might read and give feedback on. Hopefully one of those people is you!

There are two reasons why I am doing [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/07/blank_book_200.png" alt="blank_book_200" title="blank_book_200" width="200" height="148" class="alignright size-full wp-image-2137" />I am in the process of writing a book about the new Google Maps <acronym title="Application Programming Interface">API</acronym> v3. I thought that I would make the process a bit more open by releasing beta chapters that some people might read and give feedback on. Hopefully one of those people is you!</p>
<p><span id="more-2333"></span></p>
<p>There are two reasons why I am doing this:</p>
<ol>
<li>The main reason is that I think the book will be a better one from it.</li>
<li>The second reason is that I think it can act as a motivation booster for myself to actually finish the book.</li>
</ol>
<h3>About the book</h3>
<p>In short the book is about how to use Google Maps <acronym title="Application Programming Interface">API</acronym> v3. It will teach the basics but also provide tips and tricks about more advanced stuff. It will be very hands on with lots of examples that can be used right away. You can read more about it in the article <a href="/2009/07/im-writing-a-book-about-google-maps/">I’m writing a book about Google Maps</a>.</p>
<h3>Download the chapter</h3>
<p>I am not going to release the chapters in chronological order so the first chapter to be released in public beta is not the first but rather one in the middle. It is about Markers and is called <strong>X Marks the Spot</strong>.</p>
<p>Download the chapter, read it, and tell me what you think. Either by posting a comment below or by contacting me directly through the <a href="/contact">contact page</a>.</p>
<p><a href="http://media.svennerberg.com/2009/11/X_marks_the_spot-public_beta_1.pdf" class="download" title="Click to download this file"><span>X_marks_the_spot-public_beta_1.pdf <em>(791 Kb)</em></span></a></p>
<h4>Stay posted</h4>
<p>If you want to stay updated with the progress of the book, sign up below.</p>
<div class="notify-me"><form id="notify-me-form" action="" method="post"><div><label for="notify-me-email">Email</label><input type="text" name="notify-me-email" id="notify-me-email" value="" /><input type="hidden" name="notify-me-context" value="Google Maps Book" /><input type="submit" id="notify-me-button" value="Send" /></div></form></div>
<p>And just for the record, your email address is safe with me. I will use it for this purpose only. I hate spam as much as you do!</p>
<p>You should also <a href="http://www.twitter.com/svennerberg">follow me on twitter</a>.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/BYS8r24_sFE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/11/beta-chapter-from-my-upcoming-book-on-google-maps-api-v3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/11/beta-chapter-from-my-upcoming-book-on-google-maps-api-v3/</feedburner:origLink></item>
		<item>
		<title>The difference between add(), find() and filter() in jQuery</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/y35ddv_rf3g/</link>
		<comments>http://www.svennerberg.com/2009/09/the-difference-between-add-find-and-filter-in-jquery/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 15:39:58 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2236</guid>
		<description><![CDATA[There&#8217;s a few methods used for traversing the DOM-tree in jQuery that is confusingly similar, well at least they were for me. This article will explain the difference between them and when you should use which one.

The methods I&#8217;m talking about are add(), find() and filter(). They are all used to extend or refine a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/09/jquery-logo-160.png" alt="" class="alignright size-full wp-image-2289" />There&#8217;s a few methods used for traversing the <acronym title="Document Object Model">DOM</acronym>-tree in jQuery that is confusingly similar, well at least they were for me. This article will explain the difference between them and when you should use which one.</p>
<p><span id="more-2236"></span></p>
<p>The methods I&#8217;m talking about are <code>add()</code>, <code>find()</code> and <code>filter()</code>. They are all used to extend or refine a selection of html objects that you&#8217;ve already got. Typically you&#8217;ve already got a selection using the jQuery method, or $(expression), but need to refine it further. </p>
<p>All three of these methods have, that they take a <em>jQuery expression</em> as an argument, in common. A jQuery expression typically looks like a regular <acronym title="Cascading Style Sheets">CSS</acronym> selector like for example &#8220;#content&#8221;. You can use any kind of <acronym title="Cascading Style Sheets">CSS</acronym> selector, including the ones found in <acronym title="Cascading Style Sheets">CSS</acronym> 3. On top of that you can also use jQuery specific selectors. It&#8217;s a really powerful way of finding the right elements in a <acronym title="HyperText Markup Language">HTML</acronym> document. To read more about how a expression could be constructed, check out the <a href="http://docs.jquery.com/Selectors">section about selectors</a> in the jQuery documentation.</p>
<p>We will take a closer look on how these methods really works in the following section.</p>
<h3>Examples and explanations</h3>
<p>Consider the following <acronym title="HyperText Markup Language">HTML</acronym>.</p>
<pre name="code" class="html">
&lt;div id="div1"&gt;
  &lt;p&gt;Some text&lt;/p&gt;
&lt;/div&gt;
&lt;div id="div2"&gt;
  &lt;p&gt;Some more text&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>We&#8217;re going to use this <acronym title="HyperText Markup Language">HTML</acronym> to do some selections from.</p>
<h4>add()</h4>
<p>As the name implies this method is used to add more elements to a collection that you&#8217;ve already got. So if you have a &lt;div&gt; with the id &#8220;div1&#8243; in your selection and wants to add a &lt;div&gt; with the id &#8220;div2&#8243; to it, <code>add()</code> is the method to use:</p>
<pre name="code" class="js">
// This code will add div2 to the collection that already contains div1
$('#div1').add('#div2');
</pre>
<p><a href="http://docs.jquery.com/Traversing/add">Read about add() in the jQuery documentation</a>.</p>
<h4>find()</h4>
<p><code>Find()</code> on the other hand is used to find descendant element from your selection. So instead of adding more elements to it it narrows it down to fewer elements. It searches what&#8217;s inside the parent element(s) in your selection. In the example below it will search for content inside of the selected &lt;div&gt; that matches the expression.</p>
<pre name="code" class="js">
// Refine the selection to contain only the &lng;p&lt; elements inside of #div1
$('#div1').find('p');
</pre>
<p><a href="http://docs.jquery.com/Traversing/find">Read about find() in the jQuery documentation</a>.</p>
<h4>filter()</h4>
<p><code>Filter()</code> is quite similar to <code>find()</code> but instead of searching the descendant elements of the selection it &#8220;searches&#8221;, or rather filters, the elements that are in the selection. </p>
<pre name="code" class="js">
// Reduces the selection to only contain the &lt;div&gt; with the id "div1"
$('div').filter('#div1');
</pre>
<p><a href="http://docs.jquery.com/Traversing/filter">Read about filter() in the jQuery documentation</a>.</p>
<h3>Demo page</h3>
<p>I&#8217;ve constructed a simple <a href="http://www.svennerberg.com/examples/add_find_filter/">demo page</a> which demonstrates how these methods work. Please try it out.</p>
<h3>Conclusion</h3>
<p>All of these methods are very useful but it&#8217;s important to know which one to choose in a given situation. If you want to <strong>extend your selection</strong> to include more elements you should use <code>add()</code>. If you want to <strong>narrow down your selection</strong> you need too use either <code>find()</code> or <code>filter()</code>.</p>
<p>Of course there are many other useful methods to traverse the <acronym title="Document Object Model">DOM</acronym> in jQuery. Which ones are your favorites? </p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/y35ddv_rf3g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/09/the-difference-between-add-find-and-filter-in-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/09/the-difference-between-add-find-and-filter-in-jquery/</feedburner:origLink></item>
		<item>
		<title>Google Maps Api 3 – InfoWindows</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/Sc6sdoPv7nQ/</link>
		<comments>http://www.svennerberg.com/2009/09/google-maps-api-3-infowindows/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 18:10:17 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Google Maps API 3]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2208</guid>
		<description><![CDATA[Using InfoWindows is a brilliant way to display information about a certain location. Since they provides you with a space to put text or whatever HTML you please, they can be used in very interesting ways. In this article, which is the fourth in a series about Google Maps API 3,  I will show [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/06/gmmlogo.gif" alt="" class="alignright size-full wp-image-1991" />Using InfoWindows is a brilliant way to display information about a certain location. Since they provides you with a space to put text or whatever <acronym title="HyperText Markup Language">HTML</acronym> you please, they can be used in very interesting ways. In this article, which is the fourth in a series about Google Maps <acronym title="Application Programming Interface">API</acronym> 3,  I will show you how to make good use of this great feature. </p>
<p><span id="more-2208"></span></p>
<h3 class="clear">The InfoWindow object</h3>
<p>The InfoWindow object will open an InfoWindow somewhere on a map. It looks like a speech bubble and the tip of its stem typically points to a certain object on the map. Often it&#8217;s pointing at a marker, but it doesn&#8217;t have to be. It can point at any other object or any coordinate on the map.</p>
<p>The object resides in the <code>google.map.InfoWindow</code> namespace and takes an optional argument which is <code>options</code>. Options is an object literal in which you can define all the properties for the InfoWindow. This means that you can create an empty InfoWindow object for later use, but most of the time you&#8217;ll probably want to fill it with some sort of content right away. To fill it with content you&#8217;ll need to use the property <code>content</code>. It can be set either on creation of the object or afterwards using the <code>setContent()</code> method. It can be either a text string, a string containing <acronym title="HyperText Markup Language">HTML</acronym>, or a reference to an existing <acronym title="HyperText Markup Language">HTML</acronym> node.</p>
<h4>Setting the scene</h4>
<p>We will start with a map with one marker on it. If you don&#8217;t know how to create a map and add markers to it, I suggest that you read the <a href="http://www.svennerberg.com/series/google-maps-api-3/">previous articles in this series</a> first.</p>
<p>For those of you that are already familiar with the concepts, here&#8217;s the code for creating a map and adding a marker to it:</p>
<pre name="code" class="js">
// Creating an option object for the map
var options = {
	zoom: 7,
	center: new google.maps.LatLng(56.83, 15.16),
	mapTypeId: google.maps.MapTypeId.ROADMAP
};
// Initializing the map
var map = new google.maps.Map(document.getElementById('map'), options);
// Creating a marker
var marker = new google.maps.Marker({
  position: new google.maps.LatLng(56.8848, 14.7730),
  map: map,
  title: 'My workplace'
});
</pre>
<p>This will result in a map that looks like this:</p>
<p><img src="http://media.svennerberg.com/2009/09/InfoWindowHidden.png" alt="" class="alignnone size-full wp-image-2256" /></p>
<h4>Adding an InfoWindow</h4>
<p>Now that we have the scene set, lets add an InfoWindow to it. In this example we will instantly fill the InfoWindow with some content, in this case the classic text string &#8220;Hello world&#8221;:</p>
<pre name="code" class="js">
// Creating an InfoWindow object
var infowindow = new google.maps.InfoWindow({
  content: 'Hello world'
});
</pre>
<h4>Showing the InfoWindow</h4>
<p>We have now created an InfoWindow object but not yet added it to the map. To make it appear we have to first open it and that&#8217;s done with its method <code>open()</code>. This method takes two arguments: the map object which it will be added to and optionally an anchor where it will point to. The anchor must be an object on the map that exposes a position property. As of now this will probably be a marker.</p>
<p>If you don&#8217;t pass on the second argument you must provide the InfoWindow object with a position. This is done with either the attribute <code>position</code> in options or via its <code>setPosition()</code> method. In this example however, we will pass our marker as the second argument so that the InfoWindow will point straight at it.</p>
<pre name="code" class="js">
infowindow.open(map, marker);
</pre>
<p>Now the InfoWindow will be visible on the map and will look like this:</p>
<p><img src="http://media.svennerberg.com/2009/09/InfoWindow.png" alt="" class="alignnone size-full wp-image-2254" /></p>
<p>Note that the default behavior of the map is that it pans so that all of the InfoWindow is visible. This behavior can be overridden by setting the property <code>disableAutoPan</code> to <code>false</code>.</p>
<h4>Adding a click event</h4>
<p>As of now our InfoWindow is automatically opened when our map loads. Most of the time we want it to open when something is clicked and that&#8217;s exactly the functionality we&#8217;re going to add next. We&#8217;re going to add a click event to the marker so that when it&#8217;s being clicked the InfoWindow will open.</p>
<p>To add an event to the marker we will need to use the <code>addListener()</code> method found in <code>google.maps.event</code>. This method takes 3 arguments, the first one being the object it will be attached to, in this case the <em>marker</em>. The second argument defines what kind of event we want to add, in this case a <em>click</em> event. The third argument is a function which will be called when the event is being triggered. In this case we will use an anonymous function and we will move the code that opens the InfoWindow inside it.</p>
<p>Doing that the code will look like this:</p>
<pre name="code" class="js">
google.maps.event.addListener(marker, 'click', function() {
  infowindow.open(map, marker);
});
</pre>
<p>Now, when we load our page the InfoWindow will not be visible until we click the marker. Then it will pop up.</p>
<h3>Using multiple InfoWindows</h3>
<p>You may have noticed that we create the InfoWindow outside the click event of the marker. Perhaps you&#8217;re thinking that we might as well could have put all of the code regarding the InfoWindow inside it. But there&#8217;s a good reason for not doing that. By creating the InfoWindow outside the event handler, we ensure that there only exists one InfoWindow at a time. If we had put the code for creating the InfoWindow inside the event handler we would have created a new InfoWindow each time the marker was clicked. Leaving us with several identical InfoWindows on top of each other. </p>
<p>Now there are ways to deal with this. We could for example check if the InfoWindow existed before creating it, but by creating it only once we completely avoid the problem all together.</p>
<p>If you&#8217;ve been programming in version 2 of the Google Maps <acronym title="Application Programming Interface">API</acronym> you&#8217;ll notice a significant difference here. In the old <acronym title="Application Programming Interface">API</acronym> we could only have one InfoWindow at a time, but now we can have several. Because of this we have to change how we think about them. There might be occasions when we want to display several of them at once, but often we will only want to display them one at a time.</p>
<h3>More control over the Info Window</h3>
<p>There are some other properties that you can add to options for added control of the InfoWindow. I&#8217;ve already mentioned <code>content</code> which defines what will be displayed inside of it and <code>position</code> which in lack of an anchor defines the position of the InfoWindow. But here&#8217;s all of the properties available for controlling the look and behavior of the InfoWindow:</p>
<h4>content</h4>
<p>This property defines the content of the InfoWindow. It can be either plain text, <acronym title="HyperText Markup Language">HTML</acronym> or a reference to an existing <acronym title="HyperText Markup Language">HTML</acronym> element. The InfoWindow will automatically adjust its size to fit the content.</p>
<h4>disableAutoPan [boolean]</h4>
<p>If set to <code>true</code> the map is no longer automatically panned to fit the InfoWindow. Default value is <code>false</code>. </p>
<h4>maxWidth [number]</h4>
<p>Sets the maximum width of the InfoWindow in pixels. It must be set before the InfoWindow is opened. </p>
<p>Another way of controlling the size of the InfoWindow is to add <acronym title="HyperText Markup Language">HTML</acronym> with certain dimensions to it. This way you can control its size from you <acronym title="Cascading Style Sheets">CSS</acronym>.</p>
<h4>pixelOffset [size]</h4>
<p>If position is used to place the InfoWindow, pixelOffset defines how far away from this point the window should be positioned.</p>
<h4>position [LatLng]</h4>
<p>Defines the position the InfoWindow should be pointing at. If an anchor (the second argument of the open() method is set, it will override this property.</p>
<h4>zIndex [number]</h4>
<p>When displaying multiple InfoWindows at the same time, this property will determine the stack order of those.</p>
<h3>Live demo</h3>
<p><a href="http://www.svennerberg.com/examples/google_maps_3/info_windows.html" title="Google Maps API 3 - InfoWindows"><img src="http://media.svennerberg.com/2009/09/screendump_info_windows-410x458.png" alt=""  class="alignnone size-medium wp-image-2261" /></a></p>
<p><a href="http://www.svennerberg.com/examples/google_maps_3/info_windows.html" title="Google Maps API 3 - InfoWindows">Check out the Live Demo</a> showing the example used in this article.</p>
<p>Hopefully this article has provided you with a basic understanding of how to use InfoWindows in your maps but there are a lot more that can be done with them. They still lack a lot of the functionality found in the old <acronym title="Application Programming Interface">API</acronym>, like displaying a detail map inside it or having tabbed content. Some of these features will probably never find its way into the new <acronym title="Application Programming Interface">API</acronym> but fortunately it&#8217;s quite easy to build this functionality yourself. Keep your eyes open for my upcoming book where I will explain how to do some of this stuff.</p>
<h3>Further reading</h3>
<p>For more information about the InfoWindow object, check out the <a href="http://code.google.com/intl/sv-SE/apis/maps/documentation/v3/reference.html#InfoWindow" title="Google Maps API V3 Reference - InfoWindow">Official Google Maps Reference</a>. You might also want to check out the section in the documentation about <a href="http://code.google.com/apis/maps/documentation/v3/overlays.html#InfoWindows" title="Maps API V3 Overlays">Overlays</a>.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/Sc6sdoPv7nQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/09/google-maps-api-3-infowindows/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<series:name><![CDATA[Google Maps API 3]]></series:name>
	<feedburner:origLink>http://www.svennerberg.com/2009/09/google-maps-api-3-infowindows/</feedburner:origLink></item>
		<item>
		<title>Handcrafted CSS [Book review]</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/3BrIK5EyuJ8/</link>
		<comments>http://www.svennerberg.com/2009/09/handcrafted-css-book-review/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 19:31:49 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Book reviews]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2212</guid>
		<description><![CDATA[Dan Cederholms latest book Handcrafted CSS with the subtitle: More Bulletproof Web Design, is an enjoyable read and delivers some interesting advice on how to leverage your designs with the power of CSS 3.

I&#8217;ve truly enjoyed Dan&#8217;s two former books Web Standards Solutions and Bulletproof Web Design. It was in fact from these books that [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Handcrafted CSS: More Bulletproof Web Design by Dan Cederholm" rel="lightbox[imageset]" href="http://media.svennerberg.com/2009/09/handcrafted_css.jpg"><img class="alignright size-full wp-image-2217" src="http://media.svennerberg.com/2009/09/handcrafted_css_small.jpg" alt="Handcrafted CSS" /></a>Dan Cederholms latest book <strong>Handcrafted <acronym title="Cascading Style Sheets">CSS</acronym></strong> with the subtitle: <strong>More Bulletproof Web Design</strong>, is an enjoyable read and delivers some interesting advice on how to leverage your designs with the power of <acronym title="Cascading Style Sheets">CSS</acronym> 3.</p>
<p><span id="more-2212"></span></p>
<p>I&#8217;ve truly enjoyed Dan&#8217;s two former books <a href="http://www.amazon.com/gp/product/1430219203?ie=UTF8&amp;tag=inusabiwetrus-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430219203">Web Standards Solutions</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&amp;l=as2&amp;o=1&amp;a=1430219203" border="0" alt="" width="1" height="1" /> and <a href="http://www.amazon.com/gp/product/0321509021?ie=UTF8&amp;tag=inusabiwetrus-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321509021">Bulletproof Web Design</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&amp;l=as2&amp;o=1&amp;a=0321509021" border="0" alt="" width="1" height="1" />. It was in fact from these books that I first learned the concepts of <a href="http://en.wikipedia.org/wiki/Fault-tolerant_system">graceful degradation</a> and <a href="http://en.wikipedia.org/wiki/Progressive_enhancement">progressive enhancement</a>. I also learned clever <acronym title="Cascading Style Sheets">CSS</acronym> styling techniques that I&#8217;ve been using ever since.</p>
<p>In this new book Dan introduces the concept of <strong>Progressive Enrichment</strong>. It&#8217;s an extension of <strong>Progressive Enhancement </strong>and in a nutshell it&#8217;s about being OK with that web designs will look slightly different in different web browsers. Furthermore it&#8217;s about not letting the smallest common denominator deciding which techniques to use but rather reward the more forward-thinking browsers with a slightly more polished look than the other ones (read Internet Explorer). What this means is that it&#8217;s OK to start using some <acronym title="Cascading Style Sheets">CSS</acronym> 3 properties like border-radius and RGBA right now even though they&#8217;re not yet widely adopted.</p>
<p>If you&#8217;re still unsure about whether web sites have to look exactly the same in all browser or not, pay a visit at <a href="http://dowebsitesneedtolookexactlythesameineverybrowser.com/">www.dowebsitesneedtolookexactlythesameineverybrowser.com</a>.</p>
<p>The book also contains some ideas on how to reuse <acronym title="Cascading Style Sheets">CSS</acronym> between projects. Sort of like building you own lightweight <acronym title="Cascading Style Sheets">CSS</acronym> framework like <a href="http://www.blueprintcss.org/">Blueprint <acronym title="Cascading Style Sheets">CSS</acronym></a> and <a title="Yet Another Multicolumn Layout | An (X)HTML/CSS Framework" href="http://www.yaml.de/en/home.html">YAML</a>. Dan explains the value of a global reset and some basic <acronym title="Cascading Style Sheets">CSS</acronym> rules that&#8217;s usable in every project.</p>
<p>It&#8217;s a true joy to read Dans texts. The writing style is relaxed but still to the point. The examples are thoroughly explained but doesn&#8217;t feel verbose. There&#8217;s also a laid back humor in the texts that make them even more enjoyable. As you probably noticed that I&#8217;m a big fan of Dan&#8217;s writing and the truth is that I wish that I could write like that. He&#8217;s just awesome.</p>
<h4>Guest writer</h4>
<p>This book features guest writer <a title="Unstoppable Robot Ninja - The web-thing of Ethan Marcotte" href="http://unstoppablerobotninja.com/">Ethan Marcotte</a> who&#8217;s been writing a chapter about &#8220;The Fluid Grid&#8221;. Ethan is a renowned Web designer/developer from Airbag Industries. This chapter describes how to work with fluid grid-based designs. It contains both some history of grid-based design in print as well as techniques to incorporate them in a web design.</p>
<h4>Included <acronym title="Digital Versatile Disc">DVD</acronym></h4>
<p>Included in the book I bought was a <acronym title="Digital Versatile Disc">DVD</acronym> featuring Dan explaining 10 design guidelines. The <acronym title="Digital Versatile Disc">DVD</acronym> was pretty OK but didn&#8217;t feature anything the book didn&#8217;t include. I guess that it&#8217;s primarily aimed at people that are not web designers and need to be oriented about some core concepts. Despite that, Dan playing ukulele in the background makes it well worth the time <img src='http://www.svennerberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3>Conclusion</h3>
<p>If you&#8217;re interested in starting to use <acronym title="Cascading Style Sheets">CSS</acronym> 3 in your designs I highly recommend this book. Not so much for that it&#8217;s chock full of exciting <acronym title="Cascading Style Sheets">CSS</acronym> 3 properties because it&#8217;s not, but rather because it introduces ways to start using them right now without breaking the designs in older browsers. Anyway you&#8217;re in for a great read.</p>
<h4>Further reading</h4>
<p>Read more about the book at it&#8217;s acompaning web site <a title="Handcrafted CSS by DAN CEDERHOLM with ETHAN MARCOTTE" href="http://handcraftedcss.com/">handcraftedcss.com</a>. You can also read more from Dan Cederholm at his blog <a href="http://simplebits.com/">Simplebits.com</a>.</p>
<h3>Book information</h3>
<p><strong>Title:</strong> <a href="http://www.amazon.com/gp/product/0321658531?ie=UTF8&amp;tag=inusabiwetrus-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321658531">Handcrafted CSS: More Bulletproof Web Design</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&amp;l=as2&amp;o=1&amp;a=0321658531" border="0" alt="" width="1" height="1" /><br />
<strong>Authors:</strong> Dan Cederholm and Ethan Marcotte<br />
<strong>Publisher:</strong>New Riders Press; 1 Pap/<acronym title="Digital Versatile Disc">DVD</acronym> edition (August 20, 2009)<br />
<strong>Pages:</strong> 288<br />
<strong>ISBN:</strong> 0321658531<br />
<strong>ISBN-13:</strong> 978-0321658531</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/3BrIK5EyuJ8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/09/handcrafted-css-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/09/handcrafted-css-book-review/</feedburner:origLink></item>
		<item>
		<title>Google Maps Api 3 – Markers</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/p8MCo4hLBU8/</link>
		<comments>http://www.svennerberg.com/2009/07/google-maps-api-3-markers/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 17:51:33 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Google Maps API 3]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2115</guid>
		<description><![CDATA[Markers are the perfect way to put places of interest on a map and that’s probably one of the most used features in digital maps. In this article, which is the third in a series about Google Maps API 3, I will show you how to use them in Google Maps API 3.

If you aren&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/06/gmmlogo.gif" alt="" class="alignright" />Markers are the perfect way to put places of interest on a map and that’s probably one of the most used features in digital maps. In this article, which is the third in a series about Google Maps <acronym title="Application Programming Interface">API</acronym> 3, I will show you how to use them in Google Maps <acronym title="Application Programming Interface">API</acronym> 3.</p>
<p><span id="more-2115"></span></p>
<p>If you aren&#8217;t already familiar with the map object, I recommend that you first read the two previous articles in this series.</p>
<h3 class="clear">The marker object</h3>
<p>The marker object resides in the <code>google.maps.Marker</code> namespace and takes a single argument, options. Options is an object literal called <code>Marker options</code> that can have several properties of which two are required:</p>
<ul>
<li><strong>map [Map]</strong><br />
Map is a reference to the map where you want to add the marker.</li>
<li><strong>position [LatLng]</strong><br />
This property indicates the position of the marker and is of type <code>google.maps.LatLng</code></li>
</ul>
<p>Lets start by creating a map and adding a regular marker with the standard look and behavior. If you&#8217;ve read the prior articles in this series you should already be familiar with the code that creates the map. Please note that I&#8217;ve used a somewhat more compact syntax here than in previous examples.</p>
<pre name="code" class="js">
// Creating a map
var map = new google.maps.Map(document.getElementById('map'), {
  zoom: 7,
  center: new google.maps.LatLng(56.83, 15.16),
  mapTypeId: google.maps.MapTypeId.ROADMAP
});

// Creating a marker and positioning it on the map
var marker = new google.maps.Marker({
  position: new google.maps.LatLng(56.8848, 14.7730),
  map: map
});
</pre>
<p>This code would result in a marker being added to the map, incidentally marking the place where I work. Note that the marker is immediately added to the map upon creation. So there&#8217;s no need, like in the old <acronym title="Application Programming Interface">API</acronym>, to explicitly add it to the map after it has been created.</p>
<p><img src="http://media.svennerberg.com/2009/07/marker.png" alt="" class="alignnone" /></p>
<h3>Adding a tooltip</h3>
<p>A common thing one might want to do is to add a tooltip to the marker. The tooltip is displayed when a user hovers with the mouse pointer over the marker. This is easily done by adding the property <code>title</code> to the marker options object. </p>
<p>Since this marker won&#8217;t be clickable I want to somehow indicate this. That is done by setting the property <code>clickable</code> to <code>false</code>. This results in that the mouse cursor won&#8217;t change on hover. </p>
<pre name="code" class="js">
var marker = new google.maps.Marker({
  position: new google.maps.LatLng(56.8848, 14.7730),
  map: map,
  title: 'My workplace',
  clickable: false
});
</pre>
<p>Here&#8217;s how this will look like on the map.</p>
<p><img src="http://media.svennerberg.com/2009/07/marker_tooltip.png" alt="" class="alignnone" /></p>
<h4>Definition</h4>
<ul>
<li><strong>title [string]</strong><br />
Sets the tooltip of the marker.</li>
<li><strong>clickable [boolean]</strong><br />
Defines whether the marker is clickable/draggable or not. If set to <code>false</code> it will not display a special mouse cursor on hover. Default value is <code>true</code>.</li>
</ul>
<h3>Changing the default marker icon</h3>
<p>Often we want to use a different marker than the default one. The <acronym title="Application Programming Interface">API</acronym> offers a simple way of doing this with the property <code>icon</code>. <code>Icon</code>takes either an <acronym title="Uniform Resource Locator">URL</acronym> pointing to an image or a <code>MarkerIcon</code> as its value. In this example I will use the more simpler, <acronym title="Uniform Resource Locator">URL</acronym>, and point it to this image.</p>
<p><img src="http://google-maps-icons.googlecode.com/files/factory.png" alt="" class="alignnone" /></p>
<p>This icon is taken from Nicolas Mollet&#8217;s map icon set at <a href="http://code.google.com/p/google-maps-icons/">http://code.google.com/p/google-maps-icons/</a>. There&#8217;s lots of similiar icons that you can use. </p>
<p>Here&#8217;s the code for creating a marker with a custom marker icon.</p>
<pre name="code" class="js">
var marker = new google.maps.Marker({
  position: new google.maps.LatLng(56.8848, 14.7730),
  map: map,
  title: 'My workplace',
  clickable: false,
  icon: 'http://google-maps-icons.googlecode.com/files/factory.png'
});
</pre>
<p>Now the map and the marker will look like this:</p>
<p><img src="http://media.svennerberg.com/2009/07/marker_custom_icon.png" alt="" class="alignnone" /></p>
<p>There are some other properties for more advanced control of the marker icon, such as <code>shadow</code> and <code>shape</code>. <code>Shadow</code> defines the shadow cast by the icon and <code>shape</code> defines the clickable/draggable area of the marker but I will not explain them further in this article.</p>
<h4>Definition</h4>
<ul>
<li><strong>icon [string|MarkerImage]</strong><br />
Defines the marker icon. It can either be an <acronym title="Uniform Resource Locator">URL</acronym> pointing to a suitable image or an object of type MarkerImage.</li>
<li><strong>shadow [string|MarkerImage]</strong><br />
Sets the shadow of a marker icon. Takes either an <acronym title="Uniform Resource Locator">URL</acronym> or a <code>MarkerImage</code> as its value.</li>
<li><strong>shape [object]</strong><br />
Defines the clickable/draggable area of a marker. It takes an object as its value. The object contains coordinates that define a polygon much the same way an imageMap is defined.</li>
<li><strong>flat [boolean]</strong><br />
If set to <code>true</code> disables the shadow of the marker.</li>
</ul>
<p class="note"><strong>Note:</strong> By explicitly setting <code>icon</code>, the property <code>shadow</code> is reset. So even if we don&#8217;t provide <code>shadow</code> with a value, it will not inherit the shadow of the default marker. I could be argued that in this case the property <code>flat</code> should be set to <code>true</code>, but it&#8217;s not necessary for the marker to not have a shadow.</p>
<h3>Other properties</h3>
<p>Additionally there are a few other properties you can use to control the marker.</p>
<ul>
<li><strong>cursor [string]</strong><br />
This property changes the way the cursor look when the mouse pointer hovers over the marker.</li>
<li><strong>visible [boolean]</strong><br />
This property determains if the marker should be visible or not. Set it to <code>false</code> to make the marker invisible. The default value is <code>true</code>.</li>
<li><strong>zIndex [number]</strong><br />
Sets the stack order of markers. Could be handy if several markers sits on top of each other.</li>
</ul>
<h3>Live demo</h3>
<p><a href="http://www.svennerberg.com/examples/google_maps_3/markers.html"><img src="http://media.svennerberg.com/2009/07/markers_screenshot-410x440.png" alt="" class="alignnone" /></a></p>
<p>Be sure to checkout the <a href="http://www.svennerberg.com/examples/google_maps_3/markers.html">Live Demo</a> to see the code shown in this article in action. </p>
<h3>Other resources</h3>
<p>For a full and most recent definition of the marker object check out the <a href="http://code.google.com/intl/sv-SE/apis/maps/documentation/v3/reference.html#Marker" title="Google Maps API Reference"><acronym title="Application Programming Interface">API</acronym> reference</a>. Also check out the section about <a href="http://code.google.com/intl/sv-SE/apis/maps/documentation/v3/overlays.html" title="Maps API V3 Overlays">overlays</a> in the documentation.</p>
<p class="note"><strong>Note:</strong> If you liked this article you might enjoy <a href="http://www.svennerberg.com/2009/11/beta-chapter-from-my-upcoming-book-on-google-maps-api-v3/" title="">reading a beta chapter</a> about how to use markers from my upcoming book on Google Maps <acronym title="Application Programming Interface">API</acronym> v3.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/p8MCo4hLBU8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/07/google-maps-api-3-markers/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<series:name><![CDATA[Google Maps API 3]]></series:name>
	<feedburner:origLink>http://www.svennerberg.com/2009/07/google-maps-api-3-markers/</feedburner:origLink></item>
		<item>
		<title>I’m writing a book about Google Maps</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/VOMgWPp9QbM/</link>
		<comments>http://www.svennerberg.com/2009/07/im-writing-a-book-about-google-maps/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 09:50:37 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2122</guid>
		<description><![CDATA[It&#8217;s been a while since I last wrote on this blog and I thought I would get you up to speed why that is. The reason is that I&#8217;ve been occupied with writing a book about Google Maps.
I haven&#8217;t written a book before so this is new territory for me. What I&#8217;ve noticed so far [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/07/blank_book_200.png" alt="" class="alignright" />It&#8217;s been a while since I last wrote on this blog and I thought I would get you up to speed why that is. The reason is that I&#8217;ve been occupied with writing a book about Google Maps.</p>
<p>I haven&#8217;t written a book before so this is new territory for me. What I&#8217;ve noticed so far is that it progresses far slower than I predicted, but at least it progresses steadily even if slower than anticipated. I&#8217;ve taken a few weeks off of my regular work to devote to writing this book but this time won&#8217;t suffice, so there will probably be quite a few late nights and weekends of writing as well.</p>
<p><span id="more-2122"></span></p>
<h3>About the book</h3>
<p>The book will mainly be about how to use the <a href="http://googlegeodevelopers.blogspot.com/2009/05/announcing-google-maps-api-v3.html">recently released </a><strong><a href="http://googlegeodevelopers.blogspot.com/2009/05/announcing-google-maps-api-v3.html">Google Maps <acronym title="Application Programming Interface">API</acronym> V3</a></strong>. This new <acronym title="Application Programming Interface">API</acronym> introduces a whole lot of changes compared to the old one (V2) and this book is meant to explain the differences and to guide you into this new way of using it. Of course if you never used the <acronym title="Application Programming Interface">API</acronym> this book is for you as well. It will provide you with the skills and knowledge necessary to develop great maps.</p>
<p>The main target audience of the book are:</p>
<ul>
<li>Webdesigners that have some basic knowledge of <acronym title="HyperText Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheets">CSS</acronym> and JavaScript.</li>
<li>Developers that quickly wants to transfer from the the old <acronym title="Application Programming Interface">API</acronym> to the new.</li>
<li>Other people interested in incorporating Google Map in their web pages.</li>
</ul>
<p>The book will deal with the <strong>basics of creating maps</strong> as well as some advanced topics such as <strong>how to deal with large amounts of markers</strong>. It will also promote<strong> best practices</strong> for both <acronym title="HyperText Markup Language">HTML</acronym>, <acronym title="Cascading Style Sheets">CSS</acronym> and JavaScript. The book will be filled with code examples that will teach you how things work and that you can start using right away in your own web applications.</p>
<p>As of now I don&#8217;t know in which form this book will be published, but I&#8217;ll keep you informed as things progress.</p>
<p>If you have a request for something that you want me to include in the book, or any thoughts or questions about it, please contact me in the comments or through the <a href="/contact/">Contact page</a>.</p>
<p class="note"><strong>Update:</strong> If you want a sneak peek of the book, I have <a href="/2009/11/beta-chapter-from-my-upcoming-book-on-google-maps-api-v3/" title="Beta chapter from my upcoming book on Google Maps API v3">published a beta chapter about Markers called X Marks the spot</a>. </p>
<h3>Stay posted</h3>
<p>If you want to stay updated with the progress of the book, sign up below.</p>
<div class="notify-me"><form id="notify-me-form" action="" method="post"><div><label for="notify-me-email">Email</label><input type="text" name="notify-me-email" id="notify-me-email" value="" /><input type="hidden" name="notify-me-context" value="Google Maps Book" /><input type="submit" id="notify-me-button" value="Send" /></div></form></div>
<p>And just for the record, your email address is safe with me. I will use it for this purpose only. I hate spam as much as you do!</p>
<p>You should also <a href="http://www.twitter.com/svennerberg">follow me on twitter</a>.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/VOMgWPp9QbM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/07/im-writing-a-book-about-google-maps/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/07/im-writing-a-book-about-google-maps/</feedburner:origLink></item>
		<item>
		<title>Mobile First Person User Interfaces</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/wktimujHdfk/</link>
		<comments>http://www.svennerberg.com/2009/06/mobile-first-person-user-interfaces/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 10:44:06 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[Interaction design]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2096</guid>
		<description><![CDATA[The mobile devices are getting increasingly sophisticated. With the combination of GPS, compass, camera, Internet Connection and a big screen it&#8217;s now possible to create amazing, context aware, first Person UI&#8217;s. Imaging for a moment that you&#8217;re in a foreign city, standing in front of a statue that you never seen before. Point your mobile [...]]]></description>
			<content:encoded><![CDATA[<p>The mobile devices are getting increasingly sophisticated. With the combination of GPS, compass, camera, Internet Connection and a big screen it&#8217;s now possible to create amazing, context aware, first Person UI&#8217;s. Imaging for a moment that you&#8217;re in a foreign city, standing in front of a statue that you never seen before. Point your mobile phone at it and it will tell you what it is, who built it etc, imposing the information as a layer over the reality.</p>
<p><span id="more-2096"></span></p>
<div class="image">
<img src="http://media.svennerberg.com/2009/06/futuristic_glass_2.jpg" alt="" class="alignnone size-full wp-image-2098" /><br />
<a href="http://petitinvention.wordpress.com/2008/02/10/future-of-internet-search-mobile-version/">Future of Internet Search: Mobile version</a>
</div>
<p>Up till now this has merely been concept ideas for future technology, like the Futuristic Glass above, but it&#8217;s now becoming real! For the Google Android platform there&#8217;s already working prototypes, like for example this one. It&#8217;s called <a href="http://layar.eu/">Layar</a> and claims to be the first mobile Augmented Reality browser.</p>
<p><a href="http://media.svennerberg.com/2009/06/layar-app.jpg" title="Layar, worlds first mobile Augmented Reality browser" rel="lightbox[imageset]"><img src="http://media.svennerberg.com/2009/06/layar-app-410x307.jpg" alt=""  class="alignnone size-medium wp-image-2107" /></a></p>
<p><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/b64_16K2e08&#038;hl=en&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/b64_16K2e08&#038;hl=en&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></p>
<p>If you want to read more about this, Luke Wroblewski has written two articles on the subject, showing examples from both the iPhone and the Android platform, including YouTube videos of the applications in action.</p>
<ul>
<li><a href="http://www.lukew.com/ff/entry.asp?824">iPhone with a Compass = First Person UIs?</a></li>
<li><a href="http://www.lukew.com/ff/entry.asp?841">First Person UIs on Android</a></li>
</ul><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/wktimujHdfk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/06/mobile-first-person-user-interfaces/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/06/mobile-first-person-user-interfaces/</feedburner:origLink></item>
		<item>
		<title>Google Maps API 3 – Map settings</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/pjvcyKhvYAI/</link>
		<comments>http://www.svennerberg.com/2009/06/google-maps-api-3-map-settings/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 19:48:10 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Google Maps API 3]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2004</guid>
		<description><![CDATA[In the first article in this series we discussed how to create a simple Map with Google Maps API 3. In this article we will explore the available properties when creating a map and see how we can change the look and behaviour of the map with the help of them.

The required properties
As we saw [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/06/gmmlogo.gif" alt="" class="alignright size-full wp-image-1991" />In the first article in this series we discussed how to create a simple Map with Google Maps <acronym title="Application Programming Interface">API</acronym> 3. In this article we will explore the available properties when creating a map and see how we can change the look and behaviour of the map with the help of them.</p>
<p><span id="more-2004"></span></p>
<h3 class="clear">The required properties</h3>
<p>As we saw in the last article there are 3 required properties when creating a map. These are: </p>
<ul>
<li><strong>center</strong><br />
Takes a coordinate in the form of a <code>google.maps.LatLng</code> that defines the center of the map</li>
<li><strong>zoom</strong><br />
Sets the initial zoom level of the map. It have to be an integer between 0 and 19 where 0 is fully zoomed out and 19 is fully zoomed in.</li>
<li><strong>mapTypeId</strong><br />
Takes a constant of type <code>google.maps.MapTypeId</code> that defines what the initial map type would be</li>
</ul>
<p>It&#8217;s pretty obvious how the two first properties work, but the last one, mapTypeId, requires a brief explanation. What it does is to tell the map what kind of map to display by providing it with a constant. There are a few map types to choose from and they are all contained in the namespace <code>google.maps.MapTypeId</code>. These are:</p>
<ul>
<li><strong>ROADMAP</strong><br />
A normal map</li>
<li><strong>SATELLITE</strong><br />
Satellite images </li>
<li><strong>HYBRID</strong><br />
Displays satellite images with roads and labels overlayed on it</li>
<li><strong>TERRAIN</strong><br />
Displays a map with physical features such as terrain and vegetation</li>
</ul>
<p>So for example, constructing a simple map with the maptype SATTELITE is done like this:</p>
<pre name="code" class="js">
// Creating an object literal containing the properties we want to pass to the map
var options = {
  zoom: 6,
  center: new google.maps.LatLng(57.8, 14.0),
  mapTypeId: google.maps.MapTypeId.SATTELITE
};
// Calling the constructor, thereby initializing the map
var map = new google.maps.Map(document.getElementById('map'), options);
</pre>
<p>That code would produce a map that looks something like this.<br />
<img src="http://media.svennerberg.com/2009/06/sattelite.png" alt="" class="alignnone" /></p>
<h3>Controlling the UI</h3>
<p>Note that some user controls are displayed on the map by default. In the old <acronym title="Application Programming Interface">API</acronym> you had to explicitly define which controls that would show but in version 3 it works the other way around, you have to explicitly define which controls <strong>not</strong> to show. </p>
<h4>diableDefaultUI [boolean]</h4>
<p>Default value is <code>false</code>. By setting this to <code>true</code> you will disable the default UI. That is: the default zoom control and the map type chooser will not be displayed, much as the default behavior in the old <acronym title="Application Programming Interface">API</acronym>. You can however also enable or disable these controls individually.</p>
<h4>mapTypeControl [boolean]</h4>
<p>With this property you control whether the mapTypeControl will be displayed or not. The mapTypeControl is the control positioned in the upper right corner of the map from which you can choose what map type to show. Set it to <code>true</code> to display it and to <code>false</code> to hide it. The default value is <code>true</code>.</p>
<h4>mapTypeControlOption</h4>
<p>With this property you control how the mapTypeControl will be displayed. It can have one of the following values which all resides in the <code>google.maps.MapTypeControlStyle</code> namespace.</p>
<ul>
<li><strong>DEFAULT</strong><br />
The DEFAULT value will vary the look of the mapTypeControl depending of the size of the window and possibly other factors. </li>
<li><strong>HORIZONTAL_BAR</strong><br />
This option will display the standard bar.<br />
<img src="http://media.svennerberg.com/2009/06/horizontal_bar.png" alt="" class="alignnone" />
</li>
<li><strong>DROPDOWN_MENU</strong><br />
This will display the control as a drop-down list. It can be handy if the map is small or you want it to take as little space as possible for some other reason. It currently looks a little weird since the arrow is positioned over the text, but I suspect that it&#8217;s a temporary glitch that will be fixed in future releases.<br />
<img src="http://media.svennerberg.com/2009/06/dropdown_menu.png" alt="" class="alignnone" />
</li>
</ul>
<p>If for example you want this control to display like a drop-down menu you define it like this:</p>
<pre name="code" class="js">
var options = {
  zoom: 6,
  center: new google.maps.LatLng(57.8, 14.0),
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  mapTypeControlOptions: {
    style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
  }
};
</pre>
<p>Note that its parameter is an object literal with one property, <code>style</code>, which takes one of the constants in <code>google.maps.MapTypeControlStyle</code> as its value. This design might seem a little cumbersome at first but is actually pretty smart. It makes it easy to add more settings for the map type control in future releases of the <acronym title="Application Programming Interface">API</acronym>.</p>
<h4>navigationControl [boolean]</h4>
<p>This property displays or hides the navigation control. That is the control that typically resides in the upper left part of the map with which you can zoom and sometimes pan the map. Its appearance has changed a bit since the old version of the <acronym title="Application Programming Interface">API</acronym> but essentially works the same way. The major difference being that in the old <acronym title="Application Programming Interface">API</acronym> the large control had a &#8220;reset&#8221; button that reset the map to its initial state. This feature has been dropped in the new <acronym title="Application Programming Interface">API</acronym> for unknown reasons.</p>
<h4>navigationControlOptions</h4>
<p>The style of the navgationControl comes in 4 flavors that all resides in the 					  <code>google.maps.NavigationControlStyle</code> namespace. These are:</p>
<ul>
<li><strong>DEFAULT</strong><br />
If set to this value, the control will vary according the map size and other factors. As of now that means that it will either display the small or the large control but that might change in future releases.</li>
<li><strong>SMALL</strong><br />
This is the small control that only lets you to zoom the map.<br />
<img src="http://media.svennerberg.com/2009/06/szc3d.png" class="alignnone size-full wp-image-2057" /></li>
<li><strong>ANDROID</strong><br />
This control looks like the SMALL one, but is supposed to be specifically tailored for the Android mobile platform.</li>
<li><strong>ZOOM_PAN</strong><br />
This is the large control that lets you to both zoom and pan the map.<br />
<img src="http://media.svennerberg.com/2009/06/zoom_pan.png" alt="" class="alignnone size-full wp-image-2068" /></li>
</ul>
<p>Here&#8217;s some example code on how to display the large control (zoom_pan).</p>
<pre name="code" class="js">
var options = {
  zoom: 6,
  center: new google.maps.LatLng(57.8, 14.0),
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  navigationControlOptions: {
    style: google.maps.NavigationControlStyle.ZOOM_PAN
  }
};
</pre>
<h4>scaleControl [boolean]</h4>
<p>This property determines whether the scale control will be displayed or not. Set it to <code>true</code> to display the control and <code>false</code> to hide it. This control is not displayed by default, so if you want it to show you have to explicitly set this property to <code>true</code>.</p>
<p>The scale control is typically positioned in the lower left corner of the map and are used to get a sense of the scale of the map. It looks like this:<br />
<img src="http://media.svennerberg.com/2009/06/scale_control.png" alt="" class="alignnone" /></p>
<h4>scaleControlOptions</h4>
<p>You can control how the scale control will be displayed with the help of this property. It currently only has one option which is <code>STANDARD</code> so there&#8217;s really not much you can do, but this might change in future releases.</p>
<h4>keyboardShortcuts [boolean]</h4>
<p>There are some keyboard shortcuts for controlling the map. These are the arrowkeys for panning and +/- for zooming.</p>
<p>Default value is <code>true</code>. If set to <code>false</code> it will disable the keyboard shortcuts. </p>
<h3>Map div behavior</h3>
<p>The Map div is the <acronym title="HyperText Markup Language">HTML</acronym> element that contains the map. Typically it&#8217;s a <code>&lt;div&gt;</code> with <code>id="map"</code> or something similar. There are some properties that controls the behavior of this.</p>
<h4>noClear [boolean]</h4>
<p>The default setting of this is false, and what it does is to clear the content of the div that contains the map. If set to <code>true</code> it will not clear the initial content of it.</p>
<h4>backgroundColor [string]</h4>
<p>This property also affects the map div. It sets the color of the div&#8217;s background which shows when you pan the map and before the map tiles have been loaded.</p>
<h4>noResize [boolean]</h4>
<p>Default value is <code>false</code>. If set to <code>true</code> it prevents the map from doing automatic resize checking.</p>
<h3>Cursor behavior</h3>
<p>Finally there are a couple of properties to control how the cursor will look like. These are:</p>
<h4>draggableCursor</h4>
<p>Sets the name or <acronym title="Uniform Resource Locator">URL</acronym> of the cursor that is displayed on a draggable object.</p>
<h4>draggingCursor</h4>
<p>Sets the name or <acronym title="Uniform Resource Locator">URL</acronym> of the cursor that is displayed when an object is dragged.</p>
<p class="note"><strong>Note:</strong> As of the time of writing these properties doesn&#8217;t seem to work properly. This will hopefully be fixed in a near future.</p>
<h3>Live Demo</h3>
<p>I&#8217;ve put together a Live Demo where you can try out some of the properties of the map and see how they affect it.</p>
<div class="image">
<a href="http://www.svennerberg.com/examples/google_maps_3/properties.php" title="Google Maps API 3 - Properties"><img src="http://media.svennerberg.com/2009/06/properties_screenshot-410x430.png" alt="properties_screenshot" class="alignnone size-medium wp-image-2082" /></a><br />
<a href="http://www.svennerberg.com/examples/google_maps_3/properties.php" title="Google Maps API 3 - Properties">Try out the Live Demo</a>
</div>
<h3>Conclusion</h3>
<p>In this article we&#8217;ve examined the properties available when initializing a map in Google Maps <acronym title="Application Programming Interface">API</acronym> 3. These properties affect the look and behavior of the map. There are additional methods that can be used to alter these properties, but they will be covered in a future article. In the next article we will look at how to work with markers in the new <acronym title="Application Programming Interface">API</acronym>.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/pjvcyKhvYAI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/06/google-maps-api-3-map-settings/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<series:name><![CDATA[Google Maps API 3]]></series:name>
	<feedburner:origLink>http://www.svennerberg.com/2009/06/google-maps-api-3-map-settings/</feedburner:origLink></item>
		<item>
		<title>Javascript Performance Tips</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/VFHVuJjumNk/</link>
		<comments>http://www.svennerberg.com/2009/06/javascript-performance-tips/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 06:31:40 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2029</guid>
		<description><![CDATA[I just found this really great talk on YouTube from a Google Tech Talk called, Speed Up Your JavaScript. It&#8217;s a guy from Yahoo named Nicholas Zakas that talks about various things you can do to get better performance in you Javascripts. 

Some of the things he talks about is:
Scope management
In this part Nicolas explains [...]]]></description>
			<content:encoded><![CDATA[<p>I just found this really great talk on YouTube from a Google Tech Talk called, <strong>Speed Up Your JavaScript</strong>. It&#8217;s a guy from Yahoo named Nicholas Zakas that talks about various things you can do to get better performance in you Javascripts. </p>
<p><span id="more-2029"></span></p>
<p>Some of the things he talks about is:</p>
<h4>Scope management</h4>
<p>In this part Nicolas explains the scope chain and shows some statistics on how long it takes to access data in different places in it.</p>
<h4>Data Access Performance</h4>
<p>It turns out you can gain quite some performance, especially in <acronym title="Internet Explorer">IE</acronym>, by thinking about how you access data. By avoiding global variables and object properties/array items and instead use local variables as much as possible you can make your code run faster.</p>
<h4>Loops</h4>
<p>By doing some really easy modification to your loops you can get a 50% performance boost. What it boils down to is to :</p>
<ul>
<li>Decrease amount of work per iteration</li>
<li>Decrease number of iterations</li>
</ul>
<p>You should also avoid using For-in loops and for each loops and all the function based loops found in Javscript libraries like jQuery and YUI. These takes up to 8 times longer to run than regular for loops.</p>
<h4><acronym title="Document Object Model">DOM</acronym></h4>
<p>In this part Nicholas, amnong other things, talks about HTMLCollections and how slow they are. The reason being that they are dynamic by nature. For example just looping through an HTMLCollection takes up to 68 times longer (in <acronym title="Internet Explorer">IE</acronym>) than it takes to loop through an array. Fortunately he also provides ways to remedy this.</p>
<p>He also describes how to avoid unnecesary <strong>reflow</strong> of the web page.</p>
<h3>The video</h3>
<p>This video gave me so much new information on how to optimize my Javascript code. This is definitely the best talk I ever seen on the subject. If you&#8217;re at all interested in Javascript you should definitely watch it.</p>
<p><object width="480" height="385" data="http://www.youtube-nocookie.com/v/mHtdZgou0qU&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube-nocookie.com/v/mHtdZgou0qU&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /></object></p>
<p><a href="http://www.youtube.com/watch?v=mHtdZgou0qU&amp;feature=channel">Watch the video on YouTube.com</a></p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/VFHVuJjumNk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/06/javascript-performance-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/06/javascript-performance-tips/</feedburner:origLink></item>
		<item>
		<title>Free E-book on Multi-Touch Technologies</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/qAQrJwvhZXE/</link>
		<comments>http://www.svennerberg.com/2009/06/free-ebook-on-multi-touch-technologies/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 12:53:45 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Interaction design]]></category>
		<category><![CDATA[Multi-Touch]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=2010</guid>
		<description><![CDATA[Some people on the forum  NUI-group have written a book called Multi-Touch Technologies. The book is about Multi-Touch seen from several perspectives like hardware, software and gestures. It&#8217;s more about hardware and software than Interaction Design but contains some interesting bits on the latter subject. 

It&#8217;s interesting to note that the book was written [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://media.svennerberg.com/2009/06/mttechcover.jpg" rel="lightbox[imageset]" title="Multi-Touch Technologies"><img src="http://media.svennerberg.com/2009/06/mttechcover_160.png" alt="mttechcover_160" class="alignright" /></a>Some people on the forum  NUI-group have written a book called <strong>Multi-Touch Technologies</strong>. The book is about Multi-Touch seen from several perspectives like hardware, software and gestures. It&#8217;s more about hardware and software than Interaction Design but contains some interesting bits on the latter subject. </p>
<p><span id="more-2010"></span></p>
<p>It&#8217;s interesting to note that the book was written through collaboration between 15 people on the forum and then released to the public, for free. This is how they describe them selfs:</p>
<blockquote><p>Founded in 2006, Natural User Interface Group (~ NUI Group) is an interactive media community researching and creating open source machine sensing techniques to benefit artistic, commercial and educational applications. It’s the largest online (~5000+) open source community related to the open study of Natural User Interfaces.</p></blockquote>
<p>Visit the forum and download the book at <a href="http://www.nuigroup.com/forums">www.nuigroup.com/forums</a></p>
<p>Source: <a href="http://www.inuseful.se/2009/06/ny-bok-om-multitouch.html" title="Ny bok om multitouch">InUseful.se</a></p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/qAQrJwvhZXE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/06/free-ebook-on-multi-touch-technologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/06/free-ebook-on-multi-touch-technologies/</feedburner:origLink></item>
		<item>
		<title>Google Maps API 3 – The basics</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/DVeE-yfW5zY/</link>
		<comments>http://www.svennerberg.com/2009/06/google-maps-api-3-the-basics/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 06:29:09 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Google Maps API 3]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1948</guid>
		<description><![CDATA[The Google Maps API has evolved to version 3. This version is a complete rewrite and focuses primarily on speed. The new API also features new ways of using it. This article is the first in a series exploring version 3 of the Google Maps API. This first article will take a look on how [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/06/gmmlogo.gif" alt="gmmlogo" title="gmmlogo" width="48" height="48" class="alignright size-full wp-image-1991" />The Google Maps <acronym title="Application Programming Interface">API</acronym> has evolved to version 3. This version is a complete rewrite and focuses primarily on speed. The new <acronym title="Application Programming Interface">API</acronym> also features new ways of using it. This article is the first in a series exploring version 3 of the Google Maps <acronym title="Application Programming Interface">API</acronym>. This first article will take a look on how to create a simple map and explain some differences from the previous version.</p>
<p><span id="more-1948"></span></p>
<h3 class="clear">Background information</h3>
<p>First of all, this is an early release of the new <acronym title="Application Programming Interface">API</acronym> and it&#8217;s still in Labs. It doesn&#8217;t contain all the features of the old <acronym title="Application Programming Interface">API</acronym> and will probably never do so since the old <acronym title="Application Programming Interface">API</acronym> is bloated with lots of helper methods for doing all sorts of things like making <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> calls and showing log windows. Nowadays we have libraries like <a href="http://www.jquery.com/">jQuery</a> and <a href="http://www.prototypejs.org/">Prototype</a> and tools such as <a href="http://getfirebug.com/">Firebug</a> to take care of these things. Therefor these features will not be included in the new <acronym title="Application Programming Interface">API</acronym>, since it&#8217;s main focus is to be streamlined in order to be as fast as possible. Other missing features such as polygons and polylines will however probably eventually be included.</p>
<p>Secondly, since it&#8217;s an early release it&#8217;s still undergoing major changes. Features will be added as we go along and some changes of how to do certain things might be introduced.</p>
<p>That said, I think that the new <acronym title="Application Programming Interface">API</acronym> is mature enough to use and certainly to experiment with. It also contains the most common features seen in implementations on Google Maps on the Web. </p>
<p>Enough with the background info already! Let&#8217;s take a look of what the new <acronym title="Application Programming Interface">API</acronym> looks like.</p>
<h3>Inserting a reference to the <acronym title="Application Programming Interface">API</acronym></h3>
<p>The first thing you will notice is that <strong>the <acronym title="Application Programming Interface">API</acronym> key is no longer necessary</strong>. In the previous versions the <acronym title="Application Programming Interface">API</acronym> key was inserted as a querystring into the script reference but not so anymore. This means that you don&#8217;t have to apply for a new <acronym title="Application Programming Interface">API</acronym> key for every domain you want to have a map at. It also means that the <acronym title="Uniform Resource Identifier">URI</acronym> to the <acronym title="Application Programming Interface">API</acronym> is a lot shorter. </p>
<p>So the only thing you have to tell, while referencing the <acronym title="Application Programming Interface">API</acronym>, is whether your device has a sensor or not. <code>sensor=false</code> if you don&#8217;t have a sensor and <code>sensor=true</code> if you do. With a sensor is meant some way to determine your present location, like if you have a GPS in your device. This information is attached as querystring at the end of the <acronym title="Uniform Resource Identifier">URI</acronym>.</p>
<pre name="code" class="html">
&lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
</pre>
<h3>Creating a map</h3>
<h4>A new namespace</h4>
<p>In previous versions of the <acronym title="Application Programming Interface">API</acronym> there were lots of global variables, distinguishing them selfs by having  a capital G in the beginning, like <code>GMap</code> and <code>GLatLng</code>. In the new <acronym title="Application Programming Interface">API</acronym> the namespace <code>google.maps</code> is used. So what was formerly called <code>GLatLng</code> is now called <code>google.maps.LatLng</code>. Using namespaces is good coding praxis. One should avoid cluttering the global namespace as much as possible in order to avoid collisions with other code. Read more about why in <a href="http://www.svennerberg.com/2009/02/global-variables-in-javascript/">Global variables in Javascript</a>.</p>
<p>So in practical terms, here&#8217;s how to create a new coordinate object the old way and how to do it the new way. The <code>LatLng()</code> method takes two arguments, an x and an y coordinate.</p>
<pre name="code" class="js">
// The old way
var latlng = new GLatLng(57.8, 14.0);
// The new way
var latlng = new google.maps.LatLng(57.8, 14.0);
</pre>
<h4>Object literals</h4>
<p>The new <acronym title="Application Programming Interface">API</acronym> makes <strong>heavy use of object literals to pass arguments</strong> to it&#8217;s methods. The old <acronym title="Application Programming Interface">API</acronym> used object literals as well, but in this version they&#8217;ve taken it a step further which I think is positive. I think this is a really beautiful way of coding.  It&#8217;s easy to use, easy to maintain and easy to expand. For you who doesn&#8217;t know what an object literal is, it looks like this:</p>
<pre name="code" class="js">
var myObj = {
  id: '1',
  name: 'Whatever'
};
alert(myObj.name); // Will alert Whatever
</pre>
<p>It&#8217;s basically a fast and easy way to create a Javscript object. Some of you might also recognize it as <a href="http://www.json.org/js.html" title="JSON in JavaScript">JSON</a>, and that&#8217;s exactly what it is. JSON stands for Javascript Object Notation and is in fact a Javascript Object.</p>
<h4>Initializing the map</h4>
<p>To initialize the map we need to call the constructor of the Map class. It takes two arguments the first one being a reference to a <acronym title="HyperText Markup Language">HTML</acronym> elemtn where you want the map to be inserted (often <code>&lt;div id="map"&gt;</code>) and the second one being an object literal (options) containing a set of properties. </p>
<p>This is much like how it works in the old <acronym title="Application Programming Interface">API</acronym>. The big difference is that in the old <acronym title="Application Programming Interface">API</acronym> you had to call the method <code>setCenter()</code> immediately after calling the constructor in order for the map to display. <code>setCenter()</code> told the map what location would be the center of the map and what  the initial zoom level would be. In the new <acronym title="Application Programming Interface">API</acronym> this is not neccesary since both these properties are passed in the option parameter. So instead of making two calls, you now have to do only one. An approach that I think makes a lot more sense.</p>
<p>Before we get into the details of what properties <code>option</code> contains, lets have a look at what the code to create a map looks like.</p>
<pre name="code" class="js">
// Creating a LatLng object containing the coordinate for the center of the map
var latlng = new google.maps.LatLng(57.8, 14.0);
// Creating an object literal containing the properties we want to pass to the map
var options = {
  zoom: 6,
  center: latlng,
  mapTypeId: google.maps.MapTypeId.ROADMAP
};
// Calling the constructor, thereby initializing the map
var map = new google.maps.Map(document.getElementById('map'), options);
</pre>
<h4>Options</h4>
<p>The option parameter is, as mentioned before, an object literal containing the properties we want to pass to the map object. There are three required properties that must be passed to the map on initialization. These are:</p>
<ul>
<li><strong>center</strong><br />
This property sets the center of the map and takes a coordinate of the type google.maps.LatLng</li>
<li><strong>zoom</strong><br />
This is a number that sets the initial zoom-level of the map</li>
<li><strong>mapTypeId</strong><br />
This property sets what kind of map type that would initially be used. The most common type is google.maps.MapTypeId.ROADMAP</li>
</ul>
<p>There are of course lots of other properties that you can use when initializing the map, including which controls to display and which features to enable or disable. For a full list see <a href="http://code.google.com/intl/sv-SE/apis/maps/documentation/v3/reference.html#Map%20options" title="Google Maps JavaScript API V3 - Map options">the documentation</a>.</p>
<h3>Live example</h3>
<div class="image">
<a href="http://www.svennerberg.com/examples/google_maps_3/"><img src="http://media.svennerberg.com/2009/06/simple_map_example-410x452.png" alt="simple_map_example" title="simple_map_example" width="410" height="452" class="alignnone size-medium wp-image-1972" /></a></p>
<p>A live demonstration of a simple map</p>
</div>
<p>I&#8217;ve put together a <a href="http://www.svennerberg.com/examples/google_maps_3/">live example</a> of how to add a Google Map v3 on a web page.</p>
<h3>Conclusion</h3>
<p>In conclusion I would say that the Google Maps <acronym title="Application Programming Interface">API</acronym> team has done several things right here. First of all by using a proper namespace, thereby not cluttering the global namespace. Secondly by heavy use of object literals to pass arguments. This way the <acronym title="Application Programming Interface">API</acronym> is more consistent and also easier to expand in future releases. </p>
<p>Please note that the <acronym title="Application Programming Interface">API</acronym> is still under development and is still undergoing changes. The way it works might change before the final release.</p>
<p>This is the first article in a series about the Google Maps <acronym title="Application Programming Interface">API</acronym> V3, so keep your eyes open for the next one which will explore the different properties for the map object and how you can use these to make the map behave and look differently.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/DVeE-yfW5zY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/06/google-maps-api-3-the-basics/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<series:name><![CDATA[Google Maps API 3]]></series:name>
	<feedburner:origLink>http://www.svennerberg.com/2009/06/google-maps-api-3-the-basics/</feedburner:origLink></item>
		<item>
		<title>Dynamically Toggle Markers in Google Maps</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/V3R5PEsmtis/</link>
		<comments>http://www.svennerberg.com/2009/06/dynamically-toggle-markers-in-google-maps/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 17:36:12 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MarkerManager]]></category>
		<category><![CDATA[Mashups]]></category>
		<category><![CDATA[V.2]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=931</guid>
		<description><![CDATA[This article explains how to dynamically toggle the visibility of markers in Google Maps as well as how to deal with an annoying bug that occurs when trying to do this while using an utility library, like the MarkerManager. 

Using the MarkerManager
The MarkerManager is a very useful Open Source Utility Library for Google Maps with [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2008/10/maps_logo_small_blue.png" alt=""  class="alignright" />This article explains how to dynamically toggle the visibility of markers in Google Maps as well as how to deal with an annoying bug that occurs when trying to do this while using an utility library, like the MarkerManager. </p>
<p><span id="more-931"></span></p>
<h3>Using the MarkerManager</h3>
<p>The <a href="http://gmaps-utility-library-dev.googlecode.com/svn/trunk/markermanager/docs/reference.html" title="MarkerManager v1.0 Reference">MarkerManager</a> is a very useful Open Source Utility Library for Google Maps with the sole purpose to manage larger amounts of Markers. If you add markers with the MarkerManager you can control at which zoom-levels they will appear. And you can also hide and show them dynamically. </p>
<p>If you want to learn more about the MarkerManager and other libraries out there that deals with markers, read my article <a href="http://www.svennerberg.com/2009/01/handling-large-amounts-of-markers-in-google-maps/">Handling Large Amounts of Markers in Google Maps</a>.</p>
<h3>Adding markers with the MarkerManager</h3>
<p>Now the most effective way to add markers to the MarkerManager is to first add them to an array that you then add to the MarkerManager with the <code>addMarkers()</code> method. The code to do this would be something like this.</p>
<pre name="code" class="js">
// Init the MarkerManager
var mgr = new MarkerManager();
//Defining the array that will contain all markers
var markers = [];
// Creating a marker
var marker = new GMarker(new GLatLng(57.8, 14.0));
// Add marker to the array
markers.push(marker);
// Add the array to the MarkerManager
mgr.addMarkers(markers, 1);
mgr.refresh();
</pre>
<p>Obviously it&#8217;s kind of useless to add only one marker this way. It would only be useful if you had at least a few of them, but I think you get the point.</p>
<h3>Hiding and showing markers</h3>
<p>In the Google Maps <acronym title="Application Programming Interface">API</acronym> there are two handy methods to toggle the visibility of markers. These are <code>GMarker.show()</code> and <code>GMarker.hide()</code>. They both work as expected, you call <code>hide()</code> and the markers disappears and then you call <code>show()</code> and the marker is displayed again.</p>
<p>So to hide all markers in this example you simply do this:</p>
<pre name="code" class="js">
// Loop through all markers and hide each of them
for (var i = 0; i < markers.length; i++) {
  var marker = markers[i];
  marker.hide();
}
</pre>
<h3>A bug</h3>
<p>There is however one caveat and that is when you zoom the map the markers will magically appear again. This is an annoying bug that only appears when you use it on markers added with an utility library. </p>
<div class="image">
<a href="http://media.svennerberg.com/2009/06/bug_description.png" rel="lightbox[imageset]"><img src="http://media.svennerberg.com/2009/06/bug_description-410x148.png" alt="bug_description" title="bug_description" width="410" height="148" class="alignnone size-medium wp-image-1934" /></a></p>
<p>Click the image to enlarge</p>
</div>
<h4>The solution</h4>
<p>So far I've only found one solution for this and that is to extend the hide method and tweak the code to place the marker outside the map, thereby making it sort of invisible. </p>
<pre name="code" class="js">
// Saving the position of the marker and then place it outside the map
GMarker.prototype.hide = function() {
  if (this.getPoint().lat() < 90) {
    try {
        this.savePoint = this.getPoint();
        this.setPoint(new GLatLng(90, 0));
    } catch (e) { }
  }
}
</pre>
<p>Subsequently you need to prototype the show method as well so that it moves the marker into the correct position again.</p>
<pre name="code" class="js">
// Restoring the position of the marker
GMarker.prototype.show = function() {
  if (this.getPoint().lat() == 90) {
    if (this.savePoint) {
      try {
        this.setPoint(this.savePoint);
        this.savePoint = null;
      } catch (e) { }
    }
  }
}
</pre>
<p>It's a dirty solution I know, but so far it's the best solution I've found and it works really well.</p>
<p class="note"><strong>Note:</strong> I haven't come up with this solution myself but haven't been able to find where I saw it. So if you know who did come up with it, please tell me so I can give credit where credit is due.</p>
<h4>isHidden()</h4>
<p>The Google Maps <acronym title="Application Programming Interface">API</acronym> also offers a method to determain if a marker is hidden or not, <code>GMarker.isHidden()</code>. If you want to be able to use that you have to prototype it as well. </p>
<pre name="code" class="js">
GMarker.prototype.isHidden = function() {
  if (this.getPoint().lat() == 90) {
    return true;
  } else {
    return false;
  }
}
</pre>
<h3>Live examples</h3>
<div class="image">
<a href="http://www.svennerberg.com/examples/toggle_markers/" title="Dynamically Toggle Markers in Google Maps - Examples"><img src="http://media.svennerberg.com/2009/06/example-410x413.png" alt="" class="alignnone" /></a></p>
<p><a href="http://www.svennerberg.com/examples/toggle_markers/" title="Dynamically Toggle Markers in Google Maps - Examples">Live examples of the bug and the solution</a></p>
</div>
<p>I've put together a few examples of different scenarios using this, so that you will see the problem as well as the solution to it.</p>
<ul>
<li><a href="http://www.svennerberg.com/examples/toggle_markers/">Using GMarker</a></li>
<li><a href="http://www.svennerberg.com/examples/toggle_markers/markermanager.html">Using MarkerManager</a></li>
<li><a href="http://www.svennerberg.com/examples/toggle_markers/markermanager_fixed.html">Using MarkerManager - fixed</a></li>
</ul>
<h3>Other libraries</h3>
<p>There are <a href="http://www.svennerberg.com/2009/01/handling-large-amounts-of-markers-in-google-maps/" title="Handling Large Amounts of Markers in Google Maps">several other libraries for dealing with markers</a> out there, and in at least one of them, <a href="http://www.acme.com/javascript/#Clusterer" title="">Clusterer</a>, I've noticed the same bug as in MarkerManager. The fix proposed in this article will work just fine on that one as well and possibly on other libraries where you might also find this bug.</p>
<p>If you've encountered this problem in other libraries please let me know. It would also be interesting to see other, and possibly more elegant solutions to this problem.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/V3R5PEsmtis" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/06/dynamically-toggle-markers-in-google-maps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/06/dynamically-toggle-markers-in-google-maps/</feedburner:origLink></item>
		<item>
		<title>Google Maps API version 3 is released</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/SbLJE-uPV9w/</link>
		<comments>http://www.svennerberg.com/2009/05/google-maps-api-version-3-is-released/#comments</comments>
		<pubDate>Thu, 28 May 2009 08:30:24 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mashups]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1902</guid>
		<description><![CDATA[Yesterday a new version of the ever so popular Google Maps API was released. In the new version the focus has been on improving speed, especially on mobile devices. I&#8217;ve been fortunate enough to be part of the beta testing and has been able to provide feeback directly to the developers. So far I think [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-515" src="http://media.svennerberg.com/2008/10/maps_logo_small_blue.png" alt="maps_logo_small_blue" width="150" height="55" />Yesterday a new version of the ever so popular Google Maps <acronym title="Application Programming Interface">API</acronym> was released. In the new version the focus has been on improving speed, especially on mobile devices. I&#8217;ve been fortunate enough to be part of the beta testing and has been able to provide feeback directly to the developers. So far I think they&#8217;ve done a great job, even if there&#8217;s still more work to be done.</p>
<p><span id="more-1902"></span></p>
<p>The <acronym title="Application Programming Interface">API</acronym> released now is still in Labs because it&#8217;s not quite ready yet. It only contains a basic set of features that will be further extended. </p>
<p>Here&#8217;s a few of the changes.</p>
<ul>
<li>Improved performance, ecpecialy on Mobile devices</li>
<li>The <acronym title="Application Programming Interface">API</acronym> is now built on an MVC-architecture</li>
<li>The <acronym title="Application Programming Interface">API</acronym>-key is not required anymore.</li>
<li>No global variables. Everything is now in the google.maps namespace</li>
</ul>
<p>I will write more  about the changes in the <acronym title="Application Programming Interface">API</acronym> in  in future articles, but for now you can read more at the <a title="Announcing Google Maps API v3" href="http://googlegeodevelopers.blogspot.com/2009/05/announcing-google-maps-api-v3.html">Google Geo Developers Blog</a>. Also check out the <a title="The Google Maps API V3" href="http://code.google.com/apis/maps/documentation/v3/">documentation</a> and the <a title="Google Maps API Reference" href="http://code.google.com/apis/maps/documentation/v3/reference.html">reference</a>.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/SbLJE-uPV9w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/05/google-maps-api-version-3-is-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/05/google-maps-api-version-3-is-released/</feedburner:origLink></item>
		<item>
		<title>Designing Web Interfaces [Book review]</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/XxXLWcYmpfY/</link>
		<comments>http://www.svennerberg.com/2009/05/designing-web-interfaces-book-review/#comments</comments>
		<pubDate>Wed, 27 May 2009 05:37:02 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Book reviews]]></category>
		<category><![CDATA[Design patterns]]></category>
		<category><![CDATA[Interaction design]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1843</guid>
		<description><![CDATA[Designing Web Interfaces is a book about how to design rich interactions within web pages. In todays web with richer user interfaces, far from the static, full page load web applications we were once used to. We need patterns, guidelines and best practices on how to design those Interfaces to work well. This book is [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Designing Web Interfaces - Principles and Patterns for Rich Interactions" rel="lightbox[imageset]" href="http://media.svennerberg.com/2009/04/designing_web_interfaces.jpg"><img class="alignright" src="http://media.svennerberg.com/2009/04/designing_web_interfaces_small.png" alt="" /></a><strong>Designing Web Interfaces</strong> is a book about how to design rich interactions within web pages. In todays web with richer user interfaces, far from the static, full page load web applications we were once used to. We need patterns, guidelines and best practices on how to design those Interfaces to work well. This book is about just that.</p>
<p><span id="more-1843"></span></p>
<h3>The authors</h3>
<p>Designing Web Interfaces is written by Bill Scott and Theresa Neil. <a href="http://looksgoodworkswell.blogspot.com/">Bill Scott</a> has a background at Yahoo! and is currently working at Netflix. This shows in the examples of design patterns since a lot of them is taken from these companies websites.</p>
<p><a href="http://www.designgenie.org/">Theresa Neil</a> is a User Experience consultant located in Austin, Texas. She has worked with Bill before at Sabre Airline Solutions to form their User Experience team.</p>
<h3>Organization of the book</h3>
<p>The book is organized around 6 design principles. For each principle a number of design patterns are explained. The principles are:</p>
<ul>
<li>Make it direct</li>
<li>Keep it Lightweight</li>
<li>Stay on the Page</li>
<li>Provide an Invitation</li>
<li>Use Transitions</li>
<li>React immediately</li>
</ul>
<p>At the <a href="http://designingwebinterfaces.com/explore">Explore the book</a> section at the books companion site there&#8217;s a short explanation of each principle as well as a presentation of the design patterns presented in each chapter. So if you want to know more about what the book is all about I suggest you look there.</p>
<p>At several places in the book the authors references to <a href="http://www.amazon.com/gp/product/0470084111?ie=UTF8&amp;tag=inusabiwetrus-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0470084111">About Face 3</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&amp;l=as2&amp;o=1&amp;a=0470084111" border="0" alt="" width="1" height="1" /> by <a href="http://en.wikipedia.org/wiki/Alan_Cooper">Alan Cooper</a>. I like that since I think that&#8217;s an indispensable book that every Interaction Designer should read.</p>
<h3>My take</h3>
<p>I think that this book serves both as an inspiration in finding the right design patterns for the projects I&#8217;m working on as well as a deeper understanding of the underlying core principles when choosing and designing interaction elements. It has certainly provided me with a deeper understanding of the ins and outs of drag and drop interactions which is thoroughly examined in the book.</p>
<p>The book is well written, contains lots of illustrations and generally provides really good examples. If you&#8217;re designing/building highly interactive web sites or is interested in learning more about web design patterns, I&#8217;m certain that you will benefit from reading this book. I highly recommend it!</p>
<h3>Resources</h3>
<p>The books companion site is located at <a href="http://designingwebinterfaces.com/" title="Designing Web Interfaces - Principles and Patterns for Rich Interaction">www.designingwebinterfaces.com</a>. There you&#8217;ll find more information about the book, as well as links to other resources about design patterns.</p>
<p><strong>Title:</strong> <a href="http://www.amazon.com/gp/product/0596516258?ie=UTF8&amp;tag=inusabiwetrus-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596516258">Designing Web Interfaces: Principles and Patterns for Rich Interactions</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&amp;l=as2&amp;o=1&amp;a=0596516258" border="0" alt="" width="1" height="1" /><br />
<strong>Authors:</strong> Bill Scott and Theresa Neil<br />
<strong>Publisher:</strong>O&#8217;Reilly Media, Inc.; 1 edition (January 30, 2009)<br />
<strong>Pages:</strong> 332<br />
<strong>ISBN:</strong> 0596516258<br />
<strong>ISBN-13:</strong> 978-0596516253</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/XxXLWcYmpfY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/05/designing-web-interfaces-book-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/05/designing-web-interfaces-book-review/</feedburner:origLink></item>
		<item>
		<title>The value of a holistic view</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/5Q4hEapKBz4/</link>
		<comments>http://www.svennerberg.com/2009/05/the-value-of-a-holistic-view/#comments</comments>
		<pubDate>Mon, 04 May 2009 08:18:31 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Industry]]></category>
		<category><![CDATA[Project management]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1858</guid>
		<description><![CDATA[In development project teams there are often several specialized roles, like programmers, database designers, interaction designers, user researchers, business analysts and so on. Studies has shown that the more these different roles collaborate and are aware of the different aspects of the project as a whole as well as what the other project members are [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/05/collaboration-150x150.jpg" alt="" class="alignright border" />In development project teams there are often several specialized roles, like programmers, database designers, interaction designers, user researchers, business analysts and so on. Studies has shown that the more these different roles collaborate and are aware of the different aspects of the project as a whole as well as what the other project members are doing, the more successful the project is.</p>
<p><span id="more-1858"></span></p>
<p>In Joseph Selbie article <a href="http://www.boxesandarrows.com/view/bringing-holistic">Bringing Holistic Awareness to Your Design</a> at Boxes and Arrows, he discusses the value of a holistic view. In a best-practice study conducted at Selbie&#8217;s company Tristream the following was revealed:</p>
<blockquote cite="http://www.boxesandarrows.com/view/bringing-holistic"><p>Those teams that achieved the highest degree of shared, holistic understanding consistently designed the best web applications. The more each team member understood the business goals, the user needs, and the capabilities and limitations of the IT environment—a holistic view—the more successful the project. In contrast, the more each team member was “siloed” into knowing just their piece of the whole, the less successful the project.</p></blockquote>
<p>The conclusion from this is that each member of a project team, should at some level, be involved in the user research process. There should also be lots of information sharing between team members, preferably through participation and by oral presentations and discussions of results.</p>
<h3>The dangers of siloing in</h3>
<p>Joseph Selbie also writes: </p>
<blockquote cite="http://www.boxesandarrows.com/view/bringing-holistic"><p>The members of the teams that performed less well not only tended not to understand the application as a whole, they saw no need to understand it as a whole: programmers did not care to know about users, user researchers did not care to know about programming limitations, and stakeholders were uninvolved and were considered “clueless” by the rest of the development team.</p></blockquote>
<p>This was a surprisingly common situation in many project teams, but one that clearly should be avoided.</p>
<p>Read more about this and what to do about it in the original article, <a href="http://www.boxesandarrows.com/view/bringing-holistic">Bringing Holistic Awareness to Your Design</a>.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/5Q4hEapKBz4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/05/the-value-of-a-holistic-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/05/the-value-of-a-holistic-view/</feedburner:origLink></item>
		<item>
		<title>Forms that Work [Book review]</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/DQg45Awsvak/</link>
		<comments>http://www.svennerberg.com/2009/04/forms-that-work-book-review/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 15:04:30 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Book reviews]]></category>
		<category><![CDATA[Interaction design]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1789</guid>
		<description><![CDATA[Forms that Work is a book on how to design web forms properly. Some time ago I reviewed a similar book, Web Form Design by Luke Wroblewski, which deals with the same subject. I then thought that this was a very narrow scope for a book, but perhaps it was not, since this book was [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Forms that Work - Designing Web Forms for Usability" rel="lightbox[imageset]" href="http://media.svennerberg.com/2009/04/forms_that_work.jpg"><img class="alignright" src="http://media.svennerberg.com/2009/04/forms_that_work_small.png" alt="" /></a><strong>Forms that Work</strong> is a book on how to design web forms properly. Some time ago I reviewed a similar book, <a href="http://www.svennerberg.com/2008/09/web-form-design-book-review/">Web Form Design</a> by Luke Wroblewski, which deals with the same subject. I then thought that this was a very narrow scope for a book, but perhaps it was not, since this book was published shortly after. No doubt web forms are all around us, so the need for knowledge and skill to design them well should be great. I certainly can&#8217;t seem to get enough of these books.  <span id="more-1789"></span> One thing that&#8217;s great about this book is that it not only focuses on how to visually design forms but  more so on why people should bother to fill them out  in the first place. That&#8217;s a pretty important question to ask, and one that can have a dramatic impact on the success of your form.</p>
<h3>The three layers of the form</h3>
<p>The authors introduces the concept of <em>the three layers of the form</em>. The book is organized around these three layers, so each layer has it&#8217;s own part.</p>
<ul>
<li><span style="font-weight: normal;">The first layer is about the <strong>relationship </strong>between the organization behind the form and the user. </span></li>
<li><span style="font-weight: normal;">The second layer is about <strong>conversation</strong>. That is how the form talks to the user with it&#8217;s questions, labels and instructions. It&#8217;s also about how to logically group different kinds of information.</span></li>
<li><span style="font-weight: normal;">The third layer is about the <strong>appearance</strong> of the form. Here&#8217;s where the design of the form is discussed. It&#8217;s also here where Caroline Jarrett gets to talk about her favorite topic, whether to put a colon at the end of the labels or not. (she doesn&#8217;t think it&#8217;s important <img src='http://www.svennerberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> , <a title="Caroline's Corner: Colons at the end of labels?" href="http://www.usabilitynews.com/news/article3112.asp">read why</a>)</span></li>
</ul>
<p>I think that this way of organizing the book works very well. It supports the design process presented and gives you a good understanding of what to focus on.</p>
<h3>My take</h3>
<p>I found <strong>Forms that Work</strong> fun and easy to read. It&#8217;s filled with illustrations and real-life examples, which makes it easy to understand how to put the concepts into practice. What I love about this book is that it&#8217;s compact and succinct. The authors deliberately decided to keep the book under 200 pages which I think was a very wise decision.  The <em>nitpicks </em>I have is that I found quite a few typos. I also sometimes felt that the illustrations didn&#8217;t quite had the quality that I&#8217;d expect from a book like this. That said, these are only minor complaints and ones that shouldn&#8217;t prevent you from reading this otherwise excellent book.</p>
<h3>Conclusion</h3>
<p>This book will give you tips and guidelines that gets you started right away creating better web forms. The authors back their advice up with years of designing and usability testing forms, so you can feel pretty confident that they deliver good advice. There&#8217;s no doubt that after reading this book you will be able to design better forms. I highly recommend it.</p>
<p><strong>Title:</strong> <a href="http://www.amazon.com/gp/product/1558607102?ie=UTF8&amp;tag=inusabiwetrus-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1558607102">Forms that Work: Designing Web Forms for Usability</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=inusabiwetrus-20&amp;l=as2&amp;o=1&amp;a=1558607102" border="0" alt="" width="1" height="1" /><br />
<strong>Authors:</strong> Caroline Jarrett and Gerry Gaffney<br />
<strong>Publisher:</strong> Morgan Kaufmann (November 17, 2008)<br />
<strong>Pages:</strong> 199<br />
<strong>ISBN:</strong> 1-558607-10-2<br />
<strong>ISBN-13:</strong> 978-1558607101</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/DQg45Awsvak" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/04/forms-that-work-book-review/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/04/forms-that-work-book-review/</feedburner:origLink></item>
		<item>
		<title>ListDJ – song lyrics in Spotify</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/PrYrrnxwfwo/</link>
		<comments>http://www.svennerberg.com/2009/04/listdj-song-lyrics-in-spotify/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 14:53:35 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Quick tips]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1767</guid>
		<description><![CDATA[ListDJ is an add on to Spotify that displays the lyrics of the song you&#8217;re currently listen to. I&#8217;m the kind of guy who thinks that the lyrics of a song is important, so this i perfect for me.

The add on docks itself to the side of the main Spotify application window. From when I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>ListDJ is an add on to Spotify that displays the lyrics of the song you&#8217;re currently listen to. I&#8217;m the kind of guy who thinks that the lyrics of a song is important, so this i perfect for me.</p>
<p><img src="http://media.svennerberg.com/2009/04/listdj.png" alt="" class="alignnone" /></p>
<p>The add on docks itself to the side of the main Spotify application window. From when I&#8217;ve tried it, it finds most lyrics, but there are some that aren&#8217;t available.</p>
<p>ListDJ have been developed by a friend and college of mine, Fredrik Danielsson. To read more and to download it, visit <a href="http://www.listdj.se">www.listdj.se</a>. The add on is completely free but is currently only available on the Windows platform. </p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/PrYrrnxwfwo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/04/listdj-song-lyrics-in-spotify/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/04/listdj-song-lyrics-in-spotify/</feedburner:origLink></item>
		<item>
		<title>Announcing MapTooltip</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/Uilt0zu_TJ0/</link>
		<comments>http://www.svennerberg.com/2009/03/announcing-maptooltip/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 20:28:31 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Extension]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1695</guid>
		<description><![CDATA[One of the shortcomings in the  Google Maps API is that there&#8217;s no easy way to add tooltips to polylines and polygons. That&#8217;s why I felt inclined to build an extension to Google Maps that adds that functionality. MapTooltip makes it possible to add tooltips to any kind of overlay. It&#8217;s even possible to [...]]]></description>
			<content:encoded><![CDATA[<p>One of the shortcomings in the  Google Maps <acronym title="Application Programming Interface">API</acronym> is that there&#8217;s no easy way to add tooltips to polylines and polygons. That&#8217;s why I felt inclined to build an extension to Google Maps that adds that functionality. MapTooltip makes it possible to add tooltips to any kind of overlay. It&#8217;s even possible to have <acronym title="HyperText Markup Language">HTML</acronym> inside it and to style it to fit your design needs.</p>
<p><img src="http://media.svennerberg.com/2009/03/screenshot1.png" alt="" class="alignnone border" /></p>
<p><span id="more-1695"></span></p>
<h3>About MapTooltip</h3>
<p>In a project I&#8217;m working on there&#8217;s a need to have tooltips on polylines. I have tried to find simple ways of doing this but haven&#8217;t been able to find any. After researching this and eventually coming up with a solution I decided to package it into a small library so that I could share it with fellow Google Maps developers.</p>
<h3>Reference</h3>
<p>The constructor creates an object of the type MapTooltip. It takes two required arguments and one optional.</p>
<p><code>MapTooltip(reference:object, tooltip:string, opts?:object)</code></p>
<h4>reference</h4>
<p>The first argument, <code>reference</code>, is a reference to the overlay that you will attach the tooltip to, for example a GPolyline. </p>
<h4>tooltip</h4>
<p>The second argument, <code>tooltip</code>, is a string containing what will appear inside of the tooltip. You can either provide just a plain text string or some <acronym title="HyperText Markup Language">HTML</acronym>.</p>
<h4>opts</h4>
<p>The third argument which is optional, <code>opts</code>, is an object literal that contains all options on how the tooltip will look and behave. It can have the following settings:</p>
<ul>
<li><strong>width</strong><br />
The width of the tooltip, ex: &#8220;100px&#8221;</li>
<li><strong>padding</strong><br />
The padding around the content of the tooltip<br />
For a 3px padding: &#8220;3px&#8221;<br />
For a 2px top/bottom padding and a 5px left/right padding: &#8220;2px 5px&#8221;</li>
<li><strong>backgroundColor</strong><br />
Backgroundcolor of the tooltip, ex: &#8220;#ff9&#8243;</li>
<li><strong>color</strong><br />
The color of the text inside the tooltip, ex: &#8220;#000&#8243;</li>
<li><strong>border</strong><br />
The styling of the border of the tooltip, ex: &#8220;1px solid green&#8221;</li>
<li><strong>fontSize</strong><br />
The size of the text inside the tooltip, ex: &#8220;1em&#8221;</li>
<li><strong>offsetX</strong><br />
The horizontal distance in pixels from the pointer to the tooltip, ex &#8220;10&#8243;</li>
<li><strong>offsetY</strong><br />
The vertical distance in pixels from the pointer to the tooltip, ex: &#8220;10&#8243;</li>
</ul>
<p>It might for example look like this:</p>
<pre name="code" class="js">
var options = {
    'width': '250px',
    'border': '3px dotted #00f'
}
</pre>
<h3>Using MapTooltip</h3>
<p>To use MapTooltip is pretty easy. First add a Google Map as you normally would. Then follow the steps below to attach a tooltip to an object in the map.</p>
<h4>1. Load the library</h4>
<p>Import the library to the web page with the script tag.</p>
<pre name="code" class="html">
&lt;script src="http://maptooltip.googlecode.com/files/mapTooltip.js" type="text/javascript"&gt;&lt;/script&gt;</code>
</pre>
<h4>2. Attach appropriate events</h4>
<p>Add a mouseover event to the object on your map that you wish to have a tooltip. You will also have to add a mouseout event that removes the tooltip.</p>
<pre name="code" class="js">
// Attach mouseover event to a polyline that will trigger the tooltip
GEvent.addListener(polyline, 'mouseover', function() {
	this.overlay = new MapTooltip(this, 'This is a polyline');
	map.addOverlay(this.overlay);
	// Attach mousout event to the polyline that will delete the tooltip
	GEvent.addListener(polyline, 'mouseout', function() {
		map.removeOverlay(this.overlay);
	});
});
</pre>
<p>That&#8217;s it. Be sure to <a href="http://www.svennerberg.com/examples/maptooltip/"> check out the live demo</a> to see it in action. The demo includes tooltips attached to markers, polylines and polygons. One of the tooltip is styled in a different way using the <code>opts</code> parameter.</p>
<div class="image">
<a href="http://www.svennerberg.com/examples/maptooltip/" title="The live demo page of MapToolTip"><img src="http://media.svennerberg.com/2009/03/demo-410x398.png" alt="" class="alignnone" /></a></p>
<p><a href="http://www.svennerberg.com/examples/maptooltip/">Check out the live demo</a></p>
</div>
<h3>Copyright</h3>
<p>MapTooltip is released under the <a href="http://www.opensource.org/licenses/mit-license.php"><acronym title="Massachusetts Institute of Technology">MIT</acronym> License</a> and is free for any use. </p>
<h3>Downloads</h3>
<p><a href="http://maptooltip.googlecode.com/files/mapTooltip.js">mapTooltip.js</a></p>
<h3> Acknowledgments</h3>
<p>MapTooltip is heavily influenced by the article <a href="http://danmarvelo.us/older/2007/9/10/custom-info-window-for-google/">Custom Info Window / Popup for Google Maps, or Loving the GOverlay</a>. </p>
<h3>Known bugs</h3>
<p>If you import the Google Maps <acronym title="Application Programming Interface">API</acronym> with ver=2.x it&#8217;s not going to work as expected since it seems that it doesn&#8217;t handle mouseover events on GMap2 when the pointer is over an GOverlay quite the same way as in previous versions. I don&#8217;t know if this is a temporary glitch or if it&#8217;s supposed to work this way in the future.</p>
<p class="note"><strong>Update [2009-04-11]:</strong> In the latest release of the Google Maps <acronym title="Application Programming Interface">API</acronym> the above mentioned problems currently occur. I will try to find a way around, but until then you can stick to version 2.151 to make it work correctly.</p>
<p>For ideas on this or for other bugs you might encounter, please contact me either in the comments or through the <a href="http://www.svennerberg.com/contact/">Contact page</a>.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/Uilt0zu_TJ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/03/announcing-maptooltip/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/03/announcing-maptooltip/</feedburner:origLink></item>
		<item>
		<title>Updating images with Javascript</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/UJ0iHrNsNPA/</link>
		<comments>http://www.svennerberg.com/2009/03/updating-images-with-javascript/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 07:39:20 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1683</guid>
		<description><![CDATA[This is a quicktip on how to update images on a webpage that retain the same filename but is periodically updated, without having to perform a full page load.

The solution is quite obvious. It&#8217;s as simple as updating the src attribute of the image. The tricky part is to get the browser to actually display [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quicktip on how to update images on a webpage that retain the same filename but is periodically updated, without having to perform a full page load.</p>
<p><span id="more-1683"></span></p>
<p>The solution is quite obvious. It&#8217;s as simple as updating the src attribute of the image. The tricky part is to get the browser to actually display the new image and not just a cached copy of it. To do this we must trick the browser into thinking it&#8217;s a new file that it haven&#8217;t  displayed before. This is preferably done by inserting a unique filename to the src attribute. There&#8217;s a couple a way of doing this but in this example it&#8217;s done by adding the time in milliseconds (ms) as a querystring at the end of the filename.</p>
<pre name="code" class="js">
function updateImage(src) {
    if(src.indexOf('?') > -1) {
        src = src.substr(0, src.indexOf('?'));
    }
    return src + '?' + (new Date()).getTime();
}
var img = document.getElementById('myImage');
img.src = updateImage(img.src);
</pre>
<p>You could theoretically add a hash (#) after the filename instead of a querystring (?), but unfortunately that doesn&#8217;t work in Internet Explorer. So stick with the querystring and you will be fine.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/UJ0iHrNsNPA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/03/updating-images-with-javascript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/03/updating-images-with-javascript/</feedburner:origLink></item>
		<item>
		<title>Free e-book chapter on ASP.NET MVC Framework</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/V2I4Wg4fRnE/</link>
		<comments>http://www.svennerberg.com/2009/03/free-e-book-chapter-on-aspnet-mvc-framework/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 14:40:07 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1678</guid>
		<description><![CDATA[If you&#8217;re into ASP.NET MVC then you should definitely check out this free chapter from the upcoming Wrox book  Professional  ASP.NET MVC 1.0. The chapter is a 185 page long tutorial on how to build a complete web application with the Framework.
The ASP.NET MVC Framework is still in beta (RC2) but is going [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://media.svennerberg.com/2008/08/aspnetlogo_200.gif" alt="" />If you&#8217;re into <acronym title="Active Server Pages">ASP</acronym>.NET MVC then you should definitely check out this free chapter from the upcoming Wrox book <strong> Professional  <acronym title="Active Server Pages">ASP</acronym>.NET MVC 1.0</strong>. The chapter is a 185 page long tutorial on how to build a complete web application with the Framework.</p>
<p>The <acronym title="Active Server Pages">ASP</acronym>.NET MVC Framework is still in beta (RC2) but is going to ship any day now. That&#8217;s good for me since I&#8217;ve built a web application with it that will go live pretty soon.</p>
<p><a href="http://aspnetmvcbook.s3.amazonaws.com/aspnetmvc-nerdinner_v1.pdf">Download the chapter</a>.</p>
<p>Read more on <a href="http://weblogs.asp.net/scottgu/archive/2009/03/10/free-asp-net-mvc-ebook-tutorial.aspx">Scott Guthries blog</a>.</p>
<p><span style="text-decoration: underline;"><br />
</span></p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/V2I4Wg4fRnE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/03/free-e-book-chapter-on-aspnet-mvc-framework/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/03/free-e-book-chapter-on-aspnet-mvc-framework/</feedburner:origLink></item>
		<item>
		<title>Non-modal alert with jQuery</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/LSIOa6hQ9I0/</link>
		<comments>http://www.svennerberg.com/2009/03/non-modal-alert-with-jquery/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 16:23:37 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Design patterns]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1627</guid>
		<description><![CDATA[In circumstances where you want to notify the user of something, like for example that some information have been saved, a non-modal alert is an excellent solution. It gets your message across without being intrusive and without the need for uneccesary user interaction. 
In this article I will describe how to create it with the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2008/08/jquery-logo.gif" alt="jquery-logo" title="jquery-logo" width="133" height="133" class="alignright size-full wp-image-176" />In circumstances where you want to notify the user of something, like for example that some information have been saved, a non-modal alert is an excellent solution. It gets your message across without being intrusive and without the need for uneccesary user interaction. </p>
<p>In this article I will describe how to create it with the help of jQuery</p>
<p><span id="more-1627"></span></p>
<h3>The basics</h3>
<p>The whole idea with this approach is to make the user aware that something has happened, or that an action has been performed. You want to make sure that the message gets across but at the same time you don&#8217;t want to annoy the user or get in his or hers way. One way to do this is to show a message across the screen that as soon as the user moves the mouse, clicks a mouse button or press a key on the keyboard fades away.</p>
<div class="image">
<a href="http://media.svennerberg.com/2009/03/screenshot.png" title="Live demo of a non-modal alert" rel="lightbox[imageset]"><img src="http://media.svennerberg.com/2009/03/screenshot-410x155.png" alt="" class="alignnone" /></a></p>
<p><a href="http://www.svennerberg.com/examples/non-modal_alert/" title="Non-modal alert with jQuery">Watch the live demo</a></p>
</div>
<h3>The <acronym title="HyperText Markup Language">HTML</acronym></h3>
<p>The <acronym title="HyperText Markup Language">HTML</acronym> is straightforward. Just insert this code somewhere in your <acronym title="HyperText Markup Language">HTML</acronym>. Preferably at the top or the bottom of it. Just make sure it&#8217;s not inside a container with an absolute or relative position.</p>
<pre name="code" class="html">
&lt;div class="message"&gt;
    &lt;p&gt;This is a non-modal alert&lt;/p&gt;
&lt;/div&gt;
</pre>
<h3>Give it some style</h3>
<p>We will want the message to hover over the page. Therefor we want it to have an absolute position. By setting the width of the containing <code>&lt;div&gt;</code> to 60% and it&#8217;s left position to 20% it&#8217;s going to appear centered on the screen.</p>
<p>The other declarations are just for the visual appearance of the message.</p>
<pre name="code" class="css">
.message {
    position: absolute;
    top: 145px;
    width: 60%;
    left: 20%;
    background: #ff9;
    border: 1px solid #fc0;
    font-size: 150%;
    padding: 15px 50px;
}
.message p {
    margin: 0;
    padding: 0 40px 0 20px;
    text-align: center;
}
</pre>
<h3>The Javascript</h3>
<p>The Javascript essentially checks if there&#8217;s a an element with the class message in the web page. If there is, it attaches a few events on it that when triggered, removes the message. </p>
<p>Notice that I use <code>one()</code> instead of <code>bind()</code> to attach the events. The reason being that once the event is triggered i doesn&#8217;t have to trigger again. With <code>one()</code>, jQuery automatically unbinds the event after it&#8217;s been triggered. </p>
<pre name="code" class="js">
$(document).ready(function(e) {
    // Check if there's a message
    if($('.message').length) {
         // If mouse is clicked, moved or a key is pressed
         $(document).one('click mousemove keypress', function(e) {
            // Fade the message away after 500 ms
            $('.message').animate({ opacity: 1.0 }, 500).fadeOut();
        });
    }
});
</pre>
<p>Notice in the part where the alert is faded out, there&#8217;s first <code>animate({ opacity: 1.0 }, 500)</code>. This is a hack to get a 500 ms long delay before the message starts to fade out. What it actually does is to change the opacity of the element to 1.0 over a timespan of 500 ms. But since the element already has the opacity 1.0 it just creates a 500 ms long delay before the <code>fadeOut() </code>part is executed.</p>
<p>This is all good and works well in most browsers except&#8230; you guessed it, Internet Explorer.</p>
<h3>Extra tweaks for Internet Explorer</h3>
<p>The problem in Internet Explorer is that the mousemove event triggers instantly even if you haven&#8217;t moved the mouse. Because of this we have to insert a short delay before the events are attached. In this example I&#8217;ve done it by moving the logic to remove the message to a function, <code>removeMessage()</code>,  which I call from the <code>setTimeout</code> function. The second argument of <code>setTimeout</code> determains the delay in ms before <code>removeMessage()</code> is invoked.</p>
<pre name="code" class="js">
$(document).ready(function(e) {
     // Check if there's a message
     if($('.message').length) {
         // the timeout is there to make things work properly in <acronym title="Internet Explorer">IE</acronym>
         // If we have no timeout <acronym title="Internet Explorer">IE</acronym> will trigger mousemove instantly
         setTimeout(removeMessage, 500);
    }
});
function removeMessage(){
    $(document).one('click mousemove keypress', function(e) {
        // Fade the message away after 500 ms
        $('.message').animate({ opacity: 1.0 }, 500).fadeOut();
    });
}
</pre>
<p>That&#8217;s it. Sadly the code is slightly less elegant, but at least i works in all browsers.</p>
<p>Check out the <a href="http://www.svennerberg.com/examples/non-modal_alert/" title="Non-modal alert with jQuery">Live demo</a></p>
<h3>Conclusion</h3>
<p>I have found this solution to be an excellent way to tell the user what&#8217;s going on in an unobtrusive, but still obvious way. I hope that you&#8217;ll find it useful too. If you have a more elegant way of overcoming the problem with <acronym title="Internet Explorer">IE</acronym> or other ideas on how to enhance this solution, don&#8217;t hesitate to tell me.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/LSIOa6hQ9I0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/03/non-modal-alert-with-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/03/non-modal-alert-with-jquery/</feedburner:origLink></item>
		<item>
		<title>Creating a Submenu in Wordpress</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/3g3VvBInU9U/</link>
		<comments>http://www.svennerberg.com/2009/02/creating-a-submenu-in-wordpress/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 21:08:59 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1633</guid>
		<description><![CDATA[For a project I&#8217;m currently working on I wanted to create a submenu that included the parent page as well as the supbages. I just wanted to display the submenu only if the parent page had subpages. Searching the Wordpress Codex and googling for a solution I couldn&#8217;t quite find an example that took all [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/02/wordpress-logo-150x150.png" alt="" class="alignright" />For a project I&#8217;m currently working on I wanted to create a submenu that included the parent page as well as the supbages. I just wanted to display the submenu only if the parent page had subpages. Searching the Wordpress Codex and googling for a solution I couldn&#8217;t quite find an example that took all these factors into consideration so I had to figure it out myself. Here&#8217;s the approach I came up with.</p>
<p><span id="more-1633"></span></p>
<h3>Checking if the page has subpages</h3>
<p>I searched in vain for a method to determine if the current page has any subpages or not. I first assumed that there would be a <code>has_subpages()</code> method, but so far I haven&#8217;t found any. Lacking that, I came up with a very crude way of checking it. I explicitly had to try to fetch all the subpages with the function <code><a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages()</a></code> and then check if it returned anything. It&#8217;s not pretty but it works.</p>
<pre name="code" class="php">
$children = wp_list_pages('&#038;child_of='.$post->ID.'&#038;echo=0');
if($children) {
    // This page has subpages
}
</pre>
<h3>Checking if it&#8217;s a parent page or a subpage</h3>
<p>The next thing I had to figure out was how to check i the current page is a parent page or a subpage. That&#8217;s done with the following code.</p>
<pre name="code" class="php">
if(is_page() &#038;&#038; $post->post_parent) {
    // This is a subpage
} else {
    // This a parent page
}
</pre>
<h3>Fetching the submenu</h3>
<p>Now I needed a way to fetch the subpages. This is done with the <code><a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages()</a></code> function. The tricky part about this is that there&#8217;s no way to get both the parent page and the subpages in the same call. So therefor we have to call the function twice. The call also looks a little different depending on if we&#8217;re on the parent page or on the subpage.</p>
<pre name="code" class="php">
if(is_page() &#038;&#038; $post->post_parent) {
    // This is a subpage
    $children = wp_list_pages("title_li=&#038;include=".$post->post_parent ."&#038;echo=0");
    $children .= wp_list_pages("title_li=&#038;child_of=".$post->post_parent ."&#038;echo=0");
} else if($has_subpages) {
    // This is a parent page that have subpages
    $children = wp_list_pages("title_li=&#038;include=".$post->ID ."&#038;echo=0");
    $children .= wp_list_pages("title_li=&#038;child_of=".$post->ID ."&#038;echo=0");
}
</pre>
<p>There are other ways of doing this, but the benefit of this approach is that we automatically get <code>class="current_page_item"</code> on the list-item that represents the page that we&#8217;re currently on. That&#8217;s handy if you want to style that item in any particular way. </p>
<h3>Outputting the <acronym title="HyperText Markup Language">HTML</acronym></h3>
<p>The last step is to output the actual <acronym title="HyperText Markup Language">HTML</acronym>. I&#8217;ve chosen to output it as an unordered list.</p>
<pre name="code" class="php">
&lt;?php // Check to see if we have anything to output ?&gt;
&lt;?php if ($children) { ?&gt;
&lt;ul class="submenu"&gt;
    &lt;?php echo $children; ?&gt;
&lt;/ul&gt;
&lt;?php } ?>
</pre>
<h3>Putting it all together</h3>
<p>Now it&#8217;s time to put all the pieces together. Just put this code in <del datetime="2009-03-27T17:36:31+00:00">your page template</del> <ins datetime="2009-03-27T17:40:14+00:00">one of the pages in your template, like for example page.php or sidebar.php and you&#8217;re good to go. These pages are located in /wp-content/themes/your-theme/</ins>.</p>
<pre name="code" class="php">
&lt;?php
$has_subpages = false;
// Check to see if the current page has any subpages
$children = wp_list_pages('&#038;child_of='.$post->ID.'&#038;echo=0');
if($children) {
    $has_subpages = true;
}
// Reseting $children
$children = "";

// Fetching the right thing depending on if we're on a subpage or on a parent page (that has subpages)
if(is_page() &#038;&#038; $post->post_parent) {
    // This is a subpage
    $children = wp_list_pages("title_li=&#038;include=".$post->post_parent ."&#038;echo=0");
    $children .= wp_list_pages("title_li=&#038;child_of=".$post->post_parent ."&#038;echo=0");
} else if($has_subpages) {
    // This is a parent page that have subpages
    $children = wp_list_pages("title_li=&#038;include=".$post->ID ."&#038;echo=0");
    $children .= wp_list_pages("title_li=&#038;child_of=".$post->ID ."&#038;echo=0");
}
?&gt;
&lt;?php // Check to see if we have anything to output ?&gt;
&lt;?php if ($children) { ?&gt;
&lt;ul class="submenu"&gt;
    &lt;?php echo $children; ?&gt;
&lt;/ul&gt;
&lt;?php } ?&gt;
</pre>
<h3>Conclusion</h3>
<p>I think that WordPress is an absolutely awesome <acronym title="Content Management System">CMS</acronym>/Blog engine, but it do lack some handy methods. Fortunately it&#8217;s almost always possible to create workarounds. I hope that you will find this useful in your own WordPress Template. Don&#8217;t hesitate to tell me if you have a smarter way of doing this.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/3g3VvBInU9U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/02/creating-a-submenu-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/02/creating-a-submenu-in-wordpress/</feedburner:origLink></item>
		<item>
		<title>The rise of Zooming User Interfaces</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/9nKydprOwAI/</link>
		<comments>http://www.svennerberg.com/2009/02/the-rise-of-zooming-interfaces/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 19:24:06 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Interaction design]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[UX]]></category>
		<category><![CDATA[ZUI]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1007</guid>
		<description><![CDATA[The first time I ever read anything about Zooming User Interfaces was when I was reading The Humane Interface by Jef Raskin, where he introduced the concept of Zoom World, a whole OS based on a Zooming User Interface (ZUI). Of course this wasn&#8217;t my first encounter with this type of user interface since I&#8217;ve, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/02/hard_rock_cafe_memorabilia-150x150.jpg" alt="" class="alignright" />The first time I ever read anything about Zooming User Interfaces was when I was reading <a href="http://www.amazon.com/gp/product/0201379376?ie=UTF8&#038;tag=inusabiwetrus-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0201379376">The Humane Interface</a> by Jef Raskin, where he introduced the concept of <a href="http://books.google.se/books?id=D39vjmLfO3kC&#038;pg=PA152&#038;lpg=PA152&#038;source=bl&#038;ots=COpBdY3U-7&#038;sig=mMeY8iFAemtaViSfpUqq1sV28a0&#038;hl=sv&#038;sa=X&#038;oi=book_result&#038;resnum=3&#038;ct=result#PPA152,M1">Zoom World</a>, a whole <acronym title="Operating System">OS</acronym> based on a Zooming User Interface (ZUI). Of course this wasn&#8217;t my first encounter with this type of user interface since I&#8217;ve, among other things, been using Interactive maps like Google Maps. But it was the first time that I started considering a Zooming Interface a viable alternative to the traditional interaction idioms.</p>
<p>In this article I will explore some of the Zooming User Interfaces out there today and also take a sneak peak of what&#8217;s around the corner.</p>
<p><span id="more-1007"></span></p>
<h3>Why Zooming User Interfaces</h3>
<p>Consider this. You&#8217;re in a maze, unable to find your way out. Relying on maps you quickly lose your way since the human mind is not well suited for remembering long sequences of turns. Now imagine rising up in the air so that you can watch the maze from above. Suddenly it&#8217;s really easy to find your way out, or to find you way to any part of the maze.</p>
<p>The maze in this analogy are applications today, confined inside the constraints of the desktop metaphore. The map are menus, bookmarks and other aids we use to find our way. </p>
<p>Through the evolution of man we&#8217;ve relied on recognizing landmarks as means to find our way around. This is called spatial memory. We&#8217;ve relied on it to remember where we put our tools and hid our food. In ZUI&#8217;s we use this ability to find our way through vast amounts of data.</p>
<p>Are ZUI&#8217;s difficult to use or hard to understand? Personally I think that the widespread use of interactive maps such as Google Maps and Yahoo Maps have paved the way for Zooming User Interfaces. The zooming paradigm is natural once you&#8217;ve tried it and I suspect that it will be more and more common.</p>
<h3>Examples of ZUI&#8217;s</h3>
<p>Ever since I first got interested in ZUI&#8217;s I&#8217;ve seen an increase of them. Here are a several examples of applications using a Zooming User Interface today.</p>
<h4>Prezi</h4>
<p><img src="http://media.svennerberg.com/2009/01/prezi_logo.png" alt=""" class="alignnone" /></p>
<p><a href="http://prezi.com/">Prezi</a> is a tool for making zooming presentations. With an intuitive user interface it&#8217;s easy to create pretty impressive presentations. The cool thing is that the tools your working with in Prezi blends seamlessly with the presentation. </p>
<p>I&#8217;ve made a simple presentation called  <a href="http://prezi.com/4892/">Zooming Interfaces</a> on Prezi. Check it out to see what I&#8217;m talking about.</p>
<h4>Seadragon</h4>
<p><img src="http://media.svennerberg.com/2009/02/seadragon21.jpg" alt="Seadragon" class="alignnone" /></p>
<p>Seadragon is a tool from Microsoft Live Labs that let&#8217;s you use really high resolution images which you can zoom in and out of. In the first part of this video from TED Talks Blaise Aguera y Arcas from Microsoft Labs demonstrates it.</p>
<p><object width="446" height="326"><param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"></param><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent"></param><param name="bgColor" value="#ffffff"></param><param name="flashvars" value="vu=http://video.ted.com/talks/embed/BlaiseAguerayArcas_2007-embed_high.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/BlaiseAguerayArcas-2007.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=129" /><embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="446" height="326" allowFullScreen="true" flashvars="vu=http://video.ted.com/talks/embed/BlaiseAguerayArcas_2007-embed_high.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/BlaiseAguerayArcas-2007.embed_thumbnail.jpg&#038;vw=432&#038;vh=240&#038;ap=0&#038;ti=129"></embed></object></p>
<h4>The Seadragon <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> Library</h4>
<p>With the Seadragon <acronym title="Asynchronous JavaScript and XML">AJAX</acronym> Library it&#8217;s easy to embed single high-res images into a web page. This image is about 35 megapixel. Click around in it to zoom in and out.</p>
<div class="image">
<script type="text/javascript" src="http://seadragon.com/ajax/embed.js"></script><script type="text/javascript">Seadragon.embed("400px", "300px", "http://photozoom.mslivelabs.com/DZ/100/2/Image/alias/Svennerberg/album/2/fef00db9-380a-4e51-8985-7368ae01f750.xml", 8834, 4000, 448, 0, "jpg");</script></p>
<p>Image from iStockPhoto</p>
</div>
<h4>DeepZoom</h4>
<p>Seadragon is implemented in Silverlight through DeepZoom. This combination enables you to create amazing applications where you can seamlessely zoom through huge amount of image data. It&#8217;s also possible to add other information aswell. Check out the examples below to get a sense of how it works. I think that the Hard Rock Café Memorabilia is really impressive.</p>
<p>Here&#8217;s some great examples of implementations of DeepZoom.</p>
<ul>
<li><strong><a href="http://memorabilia.hardrock.com/">Hardrock Café Memorabilia</a></strong><br />
This is a display of memorabilia from Hardrock Café. By zooming and panning you can explore the content. When you zoom in on an object additional information about it is displayed.
</li>
<li><strong><a href="http://www.vertigo.com/deepzoom.aspx">DeepZoom demo at Vertigo</a></strong><br />
This demo illustrates how to navigate content with a zooming interface.
</li>
</ul>
<h4>Mooncake</h4>
<p><a href="http://mooncake.nxmix.com">Mooncake</a> is another implementation of Seadragon. It allows you to pick pictures from a Flickr or SmugMug account. It then automatically process them into Seadragon images. </p>
<p>Here&#8217;s a simple example made from photos from my flickr account.</p>
<div id="MooncakeViewerContainer"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="600" height="400"><param name="source" value="http://mooncake.nxmix.com/ClientBin/MoonCakeViewer.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="autoUpgrade" value="true" /><param name="InitParams" value="DynamicCollectionPath=http://mooncake.nxmix.com//DZFiles/8c7d6df8-001e-9d8a-11dd-f28f1eef9023/metadata.xml"><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div>
<h4>Zoomorama</h4>
<p><img src="http://media.svennerberg.com/2009/02/zoomorama.png" alt="Zoomorama" class="alignnone" /></p>
<p><a href="http://www.zoomorama.com/">Zoomorama</a> is a Flash based tool for making zoomable image albums. You can either add images directly through a web interface or install a desktop application. The desktop application provides you with more powerful tools to design the album as you like. You can for example add captions and arrange the images just as you like in it, something that&#8217;s not possible in the web app.</p>
<h5>Example</h5>
<p>This is an example of a Zoomorama album created with the web application. </p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300"><param name="movie" value="http://app.zoomorama.com/1.0/zoombrowser@zoomorama.com/release/latest/browser.swf?indexURL=http://zml.zoomorama.com/1.0/legacyproxy/4221825e186909079babe6debf2f2be1/8603c1f06f4fdafe7703a9dcc94f2f04/document.1.zml"/><param name="wmode" value="window" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><embed src="http://app.zoomorama.com/1.0/zoombrowser@zoomorama.com/release/latest/browser.swf?indexURL=http://zml.zoomorama.com/1.0/legacyproxy/4221825e186909079babe6debf2f2be1/8603c1f06f4fdafe7703a9dcc94f2f04/document.1.zml" wmode="window" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" width="400" height="300"></embed></object></p>
<h4>OpenZoom</h4>
<p><a href="http://openzoom.org/">OpenZoom</a> is an open source framework for the use of high-resolution images and Zoomable User Interfaces on the web. It uses an implementation of the Deep Zoom technique in Flash.</p>
<p>In part three of Daniel Gasienica article series <a href="http://gasi.ch/blog/inside-deep-zoom-3/">Inside Deep Zoom</a> there are several examples of implementations of this technique.</p>
<h4>Google Maps</h4>
<p>With creative use of the Google Maps <acronym title="Application Programming Interface">API</acronym> some people have created pretty cool ZUI&#8217;s. I&#8217;m sure that this was not the intended use for the <acronym title="Application Programming Interface">API</acronym>, but hey, why not?</p>
<h5>Example of Zooming User Interfaces using the Google Maps <acronym title="Application Programming Interface">API</acronym></h5>
<ul>
<li><strong><a href="http://www.thekremercollection.com/art/">The Kremer Collection</a></strong><br />
The Kremer Collection is a collection of paintings where you can examine the details of a painting by zooming in.</li>
<li><strong><a href="http://www.zkimmer.com/Space/LA/2007/December/">zkimmer</a></strong><br />
Zkimmer uses the Google Maps <acronym title="Application Programming Interface">API</acronym> to display magazines.</li>
</ul>
<h4> Zooming User Interfaces in Comics</h4>
<p>Cartoonist Daniel Merlin Goodbrey are experimenting with new ways to experience comics. In the comic <a href="http://www.e-merl.com/pocom.htm">PoCom-UK-001</a> he uses a Zooming User Interfaces for the viewer to read the cartoon.</p>
<h3> Zooming User Interfaces on Mobile devices</h3>
<p>On mobile devices where screen estate is very limited a Zooming User Interfaces has proved its value to organize information. </p>
<p><img src="http://media.svennerberg.com/2009/02/safari_small.jpg" alt="" class="alignright" /></p>
<h4>Safari web browser</h4>
<p>The Safari browser on the iPhone is one example of this. By being able to zoom in and out of web pages, we overcome the limitations of the small screen. On the iPhone there&#8217;s also the wonders of the multitouch screen which makes it natural to zoom in or out by tapping or by using the pinch maneuver. </p>
<p><a href="http://www.apple.com/iphone/features/safari.html#safarifeature">Watch a video on how this works on apple.com</a></p>
<h4>Firefox Concept Mobile Browser</h4>
<p>Aza Raskin, Head of User Experience at Mozilla Labs, has developed a concept for a Firefox Mobile browser that utilizes a zooming interface among other interesting interaction techniques. </p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="525" height="317" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.vimeo.com/moogaloop.swf?clip_id=1152218&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=cc6600&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="525" height="317" src="http://www.vimeo.com/moogaloop.swf?clip_id=1152218&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=cc6600&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Read more about it on<a href="http://labs.mozilla.com/2008/06/firefox-mobile-concept-video" title="Firefox Mobile Concept Video">Mozilla Labs</a> and on <a href="http://www.azarask.in/blog/post/firefox-mobile-concept-video/" title="Firefox Mobile Concept Video">www.azarask.in</a>.</p>
<h3>Future concepts</h3>
<h4>Aurora</h4>
<p>Aurora is a future concept browser that Adaptive Path has developed for Mozilla Labs. It utilizes a lot of new interaction ideoms, zooming being one of them.</p>
<p>About 2 minutes into this movie, theres a sequence that nicely illustrates a Zooming User Interfaces to browse data. In this interface there&#8217;s also the Z-axel which represents time. The older the content, the farther away it is. It also fades with time. Check out my article <a href="http://www.svennerberg.com/2008/09/visualizing-the-age-of-content/">Visualizing the age of content</a> to read more about this concept.</p>
<p><object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=1450211&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=1450211&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object><br /><a href="http://vimeo.com/">Aurora (Part 1)</a> from <a href="http://vimeo.com/user524591">Adaptive Path</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<h3>What others have written</h3>
<p>Dmitry Fadeyev at Usability Post recently wrote an article called <a href="http://www.usabilitypost.com/2009/02/09/zoomable-user-interfaces/">Zoomable User Interfaces</a>,  where he discusses the benefit of ZUI&#8217;s as well as providing some examples. </p>
<p>There&#8217;s also an article on Wikipedia on <a href="http://en.wikipedia.org/wiki/Zooming_User_Interface">Zooming User Interfaces</a>. </p>
<h3>Conclusion</h3>
<p>I can definitely see a trend in ZUI&#8217;s. Ever since I first started getting interested about it I&#8217;ve seen an increase in examples of it. I feel pretty confident that we&#8217;re going to see a lot more of this in a not so distant future. Do you have more examples of the use of ZUI&#8217;s?</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/9nKydprOwAI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/02/the-rise-of-zooming-interfaces/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/02/the-rise-of-zooming-interfaces/</feedburner:origLink></item>
		<item>
		<title>Global variables in Javascript</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/8ujSzWkwFTo/</link>
		<comments>http://www.svennerberg.com/2009/02/global-variables-in-javascript/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 18:20:21 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1566</guid>
		<description><![CDATA[Global variables are evil. Although possibly nifty for very small programs it quickly clutters the global namespace and increase the risk for name collisions as are program grows larger. The risk for collisions are even greater when using different libraries and widgets.

There are three ways to define a global variable in Javascript. 
The first way [...]]]></description>
			<content:encoded><![CDATA[<p>Global variables are evil. Although possibly nifty for very small programs it quickly clutters the global namespace and increase the risk for name collisions as are program grows larger. The risk for collisions are even greater when using different libraries and widgets.</p>
<p><span id="more-1566"></span></p>
<p>There are three ways to define a global variable in Javascript. </p>
<p>The first way is to declare the variable outside of any function.</p>
<p><code>var myGlobalVar = value;</code></p>
<p>The second way is to assign it as a property to the global object, which in web browsers are the window object.</p>
<p><code>window.myGlobalVar = value;</code></p>
<p>The third way is to use it without defining it. In this case it doesn&#8217;t matter if it&#8217;s inside of a function or not. This is called implied global. </p>
<p><code>myGlobalVar = 'Hello world';</code></p>
<p>A great way to minimize the use of global variables is to store them all in one global object. By doing this you can keep all you variables and functions in one place, greatly reducing the risk for name collisions.</p>
<pre name="code" class="js">
// Define your global object
var myObj = {};
// Add property (variable) to it
myObj.myVar = 'Hello world';
// Add method to it
myObj.myFunctions = function() {
    // Do cool stuff
};
</pre>
<p>The Javascript language was designed with global variables like this to make it easy for beginners to start coding. The side effect being that it&#8217;s easy to forget to define a variable and thereby creating bug that are hard to discover. So do yourself a favor and avoid global variables whenever possible.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/8ujSzWkwFTo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/02/global-variables-in-javascript/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/02/global-variables-in-javascript/</feedburner:origLink></item>
		<item>
		<title>Twitter is exploding</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/QPGPh0w4eQ8/</link>
		<comments>http://www.svennerberg.com/2009/02/twitter-is-exploding/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 07:53:52 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1543</guid>
		<description><![CDATA[Is it just me or is Twitter exploding right now? Apart from noticing that I got more followers the last days, I&#8217;ve also noticed that several Twitter services such as Tweetburner and  Mr. Tweet has been down for maintenance. That might be a sign of overload!
At a seminar I attended last week on Social [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2009/02/twitter-bird.png" alt="" class="alignright" />Is it just me or is Twitter exploding right now? Apart from noticing that I got more followers the last days, I&#8217;ve also noticed that several Twitter services such as <a href="http://tweetburner.com/">Tweetburner</a> and  <a href="http://mrtweet.net/">Mr. Tweet</a> has been down for maintenance. That might be a sign of overload!</p>
<p>At a seminar I attended last week on Social Media one of the speakers <a href="http://www.ronnestam.com/">Johan Ronnestam</a> said that the reason Twitter is exploding right now is Barack Obama successful use of it during his election campaign. Every marketer worth his salt has now studied the phenomena and is busy trying to get everyone at their companies to use Twitter. </p>
<p>Today I also learned that Dalai Lama is now on Twitter. Watch his profile at <a href="http://twitter.com/ohhdl">@OHHDL</a>. Pretty soon everyone will be on board, I&#8217;m just waiting to find my mothers Twitter profile! <img src='http://www.svennerberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>If you want to join the trend, <a href="http://twitter.com/svennerberg">follow me on Twitter</a>!</p>
<h3>Update</h3>
<p>Dalai Lama is now following me on Twitter! Even though I realize that it&#8217;s probably not Dalai Lama himself following me but rather someone administrating it for him, I can&#8217;t help thinking that it&#8217;s pretty cool!<br />
<img src="http://media.svennerberg.com/2009/02/dhalai_lama.png" alt="" class="alignnone" /></p>
<h3>Update 2</h3>
<p>Dalai Lama was apparently a fake. That&#8217;s too bad because he was quickly becoming the most popular person on Twitter. Read all about it at <a href="http://thenextweb.com/2009/02/09/fake-dalai-lama-twitter-bad-karma/">the Next Web</a>.</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/QPGPh0w4eQ8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/02/twitter-is-exploding/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/02/twitter-is-exploding/</feedburner:origLink></item>
		<item>
		<title>Working with Info Windows in Google Maps</title>
		<link>http://feedproxy.google.com/~r/InUsabilityWeTrust/~3/C3aapeWwi-g/</link>
		<comments>http://www.svennerberg.com/2009/02/working-with-info-windows-in-google-maps/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 20:53:21 +0000</pubDate>
		<dc:creator>Gabriel Svennerberg</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Info Windows]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Mashups]]></category>

		<guid isPermaLink="false">http://www.svennerberg.com/?p=1193</guid>
		<description><![CDATA[Having Info Windows in a Google Maps is a powerful way of displaying information about a specific point or object. Did you know that there are several kinds of them? 
In this article I will show you how to add different kinds of Info Windows that appear when you click on a marker.

Content

Basic Info Window
Info [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://media.svennerberg.com/2008/10/maps_logo_small_blue.png" alt="Google Maps API" class="alignright" />Having Info Windows in a Google Maps is a powerful way of displaying information about a specific point or object. Did you know that there are several kinds of them? </p>
<p>In this article I will show you how to add different kinds of Info Windows that appear when you click on a marker.</p>
<p><span id="more-1193"></span></p>
<h3>Content</h3>
<ul>
<li><a href="#basic">Basic Info Window</a></li>
<li><a href="#tabs">Info window with tabs</a></li>
<li><a href="#minimap">Info Window containing a Mini map</a></li>
<li><a href="#maximizing">Maximizing the Info Window</a></li>
<li><a href="#GInfoWindowOption">Options</a></li>
<li><a href="#conclusion">Conclusion and further resources</a></li>
</ul>
<h3 id="basic">Basic Info Window</h3>
<p>The key method for opening an info window when clicking a marker is <code>GMarker.openInfoWindowHTML()</code>. It takes two arguments, first the text that will appear in the Info Window and secondly an optional object literal containing options you might want to use to configure the Info Window. To learn more about the available options, see <a href="#GInfoWindowOption">Options</a> further down the page.</p>
<p>In the examples for this article you have to click a marker to open the window. This is done by using the <code>GEvent.addListener()</code> method. I will not describe exactly how it works in this article but if you&#8217;re unfamiliar with it you can read more about it in the <a href="http://code.google.com/intl/sv-SE/apis/maps/documentation/events.html" title="Google Maps API - Events">official documentation</a>.</p>
<pre name="code" class="js">
// Init a new map
var map = new GMap2(document.getElementById('map'));
map.addControl(new GSmallMapControl());
map.setCenter(new GLatLng(56.87, 14.80), 11);
// Creating a new marker
var marker = new GMarker(new GLatLng(56.87, 14.80))
// Adding a click-event to the marker
GEvent.addListener(marker, 'click', function() {
  // When clicked, open an Info Window
  marker.openInfoWindowHtml('Some text');
});
// Add marker to map
map.addOverlay(marker);
</pre>
<p>This code will result in an ordinary map showing a marker which, when you click on it, pops up an Info Window.</p>
<p><img src="http://media.svennerberg.com/2009/01/basic.png" alt="" class="alignnone" /></p>
<p class="demo"><a href="http://www.svennerberg.com/examples/info_windows/" title="Basic Info Window">Watch live demo</a></p>
<h3 id="tabs">Info Window with Tabs</h3>
<p>If you have a lot of information about each marker, more than you can fit inside a normal Info Window, you could use an Info Window with tabs. You simply define each tab as a <code>GInfoWindowTab</code> and add them to an array that you later on add to the marker using the <code>openInfoWindowTabsHtml()</code> method.</p>
<pre name="code" class="js">
// Create an array that will hold the tabs
var tabs = [];
// Create tabs and add them to the array
tabs.push(new GInfoWindowTab('Tab 1', 'Content of tab 1'));
tabs.push(new GInfoWindowTab('Tab 2', 'Content of tab 2'));
// Add tabs to the InfowWindow
marker.openInfoWindowTabsHtml(tabs);
</pre>
<p>The result is a tabbed Info Window. </p>
<p><img src="http://media.svennerberg.com/2009/01/tabs.png" alt="" class="alignnone" /></p>
<p class="demo"><a href="http://www.svennerberg.com/examples/info_windows/tabs.html" title="Info Window with Tabs">Watch Live Demo</a></p>
<h3 id="minimap">Info Window containing a Mini map</h3>
<p>The <acronym title="Application Programming Interface">API</acronym> features an easy method to open up a mini map over the area where the marker is located, <code>showMapBlowup(opts?:GInfoWindowOptions)</code>. This method takes an object literal that have two possible parameters, <code>InfoWindowOptions.zoomLevel</code> and <code>InfoWindowOptions.mapType</code>. These lets you determine at what zoom-level the mini map should start and what map type it should show.</p>
<pre name="code" class="js">
GEvent.addListener(marker, 'click', function() {
  // When clicked, open an Info Window with a min map in it
  marker.showMapBlowup();
});
</pre>
<p>You never thought it would be this easy to do this, did you?</p>
<p><img src="http://media.svennerberg.com/2009/01/minimap.png" alt="" class="alignnone" /></p>
<p class="demo"><a href="http://www.svennerberg.com/examples/info_windows/minimap.html" title="Info Window with a Mini Map">Watch live demo</a></p>
<h3 id="maximizing">Maximizing the Info Window</h3>
<p>If you have a lot of content to show in you Info Window it could be useful to let the user maximize it. This is easily done using the options <code>maxContent</code> and <code>maxTitle</code>. If you define these you will automatically get a maximize button in your window. </p>
<p>So to make this work just do like this.</p>
<pre name="code" class="js">
marker.openInfoWindowHtml('Click the (+) to maximize me!', {
  maxTitle: 'Maximized Title',
  maxContent: 'Maximized content text.'
});
</pre>
<p>When you first click the marker an ordinary info window will pop up. When you click the plus sign (+) in it, it will maximize.</p>
<p><img src="http://media.svennerberg.com/2009/01/maximized.png" alt="" class="alignnone" /></p>
<p><a href="http://www.svennerberg.com/examples/info_windows/maximize.html" title="Maximizing an Info Window">Watch live demo</a></p>
<h3 id="GInfoWindowOption">Options</h3>
<p>As I&#8217;ve mentioned earlier each of the methods that opens an Info Window takes an optional object literal with options. The properties you can use in it are defined in the <a href="http://code.google.com/intl/sv-SE/apis/maps/documentation/reference.html#GInfoWindowOptions"><code>GInfoWindowOptions</code></a> class.</p>
<p>All properties doesn&#8217;t comply with all kinds of Info Window.</p>
<ul>
<li><strong>selectedTab [number]</strong><br />
Determines which tab should be selected when opening an Info Window. Starts with number 0.</li>
<li><strong>maxWidth [number]</strong><br />
Sets the maximum width of the info window. <strong>Note:</strong> From my observations it seems that the minimum value for this is 249 pixels.</li>
<li><strong>noCloseOnClick [bool]</strong><br />
Sets if the info window should be closed when clicking inside the map. Default value is true.</li>
<li><strong>onOpenFn [Function]</strong><br />
A function that is called after the info window is opened and the content is displayed.</li>
<li><strong>onCloseFn [Function]</strong><br />
A function that is called when the info window is closed.</li>
<li><strong>zoomLevel [number]</strong><br />
Determines what zoom level an opened Mini Map should have. Only applicable with showMapBlowUp().</li>
<li><strong>mapType [GMapType]</strong><br />
Determines what map type an opened Mini Map should have. Only applicable with showMapBlowUp().</li>
<li><strong>maxContent [string]</strong><br />
Determines what content should be showed when an info window is maximized. It can be either an <acronym title="HyperText Markup Language">HTML</acronym> string or an <acronym title="HyperText Markup Language">HTML</acronym> <acronym title="Document Object Model">DOM</acronym> element.</li>
<li><strong>maxTitle [string]</strong><br />
Sets the title for the window when it&#8217;s maximized. It can be either an <acronym title="HyperText Markup Language">HTML</acronym> string or an <acronym title="HyperText Markup Language">HTML</acronym> <acronym title="Document Object Model">DOM</acronym> element.</li>
<li><strong>pixelOffset [GSize]</strong><br />
Specifies a number of pixels to move the info window away from the current GLatLng.</li>
</ul>
<h4>How to use them</h4>
<p>The options are passed to the method in an Object Literal. Here&#8217;s an example of using the <code>maxWidth</code> property when opening a basic Info Window.</p>
<pre name="code" class="js">
marker.openInfoWindowHtml('Some text', {maxWidth: '250'});
</pre>
<h3 id="conclusion">Conclusion and further resources</h3>
<p>Info windows are a powerful way of displaying information about certain objects in a map. In this article I have showed you some of the basic ways to use the built in ones in Google Maps. I think you can go a long way with these techniques but if you have special needs there are third party extensions out there that you can use. </p>
<p>It&#8217;s beyond the scope of this article to describe how they work, but the first library to check out should be <strong>ExtInfoWindow</strong>, one of the open source utility libraries for Google Maps. You&#8217;ll find documentation and examples at <a href="http://gmaps-utility-library.googlecode.com/svn/trunk/extinfowindow/">Google Maps <acronym title="Application Programming Interface">API</acronym> Utility Library</a>. Joe Monahan has also written some about it on the Google Maps <acronym title="Application Programming Interface">API</acronym> Blog in the article <a href="http://googlemapsapi.blogspot.com/2007/12/extinfowindow-10-ajax-powered-css.html">ExtInfoWindow 1.0: Ajax powered, <acronym title="Cascading Style Sheets">CSS</acronym> customization</a>.</p>
<p>Mike William at <a href="http://econym.org.uk/gmap/index.htm">Google Maps <acronym title="Application Programming Interface">API</acronym> Tutorial</a> has described two other libraries in the tutorials <a href="http://econym.org.uk/gmap/ewindows.htm">Using the EWindow extension</a> and <a href="http://econym.org.uk/gmap/ebubble.htm">Using the EBubble extension</a> that also might be useful.</p>
<p>Happy coding!</p><img src="http://feeds.feedburner.com/~r/InUsabilityWeTrust/~4/C3aapeWwi-g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.svennerberg.com/2009/02/working-with-info-windows-in-google-maps/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		<feedburner:origLink>http://www.svennerberg.com/2009/02/working-with-info-windows-in-google-maps/</feedburner:origLink></item>
	</channel>
</rss>
