<?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>royalrodent.com &#187; Google Maps API</title>
	<atom:link href="http://royalrodent.com/archives/category/google-maps-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://royalrodent.com</link>
	<description>Yet another blog taking up valuable cyberspace</description>
	<lastBuildDate>Wed, 01 Sep 2010 02:07:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Geocoding the Contents of an Address Element With jQuery and the Google Maps API</title>
		<link>http://royalrodent.com/archives/geocoding-the-contents-of-an-address-element-with-jquery-and-the-google-maps-api/</link>
		<comments>http://royalrodent.com/archives/geocoding-the-contents-of-an-address-element-with-jquery-and-the-google-maps-api/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 01:41:14 +0000</pubDate>
		<dc:creator>Bryce</dc:creator>
				<category><![CDATA[Google Maps API]]></category>
		<category><![CDATA[javascript and jQuery]]></category>

		<guid isPermaLink="false">http://royalrodent.com/?p=73</guid>
		<description><![CDATA[Here&#8217;s a little piece of code I put together Friday that will take the contents of an address element and find it&#8217;s latitude and longitude using jQuery and the Google Maps API. var g = new google.maps.Geocoder(); var a = &#8230; <a href="http://royalrodent.com/archives/geocoding-the-contents-of-an-address-element-with-jquery-and-the-google-maps-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little piece of code I put together Friday that will take the contents of an <code>address</code> element and find it&#8217;s latitude and longitude using jQuery and the Google Maps API.</p>
<p><code></p>
<pre>var g = new google.maps.Geocoder();
var a = $("#myAddress").text();
a = a.replace( new RegExp( "\\n", "g" ), ' ' );
g.geocode( {address: a}, function(results,status) {
	if (s ==  google.maps.GeocoderStatus.OK) {
		//do some cool mapping stuff
	} else {
		//or fail gracefully in the effort
	}
});</pre>
<p></code></p>
<p>First off, we&#8217;ll just assume you&#8217;ve already added the proper <code>script</code> includes for <a href="http://jquery.com/">the jQuery library</a> and the <a href="http://code.google.com/apis/maps/documentation/javascript/">Google Maps API</a>.  If you don&#8217;t know how, refer to the individual documentation for each for instructions.</p>
<p>The above code first creates a new instance of the Google Maps Geocoder. Then we use jQuery to retrieve just the text inside an <code>address</code>.We then apply a regular expression to strip out any remaining line feeds, and send off the modified address text to Google using the geocoder object we created.  We now have a geocoded lat and long for our address, which we can do all sorts of cool things with. Bazinga!</p>
<p>You don&#8217;t need to use jQuery to do grab the address text. You can pick it out using some straightforward DOM manipulation, but jQuery makes it so darned easy. If you&#8217;re already using the jQuery library for your project, go the route illustrated above. If you&#8217;re not, I don&#8217;t think it&#8217;s a good return on investment to include the jQuery library just for that. Write a little more code and use native functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://royalrodent.com/archives/geocoding-the-contents-of-an-address-element-with-jquery-and-the-google-maps-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing ETA</title>
		<link>http://royalrodent.com/archives/announcing-eta/</link>
		<comments>http://royalrodent.com/archives/announcing-eta/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 02:39:34 +0000</pubDate>
		<dc:creator>Bryce</dc:creator>
				<category><![CDATA[Google Maps API]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript and jQuery]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://royalrodent.com/?p=67</guid>
		<description><![CDATA[I finally finished my submission for the 10K Event Apart Challenge. Check out the rrdotc Labs page for more info on ETA.  It&#8217;s a proof of concept app right now, but I plan on tinkering with it off and on &#8230; <a href="http://royalrodent.com/archives/announcing-eta/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I finally finished my submission for the <a title="An Event Apart 10K Challenge" href="http://10k.aneventapart.com/">10K Event Apart Challenge</a>. Check out the <a title="Royalrodent.com Labs" href="/labs">rrdotc Labs page</a> for more info on ETA.  It&#8217;s a proof of concept app right now, but I plan on tinkering with it off and on and working in enhancements, bug fixes, yada yada yada.  Now that I got more than 10K to work with, I can start doing some really cool stuff.</p>
<p><strong>Update August 25, 2010</strong>: My co-worker Josh and I have just discovered that Palm Pre does not support the <a title="W3C Geolocation API specification" href="http://www.w3.org/TR/geolocation-API/">W3C geolocation API</a>.  Apparently it uses either a proprietary API for its geolocation or doesn&#8217;t expose it&#8217;s geolocation data to the browswer. C&#8217;mon Palm!</p>
<p><strong>Update August 26, 2010</strong>: Much to my surprise, the app has been officially <a title="ETA mobile app at the 10K Challenge" href="http://10k.aneventapart.com/entry/details/308">accepted for the 10K Challenge</a>.  I thought there may be an issue with it being a mobile app or that technically it provides absolutely zero data if you&#8217;re using IE9 preview, but it would appear that my fervent pleas in my readme did not fall on deaf ears. So head on over and throw a few stars my way.</p>
]]></content:encoded>
			<wfw:commentRss>http://royalrodent.com/archives/announcing-eta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

