<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Tim Malone.id.au &#187; Web design</title>
	<atom:link href="http://www.timmalone.id.au/category/web-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.timmalone.id.au</link>
	<description>Tim&#039;s thoughts, words, findings, musings, and rants</description>
	<lastBuildDate>Tue, 27 Jul 2010 10:17:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Google Maps &#8211; a step by step guide to a simple map</title>
		<link>http://www.timmalone.id.au/2007/07/07/google-maps-a-step-by-step-guide-to-a-simple-map/</link>
		<comments>http://www.timmalone.id.au/2007/07/07/google-maps-a-step-by-step-guide-to-a-simple-map/#comments</comments>
		<pubDate>Fri, 06 Jul 2007 23:44:57 +0000</pubDate>
		<dc:creator>Tim Malone</dc:creator>
				<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.timmalone.id.au/thinkstack/index.php/archives/2007/07/07/google-maps-a-step-by-step-guide-to-a-simple-map/</guid>
		<description><![CDATA[<p>Let&#8217;s say you have a need to put a map on a website directing visitors to your location. Or you&#8217;re writing about a particular country or city and would like to show visitors where in the world it is.</p>
<p>Previously here in Australia, a lot of people used <a href="http://www.whereis.com.au/">WhereIs</a> maps for directions. And of course for country or city maps there&#8217;s tons all over the Internet. Trouble is, none of this is actually free for you to use on your site (WhereIs charge $100 per 12 months &#8211; and the service is called MapLink so I&#8217;m wondering whether it&#8217;s just a link to their site, and pretty much any image you find on the Internet is copyrighted anyway).</p>
<p>Solution? Google Maps. Completely free and amazingly customisable. Because it&#8217;s amazingly customisable it&#8217;s also incredibly complicated and if you aren&#8217;t familiar with JavaScript it can be a nightmare. So here&#8217;s a simple, step by step guide to getting a map up on your site. I&#8217;ll go into a few extra features but I&#8217;m leaving out all the advanced features of the Google Maps API. If you want to use them, you&#8217;ll be best reading up on them at the <a href="http://www.google.com/apis/maps/documentation/">Google Maps API Documentation</a>.</p>
<p>So, let&#8217;s get started.</p>
<p><strong>Step One</strong></p>
<p><a href="http://www.google.com/apis/maps/signup.html">Get yourself a Maps API key</a>. The key is valid for a particular domain and/or directory, and you need this for all calls to the API.</p>
<p><strong>Step Two</strong></p>
<p>Place this code in between the &lt;head&gt; and &lt;/head&gt; tags in your webpage:</p>
<pre>&lt;script src=&#34;http://maps.google.com/maps?file=api&#038;v=2&#038;key=<strong>YOUR_API_KEY_HERE</strong>&#34; type=&#34;text/javascript&#34;&gt;
&lt;/script&gt;</pre>
<p><strong>Step Three</strong></p>
<p>Add this code into your page where you want the map to display:</p>
<pre>&lt;div id=&#34;map&#34; style=&#34;width:450px;height:300px;&#34;&gt;&lt;/div&gt;
&lt;script&gt;&lt;!--
var map;
if(GBrowserIsCompatible()){
map=new GMap2(document.getElementById(&#34;map&#34;));
map.setCenter(new GLatLng(45.433756,12.337303),13);
}
//--&gt;&lt;/script&gt;</pre>
<p>This will display a simple map of <a href="http://en.wikipedia.org/wiki/Venice">Venice</a>. The user will be able to move around the map, but won&#8217;t be able to do anything else.</p>
<p>Here&#8217;s what it looks like:</p>
<p><script src="http://maps.google.com/maps?file=api&#038;v=2&#038;key=ABQIAAAAb373cm7bbp_LKGBRgkyfiBSLTSexIGGso0PIxSwgxjFTGIxGWxTU4Dozp_J6CHVeUSM6Nd5zBJLEKw" type="text/javascript"></script></p>
<div id="map" style="width:450px;height:300px;"></div>
<p><script>
var map;
if(GBrowserIsCompatible()){
map=new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(45.433756,12.337303),13);
}
</script></p>
<p><strong>Customisation</strong></p>
<p>Now obviously displaying a map of Venice to your users isn&#8217;t going to be helpful in most cases, so the first thing you&#8217;re going to want to do is recentre the map. The &#8216;setCenter&#8217; function you see in the code above does just that, and the &#8216;GLatLng&#8217; function you see within it lets you create a new location based on latitude longitude co-ordinates.</p>
<p>There are tons of ways to do this. But this is what I find easiest:</p>
<ol>
<li>Visit <a href="http://maps.google.com/">Google Maps</a></li>
<li>Find the place you want by searching for it, and move around until you have the view you want</li>
<li>Click &#8216;Link to this page&#8217;</li>
<li>Copy the link, and copy out the latitude longitude value of the &#8216;ll&#8217; variable in the link &#8211; you can ignore everything else (make sure you get the &#8216;ll&#8217; variable, not the &#8216;sll&#8217; one if it is present)</li>
</ol>
<p>Now that you have the co-ordinates of your place, replace Venice&#8217;s co-ordinates with them. The final number &#8211; set to 13 in the example &#8211; controls the zoom. If you want a world view, you can set the zoom to 0 or 1. If you want a close up street view, you might want to set it to 16 or 17. Experiment till you get the result you want.</p>
<p>Don&#8217;t forget to also play around with the height and width of the div that the map is displaying in, if you want to focus on a particular place without anything else around it.</p>
<p><strong>Extra features</strong></p>
<p>I&#8217;m not going to go into great detail here on extra features &#8211; that is out of the scope of this post &#8211; but what I will do is outline a few useful features that you will probably want to implement on almost every map anyway.</p>
<p>To add the buttons that allow the user to switch between street maps, satellite maps and hybrid maps, add this code directly below the line where we run setCenter():</p>
<pre>map.addControl(new GMapTypeControl());</pre>
<p>To add a zoom control, add this code:</p>
<pre>map.addControl(new GLargeMapControl());</pre>
<p>To enable double click zoom (double left click to zoom in, double right click to zoom out), add this code:</p>
<pre>map.enableDoubleClickZoom();</pre>
<p>And finally, to add a placemarker, add this code:</p>
<pre>map.addOverlay(new GMarker(new GLatLng(45.433756,12.337303)));</pre>
<p>That will add your placemarker on Venice, so be sure to change it to your own co-ordinates.</p>
<p><strong>Further information</strong></p>
<p>This article hasn&#8217;t looked at many of the advanced features of Google Maps &#8211; there is so much more you can do, such as adding multiple placemarkers with information boxes, adding real-time traffic information and driving directions, responding to users clicking on the map, and so on. For further information, you&#8217;ll want to look at the <a href="http://www.google.com/apis/maps/documentation/">Google Maps API Documentation</a> &#8211; or if you&#8217;re ready for the nitty gritty, the <a href="http://www.google.com/apis/maps/documentation/reference.html">API reference</a>.</p>
<p><strong>Alternatives</strong></p>
<p>Of course, Google isn&#8217;t the only provider of maps. If Google&#8217;s Maps don&#8217;t do want you want them to do, perhaps check out Microsoft&#8217;s <a href="http://dev.live.com/virtualearth/sdk/">Virtual Earth SDK</a>, or Yahoo!&#8217;s <a href="http://developer.yahoo.com/maps/">Maps API</a>.</p>
<p>The one thing that did annoy me about Google&#8217;s Maps was that place names are localised to the country they are in &#8211; i.e. place names in Thailand are written in Thai, names in Greece are in Greek, etc. &#8211; which makes the maps very hard to read if you don&#8217;t actually know the language. The latest information I was able to find &#8211; December 2006 &#8211; indicated that Google didn&#8217;t have any immediate plans to change this, so my solution when hit with this problem was to use the alternatives above (Microsoft use English names throughout, and Yahoo transliterate the names from the language to latin characters so that you can at least figure out what they are).</p>
<hr />
<p>So, I hope that this article has helped get you off the ground with displaying maps on your site. If you have any questions, let me know!</p>
]]></description>
		<wfw:commentRss>http://www.timmalone.id.au/2007/07/07/google-maps-a-step-by-step-guide-to-a-simple-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preloading images with CSS</title>
		<link>http://www.timmalone.id.au/2006/04/30/preloading-images-with-css/</link>
		<comments>http://www.timmalone.id.au/2006/04/30/preloading-images-with-css/#comments</comments>
		<pubDate>Sun, 30 Apr 2006 02:41:59 +0000</pubDate>
		<dc:creator>Tim Malone</dc:creator>
				<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.timmalone.id.au/thinkstack/index.php/archives/2006/04/30/preloading-images-with-css/</guid>
		<description><![CDATA[<p>A simple CSS image preloading technique: <a href="http://specere.net/blogs/?p=4">http://specere.net/blogs/?p=4</a>.</p>
<p>&#8217;nuff said. <img src='http://www.timmalone.id.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></description>
		<wfw:commentRss>http://www.timmalone.id.au/2006/04/30/preloading-images-with-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP, CSS, and mod_rewrite cheat sheets</title>
		<link>http://www.timmalone.id.au/2005/05/14/php-css-and-mod_rewrite-cheat-sheets/</link>
		<comments>http://www.timmalone.id.au/2005/05/14/php-css-and-mod_rewrite-cheat-sheets/#comments</comments>
		<pubDate>Fri, 13 May 2005 22:26:58 +0000</pubDate>
		<dc:creator>Tim Malone</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.timmyjnr.id.au/wp/index.php/archives/2005/05/14/php-css-and-mod_rewrite-cheat-sheets/</guid>
		<description><![CDATA[<p>A great resource from Dave Child of <a target="_blank" href="http://www.ilovejackdaniels.com/">ILoveJackDaniels.com</a>.</p>
<p>Dave has recently released three &#8220;cheat sheets&#8221;, both in PNG and PDF format, with easy references for commonly used syntax and expressions in PHP, CSS, and mod_rewrite. They make great posters <img src='http://www.timmalone.id.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>See <a target="_blank" href="http://www.ilovejackdaniels.com/cheat-sheets/">www.ilovejackdaniels.com/cheat-sheets/</a>.</p>
]]></description>
		<wfw:commentRss>http://www.timmalone.id.au/2005/05/14/php-css-and-mod_rewrite-cheat-sheets/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
