<?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>techno.blog(&#34;Dion&#34;) &#187; googlemaps</title>
	<atom:link href="http://almaer.com/blog/tag/googlemaps/feed" rel="self" type="application/rss+xml" />
	<link>http://almaer.com/blog</link>
	<description>blogging about life, the universe, and everything tech</description>
	<lastBuildDate>Fri, 25 May 2012 16:56:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dynamically Loading Google Maps for Performance</title>
		<link>http://almaer.com/blog/dynamically-loading-google-maps-for-performance</link>
		<comments>http://almaer.com/blog/dynamically-loading-google-maps-for-performance#comments</comments>
		<pubDate>Wed, 23 Jan 2008 21:14:44 +0000</pubDate>
		<dc:creator>dion</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[googlemaps]]></category>

		<guid isPermaLink="false">http://almaer.com/blog/dynamically-loading-google-maps-for-performance</guid>
		<description><![CDATA[A fellow JavaScripter was running into an issue where the standard way to load the Google Maps API was causing a perceived slow down of a single app page. The API has added the ability to get away from document.write() and dynamically load everything up. 
Example code

function loadScript&#40;&#41; &#123;
  var script = document.createElement&#40;&#34;script&#34;&#41;;
  [...]]]></description>
			<content:encoded><![CDATA[<p>A fellow JavaScripter was running into an issue where the standard way to load the Google Maps API was causing a perceived slow down of a single app page. The API has added the ability to get away from document.write() and dynamically load everything up. </p>
<p><b>Example code</b></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> loadScript<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> script <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;script&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  script.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">;</span>
  script.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=PUT-YOUR-KEY-HERE&amp;async=2&amp;callback=loadMap&quot;</span><span style="color: #339933;">;</span>
  document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> loadMap<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;map&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">37.4419</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">122.1419</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  map.<span style="color: #660066;">addOverlay</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GMarker<span style="color: #009900;">&#40;</span>map.<span style="color: #660066;">getCenter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a href="http://gmaps-samples.googlecode.com/svn/trunk/dynamicloading/scriptappend.html">Here it is at work</a> in an iframe below:</p>
<p><iframe src="http://gmaps-samples.googlecode.com/svn/trunk/dynamicloading/scriptappend.html" frameborder="0" width="520" height="380"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://almaer.com/blog/dynamically-loading-google-maps-for-performance/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

