<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>n o t e 1 9 . c o m &#187; Google</title>
	<atom:link href="http://note19.com/category/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://note19.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 14:43:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='note19.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>n o t e 1 9 . c o m &#187; Google</title>
		<link>http://note19.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://note19.com/osd.xml" title="n o t e 1 9 . c o m" />
	<atom:link rel='hub' href='http://note19.com/?pushpress=hub'/>
		<item>
		<title>Full screen route maps with elevations</title>
		<link>http://note19.com/2007/12/01/full-screen-route-maps-with-elevations/</link>
		<comments>http://note19.com/2007/12/01/full-screen-route-maps-with-elevations/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 22:07:59 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Maps]]></category>

		<guid isPermaLink="false">http://note19.com/2007/12/01/full-screen-route-maps-with-elevations/</guid>
		<description><![CDATA[The route player is updated to allow full screen maps (with auto resize). In addition, it now has both the elevation/distance &#38; elevation/time charts. To calculate the distance I used the following ActionScript method to find the distance between two geo points (see Hacking Google Maps for details): private function distance(point1: Object, point2 : Object) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=316&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/0471790095?ie=UTF8&amp;tag=httpjaveynet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0471790095"><img src="http://javey.net/images/google-earth.jpg" alt="Hacking Google Maps" class="alignright" /></a>The route player is updated to allow full screen maps (with auto resize). In addition, it now has both  the elevation/distance &amp; elevation/time charts. To calculate the distance I used the following ActionScript method to find the distance between two geo points (see <a href="http://www.amazon.com/gp/product/0471790095?ie=UTF8&amp;tag=httpjaveynet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0471790095">Hacking Google Maps</a> for details):</p>
<pre><code>

private function distance(point1: Object,
  point2 : Object) : Number {
 var lat1 : Number;
 var lat2 : Number;
 var lon1 : Number;
 var lon2 : Number;
 if (point1 == null) return 0;

 // convert degrees to radians

 lat1 = point1.lat * Math.PI / 180.0;
 lat2 = point2.lat * Math.PI / 180.0;

 lon1 = point1.lon * Math.PI / 180.0;
 lon2 = point2.lon * Math.PI / 180.0;	

 // radius of earth in Kilometers converted to miles

 var radius : Number = 6378.1 * 0.621371192;
 var latDist : Number = lat2 - lat1;
 var lonDist : Number = lon2 - lon1;
 var sinLatDist : Number = Math.sin(latDist/2.0);
 var sinLonDist : Number = Math.sin(lonDist / 2.0);
 var a : Number = sinLatDist * sinLatDist +
    Math.cos(lat1) * Math.cos(lat2) *
    sinLonDist * sinLonDist;
 var c : Number = 2.0 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
 var distance : Number = radius * c;
 return distance;
}
</code></pre>
<blockquote><p> <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/21-oct-2007.gpx&amp;title=Kennedy.Shannon.Road.Trail&amp;resize=1">Kenndey / Shannon / Hicks</a> Roads Trail, <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/24-nov-2007.gpx&amp;title=Sheldon.Road.Trail&amp;resize=1">Los Gatos, Sheldon</a> Road Trail, <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/4-nov-2007.gpx&amp;title=Pebble.Beach.Trail&amp;resize=1">Pebble Beach, 17 Miles Drive</a> Trail, <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/23-oct-2007-am.gpx&amp;title=Los.Gatos.San.Jose.Trail&amp;resize=1">Los Gatos, San Jose</a> Trail, <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/28-oct-2007.gpx&amp;title=Stevens.Creek.Reservoir.Trail?resize=1">Stevens Creek Reservoir</a> Trail, <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/29-sept-2007.gpx&amp;title=Kennedy.Hicks.Trail?resize=1">Kennedy / Hicks</a> Trail, <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/joseph.gpx&amp;title=St.Joseph.Trail?resize=1">St. Joseph Hills</a>, Los Gatos Trail, <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/18-nov-2007.gpx&amp;title=Lake.Lexington.Trail?resize=1">Lake Lexington</a> Trail</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/316/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/316/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/316/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=316&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/12/01/full-screen-route-maps-with-elevations/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://javey.net/images/google-earth.jpg" medium="image">
			<media:title type="html">Hacking Google Maps</media:title>
		</media:content>
	</item>
		<item>
		<title>How to add a Flex control to Google Maps</title>
		<link>http://note19.com/2007/11/27/how-to-overlay-a-flex-control-on-google-maps/</link>
		<comments>http://note19.com/2007/11/27/how-to-overlay-a-flex-control-on-google-maps/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 06:20:01 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Maps]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/27/how-to-overlay-a-flex-control-on-google-maps/</guid>
		<description><![CDATA[You can add a Flex control to a Google Map by taking advantage of DHTML DIVs and z-order tags. Here I&#8217;ve defined a Flex control to display the elevation chart associated with a route. In Flex, I specify the opacity of to be 0.5, this means that the chart will be partially transparent. The z-order [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=314&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Overlay Flex Control" href="http://note19.files.wordpress.com/2007/11/flex3.png"><img class="alignleft" src="http://note19.files.wordpress.com/2007/11/flex3.thumbnail.png?w=450" alt="Overlay Flex Control" /></a>You can add a Flex control to a Google Map by taking advantage of DHTML DIVs and z-order tags. Here I&#8217;ve defined a Flex control to display the elevation chart associated with a route. In Flex, I specify the opacity of to be 0.5, this means that the chart will be partially transparent. The z-order of the Flex div ought to be higher than the z-order of the Google Map DIV.</p>
<p>Here are a few example of the Flex elevation chart control in action: <a href="http://javey.net/bike/map/player5/map.html?gpx=http://javey.net/bike/gpx/24-nov-2007.gpx&amp;title=Sheldon.Road.Trail">Sheldon Road Trail</a>, <a href="http://javey.net/bike/map/player5/map.html?gpx=http://javey.net/bike/gpx/21-oct-2007.gpx&amp;title=Kennedy.Shannon.Road.Trail">Kennedy/Shannon Trail</a>, <a href="http://javey.net/bike/map/player5/map.html?gpx=http://javey.net/bike/gpx/4-nov-2007.gpx&amp;title=Pebble.Beach.Trail">Pebble Beach</a> bike route, &amp; <a href="http://javey.net/bike/map/player5/map.html?gpx=http://javey.net/bike/gpx/23-oct-2007-am.gpx&amp;title=Los.Gatos.San.Jose.Trail">Los Gatos to San Jose</a> bike route.</p>
<p>Adding the power of Flex to Google Map gives you to option of selecting the best tools for designing a rich user experience.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/314/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/314/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/314/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=314&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/27/how-to-overlay-a-flex-control-on-google-maps/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/11/flex3.thumbnail.png" medium="image">
			<media:title type="html">Overlay Flex Control</media:title>
		</media:content>
	</item>
		<item>
		<title>Smooth Route Animation in Google Maps: panTo vs. setCenter</title>
		<link>http://note19.com/2007/11/26/smooth-route-animation-in-google-maps-panto-vs-setcenter/</link>
		<comments>http://note19.com/2007/11/26/smooth-route-animation-in-google-maps-panto-vs-setcenter/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 03:10:21 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Maps]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/26/smooth-route-animation-in-google-maps-panto-vs-setcenter/</guid>
		<description><![CDATA[In my first attempt to animate a route on Google Maps, I used the GMap2.setCenter method. This provided for a spotty animation: As the marker moved along the route, the background map (as you can see) would often not render. Changing to use GMap2.panTo instead of the GMap2.setCenter method fixed this problem and the flickering [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=310&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my first attempt to animate a route on Google Maps, I used the <code>GMap2.setCenter</code> method. This provided for a spotty animation:<br />
<div id="v-1lC3DSvg-1" class="video-player" style="width:400px;height:332px">
<embed id="v-1lC3DSvg-1-video" src="http://s0.videopress.com/player.swf?v=1.03&amp;guid=1lC3DSvg&amp;isDynamicSeeking=true" type="application/x-shockwave-flash" width="400" height="332" title="GMap2.setCenter" wmode="direct" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true"></embed></div><br />
As the marker moved along the route, the background map (as you can see) would often not render. Changing to use <code>GMap2.panTo</code> instead of the <code>GMap2.setCenter</code> method fixed this problem and the flickering of the route problem that I was seeing on Safari.<br />
<div id="v-c0rQzDhR-1" class="video-player" style="width:400px;height:332px">
<embed id="v-c0rQzDhR-1-video" src="http://s0.videopress.com/player.swf?v=1.03&amp;guid=c0rQzDhR&amp;isDynamicSeeking=true" type="application/x-shockwave-flash" width="400" height="332" title="GMap2.panTo" wmode="direct" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true"></embed></div></p>
<blockquote><p>Now the route animation of the <a href="http://javey.net/bike/map/player4/map.html?gpx=http://javey.net/bike/gpx/24-nov-2007.gpx&amp;title=Sheldon.Road.Trail">Sheldon Road Trail</a> looks a lot better. So does other routes, e.g. the <a href="http://javey.net/bike/map/player4/map.html?gpx=http://javey.net/bike/gpx/4-nov-2007.gpx&amp;title=Pebble.Beach.Trail">Pebble Beach</a>  route, <a href="http://javey.net/bike/map/player4/map.html?gpx=http://javey.net/bike/gpx/21-oct-2007.gpx&amp;title=Kennedy.Shannon.Road.Trail">Kenndey/Shannon/Hicks Roads</a>  route, or the <a href="http://javey.net/bike/map/player4/map.html?gpx=http://javey.net/bike/gpx/28-oct-2007.gpx&amp;title=Stevens.Creek.Reservoir.Trail">Stevens Creek Reservoir</a>  route.</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/310/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/310/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=310&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" /><div><a href="http://note19.com/2007/11/26/smooth-route-animation-in-google-maps-panto-vs-setcenter/"><img alt="GMap2.setCenter" src="http://videos.videopress.com/1lC3DSvg/setcenter_std.original.jpg" width="160" height="120" /></a></div><div><a href="http://note19.com/2007/11/26/smooth-route-animation-in-google-maps-panto-vs-setcenter/"><img alt="GMap2.panTo" src="http://videos.videopress.com/c0rQzDhR/panto_std.original.jpg" width="160" height="120" /></a></div>]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/26/smooth-route-animation-in-google-maps-panto-vs-setcenter/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	<enclosure url="http://videos.videopress.com/1lC3DSvg/setcenter_std.mp4" length="611328" type="video/mp4" />
<enclosure url="http://videos.videopress.com/c0rQzDhR/panto_std.mp4" length="1324544" type="video/mp4" />

		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:group>
			<media:content url="http://videos.videopress.com/1lC3DSvg/setcenter_std.mp4" fileSize="611328" type="video/mp4" medium="video" bitrate="796" isDefault="true" duration="6" width="400" height="332" />

			<media:content url="http://videos.videopress.com/1lC3DSvg/setcenter_fmt1.ogv" fileSize="611328" type="video/ogg" medium="video" bitrate="796" isDefault="false" duration="6" width="400" height="332" />

			<media:rating scheme="urn:mpaa">g</media:rating>
			<media:title type="plain">GMap2.setCenter</media:title>
			<media:thumbnail url="http://videos.videopress.com/1lC3DSvg/setcenter_std.original.jpg" width="256" height="213" />
			<media:player url="http://s0.videopress.com/player.swf?v=1.03&#38;guid=1lC3DSvg&#38;isDynamicSeeking=true" width="400" height="333" />
		</media:group>

		<media:group>
			<media:content url="http://videos.videopress.com/c0rQzDhR/panto_std.mp4" fileSize="1324544" type="video/mp4" medium="video" bitrate="796" isDefault="true" duration="13" width="400" height="332" />

			<media:content url="http://videos.videopress.com/c0rQzDhR/panto_fmt1.ogv" fileSize="1324544" type="video/ogg" medium="video" bitrate="796" isDefault="false" duration="13" width="400" height="332" />

			<media:rating scheme="urn:mpaa">g</media:rating>
			<media:title type="plain">GMap2.panTo</media:title>
			<media:thumbnail url="http://videos.videopress.com/c0rQzDhR/panto_std.original.jpg" width="256" height="213" />
			<media:player url="http://s0.videopress.com/player.swf?v=1.03&#38;guid=c0rQzDhR&#38;isDynamicSeeking=true" width="400" height="333" />
		</media:group>
	</item>
		<item>
		<title>How to animate a Flex Slider &amp; update Google maps</title>
		<link>http://note19.com/2007/11/24/how-to-animate-a-flex-slider-update-google-maps/</link>
		<comments>http://note19.com/2007/11/24/how-to-animate-a-flex-slider-update-google-maps/#comments</comments>
		<pubDate>Sat, 24 Nov 2007 00:29:24 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/24/how-to-animate-a-flex-slider-update-google-maps/</guid>
		<description><![CDATA[Flex offers a number of different animation techniques. For my Route Player application, I wanted to offer an animation speed option so that when the user clicks on the Start button, the animation starts: the Flex horizontal slider moves to the right, the time-line on the elevation chart moves accordingly, and the Google map gets [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=306&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://javey.net/bike/map/player2/map.html" title="Flex Slider Animation"><img src="http://note19.files.wordpress.com/2007/11/flex-animate.thumbnail.png?w=450" class="alignleft" alt="Flex Slider Animation" /></a>Flex offers a number of different animation techniques. For my Route Player application, I wanted to offer an animation speed option so that when the user clicks on the Start button, <a href="http://javey.net/bike/map/player2/map.html" title="Flex Slider Animation Control"><img src="http://note19.files.wordpress.com/2007/11/flex-control.thumbnail.png?w=450" class="alignright" alt="Flex Slider Animation Control" /></a> the animation starts: the Flex horizontal slider moves to the right, the time-line on the elevation chart moves accordingly, and the Google map gets updated. To see what I mean, click on the thumbnail, and when the Flex application starts, click on the Start button. To make this all work, first you need to define a Flex <code>Sequence</code> control, and include an <code>AnimateProperty</code> that specifies the duration of the animation.</p>
<pre><code>
&lt;mx:Sequence id="myMove" target="{slider}"&gt;
    &lt;mx:AnimateProperty property="value"
      fromValue="{timeMin}"
      toValue="{timeMax}"
      duration="{selectedItem.data}" /&gt;
&lt;/mx:Sequence&gt;
</code></pre>
<p>Next, you&#8217;ll need to extend the <code>HSlider</code> control and override the set value method. See the control <a href="http://note19.googlecode.com/svn/trunk/flex-map/note19/Note19HSlider.mxml">Note19HSlider</a>. This extension of HSlider, includes a callback function that is set to the method <code>sliderMove</code>, which gets called each time the value of the slider has been updated, this in turn updated the chart and the Google Map. The code for all of this is <a href="http://note19.googlecode.com/svn/trunk/flex-map/">here</a>.</p>
<p><span id="more-306"></span>Each time the value of the Slider changes, the following function gets called:</p>
<pre><code>
private function sliderMove(val:String):String {
  point0["x"] = val;
  point0["y"] = 0;
  point1["x"] = val;
  point1["y"] = elevationMax;
  // timeLineData is a Bindable object; the time line
  // on the elevation chart is dependent on this object.
  timeLineData.setItemAt(point0, 0);
  timeLineData.setItemAt(point1, 1);

  // Use binary search to find the closest elevation point to the
  // value of the slider

  var index : int = binarySearch(Number(val), 0, elevationData.length-1);
  var lat : Number = elevationData[index].lat;
  var lon : Number = elevationData[index].lon;

  // Update the Google map

  var u:URLRequest =
    new URLRequest("javascript:centerMap('" + lat + "','" + lon + "')");
  navigateToURL(u,"_self");

  return "Time: " + String(val);
}

</code></pre>
<p>The extension to the Slider is provided as an MXML file (<code>Note19HSlider.mxml</code>):</p>
<pre><code>
&lt;mx:Script&gt;
&lt;![CDATA[
	public var callback : Function = null;

	override public function set value(val:Number):void {
		super.value = val;
                // callback is initialized to be the sliderMove function.
		callback(val);
	}
]]&gt;
&lt;/mx:Script&gt;
</code></pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/306/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/306/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/306/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=306&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/24/how-to-animate-a-flex-slider-update-google-maps/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/11/flex-animate.thumbnail.png" medium="image">
			<media:title type="html">Flex Slider Animation</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/11/flex-control.thumbnail.png" medium="image">
			<media:title type="html">Flex Slider Animation Control</media:title>
		</media:content>
	</item>
		<item>
		<title>How to embed Google Maps in Flex</title>
		<link>http://note19.com/2007/11/22/how-to-embed-google-map-in-flex/</link>
		<comments>http://note19.com/2007/11/22/how-to-embed-google-map-in-flex/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 05:27:14 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Maps]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/22/how-to-embed-google-map-in-flex/</guid>
		<description><![CDATA[Create your Flex application as you would normally do, design the UI and set aside a rectangle in which you wish to display Google Maps. In the HTML wrapper for the Flex application, add a DIV for the Google map, and add JavaScript functions to show or hide this DIV. These functions will be called [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=304&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Embed Google Map in Flex" href="http://javey.net/flex/map2/flex.html"><img class="alignleft" src="http://note19.files.wordpress.com/2007/11/flex2.thumbnail.png?w=450" alt="Embed Google Map in Flex" /></a>Create your Flex application as you would normally do, design the UI and set aside a rectangle in which you wish to display Google Maps. In the HTML wrapper for the Flex application, add a DIV for the Google map, and add JavaScript functions to show or hide this DIV. These functions will be called from Flex when you need to show or hide the map. In this example, I&#8217;ve added the Google map to a Flex Accordion control. The map is shown when you click on the tab  &#8220;Google Map&#8221; and is hidden when you click on the other tabs. <span style="text-decoration:line-through;">The trick to get this to work is to use the Flash <code>wmode="transparent"</code> option when the Flash object is embedded in the <a href="http://note19.googlecode.com/svn/trunk/map2/html-template/index.template.html">HTML page</a>. </span>The code for this example is <a href="http://note19.googlecode.com/svn/trunk/map2/">here</a>.</p>
<blockquote><p>Click <a href="http://javey.net/flex/map2/bin/map2.html">here to see this Flex/HTML integration</a> in action. See also <a href="http://note19.com/2007/11/15/elevation-chart-in-flex-with-google-maps/">this</a> blog entry. </p></blockquote>
<blockquote><p>Here is the <a href="http://note19.com/2007/11/27/how-to-overlay-a-flex-control-on-google-maps/">reverse idea</a>: embedding Flash on top of Google Maps. This is a useful way of <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/24-nov-2007.gpx&amp;title=Sheldon.Road.Trail&amp;resize=1">enhancing Google maps</a>. </p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/304/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/304/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/304/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=304&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/22/how-to-embed-google-map-in-flex/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/11/flex2.thumbnail.png" medium="image">
			<media:title type="html">Embed Google Map in Flex</media:title>
		</media:content>
	</item>
		<item>
		<title>How to use GPX bounds to center the map</title>
		<link>http://note19.com/2007/11/21/how-to-center-the-map-routes/</link>
		<comments>http://note19.com/2007/11/21/how-to-center-the-map-routes/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 05:07:18 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Bike routes]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[GPX]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/21/how-to-center-the-map-routes/</guid>
		<description><![CDATA[A GPX file has a bounds element that defines the coordinates of the bounding box of all the GPS points in the file. Here is an example: &#60;gpx version="1.0" ...&#62; &#60;time&#62;2007-10-24T02:45:26Z&#60;/time&#62; &#60;bounds minlat="37.221354973" minlon="-121.987776104" maxlat="37.330222065" maxlon="-121.892523821"/&#62; ... &#60;/gpx&#62; Here is how you can use the Google MAP API to center the routes based on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=302&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A GPX file has a <code>bounds</code> element that defines the coordinates of the bounding box of all the GPS points in the file. Here is an example:</p>
<pre><code>
&lt;gpx version="1.0" ...&gt;
&lt;time&gt;2007-10-24T02:45:26Z&lt;/time&gt;
&lt;bounds minlat="37.221354973"
   minlon="-121.987776104"
   maxlat="37.330222065"
   maxlon="-121.892523821"/&gt;
...
&lt;/gpx&gt;
</code></pre>
<p>Here is how you can use the Google MAP API to center the routes based on the <code>bounds</code> element in the GPX file:</p>
<pre><code>
var b = xmlDoc.documentElement.getElementsByTagName("bounds");
var sw = new GLatLng(b[0].getAttribute("minlat"), b[0].getAttribute("minlon"));
var ne = new GLatLng(b[0].getAttribute("maxlat"), b[0].getAttribute("maxlon"));
var bounds = new GLatLngBounds(sw, ne);
map.setCenter(bounds.getCenter(), 12);
</code></pre>
<blockquote><p> Here is the above code in action: <a href="http://javey.net/bike/map/player1/map.html?gpx=http://javey.net/bike/gpx/28-oct-2007.gpx&amp;title=Stevens.Creek.Reservoir.Trail">Los Gatos, Stevens Creek Reservoir bike trail</a></p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/302/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/302/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/302/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=302&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/21/how-to-center-the-map-routes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>
	</item>
		<item>
		<title>Lake Lexington Bike Trail</title>
		<link>http://note19.com/2007/11/19/lake-lexington-bike-trail/</link>
		<comments>http://note19.com/2007/11/19/lake-lexington-bike-trail/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 05:15:14 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Bike routes]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[GPX]]></category>
		<category><![CDATA[Maps]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/19/lake-lexington-bike-trail/</guid>
		<description><![CDATA[This morning, Allen and I went for bike ride around Lexington Lake. The ride started and ended at down town Los Gatos. The ride was 11.72 miles and took an hour and a half. The ride is relatively easy and quite relaxing. There are a few climbs that provide a good workout. The Route Player [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=299&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://javey.net/bike/map/player1/map.html" title="Lake Lexington Bike Trail"><img src="http://note19.files.wordpress.com/2007/11/bike-lex.thumbnail.png?w=450" class="alignleft" alt="Lake Lexington Bike Trail" /></a>This morning, Allen and I went for bike ride around Lexington Lake. The ride started and ended at down town Los Gatos. The ride was 11.72 miles and took an hour and a half. The ride is relatively easy and quite relaxing. There are a few climbs that provide a good workout.</p>
<blockquote><p> The Route Player that I&#8217;m writing is more functional than before. When you click on the thumbnail, you&#8217;ll see the elevation chart plus a google map displaying the route. As you hover over the elevation chart, a maker is shown on the route. The chart is in Flex and the map in DHTML. Both the Flex and the DHTML parts read the GPX file and convert the XML data into elevation chart and map route. (The slider is still not working).</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/299/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/299/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/299/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=299&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/19/lake-lexington-bike-trail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/11/bike-lex.thumbnail.png" medium="image">
			<media:title type="html">Lake Lexington Bike Trail</media:title>
		</media:content>
	</item>
		<item>
		<title>GPX Player with Flex &amp; Google Maps</title>
		<link>http://note19.com/2007/11/18/gpx-player-with-flex-google-maps/</link>
		<comments>http://note19.com/2007/11/18/gpx-player-with-flex-google-maps/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 01:25:57 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Bike routes]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[GPX]]></category>
		<category><![CDATA[Maps]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/18/gpx-player-with-flex-google-maps/</guid>
		<description><![CDATA[The Route Player that I&#8217;m working on is coming along. The most difficult part of this pet project is finding time to spend on it. Anyhow, now it can read the GPX file (using Google Map AJAX APIs), display the route and as you mouse over the elevation chart (in FLEX), a marker is moved [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=295&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://javey.net/bike/map/player/map3.html" title="GPX Player"><img src="http://note19.files.wordpress.com/2007/11/bike.thumbnail.png?w=450" class="alignleft" alt="GPX Player" /></a>The Route Player that I&#8217;m working on is coming along. The most difficult part of this pet project is finding time to spend on it. Anyhow, now it can read the GPX file (using Google Map AJAX APIs), display the route and as you mouse over the elevation  chart (in FLEX), a marker is moved along the route to let you easily find out the steepest parts of the route, e.g.</p>
<p>There are couple of interesting aspects to this latest version of the player: reading the GPX file and positioning the marker. The function <code>load</code> below is called on page load. This initializes the map and reads the GPX data, and where each point recorded by the GPS device is converted to a GPoint. Here is an example of a GPS device point recorded in GPX 1.0 format:</p>
<pre><code>
&lt;trkpt lat="37.222033069" lon="-121.983074527"&gt;
  &lt;ele&gt;120.782837&lt;/ele&gt;
&lt;time&gt;2007-10-14T18:33:22Z&lt;/time&gt;
&lt;/trkpt&gt;
</code></pre>
<p>Here is the <code>load</code> function:</p>
<pre><code>
function load() {
   if (GBrowserIsCompatible()) {
   	initMap(720, 300);
	var request = GXmlHttp.create();
	request.open("GET", "http://javey.net/bike/map/player/14-oct-2007.gpx", true);
	request.onreadystatechange = function() {
	    if (request.readyState == 4) {
	        var xmlDoc = null;
	        var textLength = parseFloat(request.responseText.length);
	        if (textLength &gt; 0) {
		    xmlDoc = GXml.parse(request.responseText);
	        } else {
		    xmlDoc = request.responseXML;
	        }
                var points = xmlDoc.documentElement.getElementsByTagName("trkpt");
	        var track = new Array();
	        for (var i = 0; i &lt; points.length; i++) {
	            var point =
                      new GPoint(parseFloat(points[i].getAttribute("lon")),
                                parseFloat(points[i].getAttribute("lat")));
	            track.push(point);
	        }
	        var p = new GPolyline(track);
	        map.addOverlay(p);
             }
       }
       // Send the request for data
       request.send(null);
    }
}
</code></pre>
<p>When you hover over the elevation chart, the JavaScript function <code>centerMap</code> is called (view source the page). This function in turn moves the marker on the map.</p>
<pre><code>
var marker;
function centerMap(lat, lng) {
    if (marker != null) {
        map.removeOverlay(marker);
    }
    var point = new GLatLng(lat, lng);
    map.setCenter(point);
    marker = new GMarker(point);
    map.addOverlay(marker);
}
</code></pre>
<p>Next I need to modify the code to allow loading of GPX files dynamically (perhaps specified via a URL parameter, e.g.) and I need to add playback feature to the player.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/295/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/295/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/295/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/295/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/295/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=295&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/18/gpx-player-with-flex-google-maps/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/11/bike.thumbnail.png" medium="image">
			<media:title type="html">GPX Player</media:title>
		</media:content>
	</item>
		<item>
		<title>Elevation Chart in Flex with Google Maps</title>
		<link>http://note19.com/2007/11/15/elevation-chart-in-flex-with-google-maps/</link>
		<comments>http://note19.com/2007/11/15/elevation-chart-in-flex-with-google-maps/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 06:07:16 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Bike routes]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Maps]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/15/elevation-chart-in-flex-with-google-maps/</guid>
		<description><![CDATA[You can mix DHTML and Flex in one page without too much effort. Here is how you do this: Add a DIV for the DHTML element that you wish to include after the embed Flash tags. Include the Google Map JavaScript as before in your HTML Add JavaScript methods that you wish to call from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=291&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://javey.net/bike/map/player1/map.html" title="Flex with Google"><img src="http://note19.files.wordpress.com/2007/11/flex1.thumbnail.png?w=450" class="alignleft" alt="Flex with Google" /></a>You can mix DHTML and Flex in one page without too much effort. Here is how you do this:</p>
<ol>
<li>Add a DIV for the DHTML element that you wish to include after the embed Flash tags.</li>
<li>Include the Google Map JavaScript as before in your HTML</li>
<li>Add JavaScript methods that you wish to call from Flex</li>
<li>In your Flex application, you can call these JavaScripts using the <code>navigateToURL</code> method. For example, as you move the mouse over the chart, the <code>chartToolTip</code> method is called which in turn updates the map.
<pre><code>
private function chartToolTip(e:HitData) : String {
   var s:String;
   s = "'" + LineSeries(e.element).displayName + "\n";
   s += "Time: " + e.item.x + " decimal hours\n";
   s += "Elevation: " + e.item.y + " meters\n";
   s += "Latitude: " + e.item.lat + " degrees\n";
   s += "Longitude: " + e.item.lon + " degrees\n";
   var u:URLRequest = new URLRequest("javascript:centerMap('"
         + e.item.lat
         + "','"
         + e.item.lon + "')");
   navigateToURL(u,"_self");
   return s;
}</code></pre>
</li>
</ol>
<p>My Route Player is no where near complete yet, but now at least I have some of the answers on how I will use Flex and Google maps to create this player. The code for this player is <a href="http://note19.googlecode.com/svn/trunk/flex-map/">here</a>. See also this <a href="http://www.db75.com/blog/archives/000159.html">article</a> which may give you clues on how you could &#8220;embed&#8221; Google Map in a Flex control.</p>
<blockquote><p> You can also overlay a Flex control on top of DHTML based Google map. Click <a href="http://note19.com/2007/11/27/how-to-overlay-a-flex-control-on-google-maps/">here</a> for details. Here is an example of a <a href="http://javey.net/bike/map/player6/map.html?gpx=http://javey.net/bike/gpx/4-nov-2007.gpx&amp;title=Pebble.Beach.Trail&amp;resize=1">Flex overlay</a>.</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/291/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/291/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/291/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=291&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/15/elevation-chart-in-flex-with-google-maps/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/11/flex1.thumbnail.png" medium="image">
			<media:title type="html">Flex with Google</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Map route maker, geo coder</title>
		<link>http://note19.com/2007/11/08/google-map-route-maker-geo-location-finder/</link>
		<comments>http://note19.com/2007/11/08/google-map-route-maker-geo-location-finder/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 05:34:27 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Maps]]></category>

		<guid isPermaLink="false">http://note19.com/2007/11/08/google-map-route-maker-geo-location-finder/</guid>
		<description><![CDATA[A while back I was experimenting with Google Map APIs and created a simple page to allow you to create a route (by clicking on the map) and let me find out the longitude and latitude of an address. This is still very much a work in progress. Once the page loads click on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=285&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a title="Google Map" href="http://javey.net/ruutr/geocoder.html"><img class="alignleft" src="http://note19.files.wordpress.com/2007/11/gmap.thumbnail.png?w=450" alt="Google Map" /></a>A while back I was experimenting with Google Map APIs and created a simple page to allow you to create a route (by clicking on the map) and let me find out the longitude and latitude of an address. This is still very much a work in progress. Once the page loads click on the map to add a marker and you can undo a marker or move it around. To see how it is done just view the HTML source.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/285/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/285/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=285&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/11/08/google-map-route-maker-geo-location-finder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/11/gmap.thumbnail.png" medium="image">
			<media:title type="html">Google Map</media:title>
		</media:content>
	</item>
	</channel>
</rss>
