<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Using Google Maps in a Flex project</title>
	<atom:link href="http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Fri, 19 Mar 2010 20:35:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jay</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-6353</link>
		<dc:creator>Jay</dc:creator>
		<pubDate>Fri, 13 Nov 2009 23:48:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-6353</guid>
		<description>Hey guys, I keep getting an error when init geocoder.  I am trying to create a .as file and in that I have to following code

...
private var geocoder:ClientGeocoder;
..
..
public function setMap():void{
  geocoder = new ClientGeocoder();
  gc.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, geocoder_geocodingSuccess);
  gc.addEventListener(GeocodingEvent.GEOCODING_FAILURE, geocoder_geocodingFailure);
  gc.reverseGeocode(new LatLng(lat,lon));
}
..
..

but I keep getting an error 

TypeError: Error #1009: Cannot access a property or method of a null object reference.

when i say geocoder = new ClientGeocoder();

Any Ideas?? I have even tried 

geocoder = new ClientGeocoder(new ClientGeocoderOptions(.....)); 

but the result is the same.  I am using map_flex_1_17.swc.

Thank you
Jaysheel</description>
		<content:encoded><![CDATA[<p>Hey guys, I keep getting an error when init geocoder.  I am trying to create a .as file and in that I have to following code</p>
<p>&#8230;<br />
private var geocoder:ClientGeocoder;<br />
..<br />
..<br />
public function setMap():void{<br />
  geocoder = new ClientGeocoder();<br />
  gc.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, geocoder_geocodingSuccess);<br />
  gc.addEventListener(GeocodingEvent.GEOCODING_FAILURE, geocoder_geocodingFailure);<br />
  gc.reverseGeocode(new LatLng(lat,lon));<br />
}<br />
..<br />
..</p>
<p>but I keep getting an error </p>
<p>TypeError: Error #1009: Cannot access a property or method of a null object reference.</p>
<p>when i say geocoder = new ClientGeocoder();</p>
<p>Any Ideas?? I have even tried </p>
<p>geocoder = new ClientGeocoder(new ClientGeocoderOptions(&#8230;..)); </p>
<p>but the result is the same.  I am using map_flex_1_17.swc.</p>
<p>Thank you<br />
Jaysheel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naso</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-6022</link>
		<dc:creator>Naso</dc:creator>
		<pubDate>Thu, 15 Oct 2009 01:00:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-6022</guid>
		<description>Great example Peter!

Guys, I have an issue and I would appreciate it if somebody could help me.

As advised, I got an API Key, I downloaded the API, I copied the example source and everything worked nicely both locally and from a designated domain. Next morning, when I resumed working, however, the map would load but the geocoding would return the error:

&quot;Unable to geocode address: ...&quot;

I get this effect again locally and from the respective domain. I also noticed that the example in this page returns absolutely the same error message, although it was working nicely yesterday.

Does anyone know what causes the issue?

Thanks!

Naso.</description>
		<content:encoded><![CDATA[<p>Great example Peter!</p>
<p>Guys, I have an issue and I would appreciate it if somebody could help me.</p>
<p>As advised, I got an API Key, I downloaded the API, I copied the example source and everything worked nicely both locally and from a designated domain. Next morning, when I resumed working, however, the map would load but the geocoding would return the error:</p>
<p>&#8220;Unable to geocode address: &#8230;&#8221;</p>
<p>I get this effect again locally and from the respective domain. I also noticed that the example in this page returns absolutely the same error message, although it was working nicely yesterday.</p>
<p>Does anyone know what causes the issue?</p>
<p>Thanks!</p>
<p>Naso.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry Mustafa</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-6005</link>
		<dc:creator>Henry Mustafa</dc:creator>
		<pubDate>Mon, 12 Oct 2009 22:22:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-6005</guid>
		<description>Yes,
I am using Flex 3 Builder... I pasted my key to the appId.txt and uploaded my the main.swf to my server. I get an &quot;Init failed error.  Please check swf location. &quot;It runs locally in Flex builder (debug mode). When I applied for the key it said it would work on all sub domain????? I want to include google maps with others api&#039;s (ie papervisions,youtube..etc)..So can you compile the google maps swf and then load it????
My root domain is
www.ihearyah.com 
and the sub domain is
www.besttennis.org
Help!

Sincerely,
Henry Mustafa</description>
		<content:encoded><![CDATA[<p>Yes,<br />
I am using Flex 3 Builder&#8230; I pasted my key to the appId.txt and uploaded my the main.swf to my server. I get an &#8220;Init failed error.  Please check swf location. &#8220;It runs locally in Flex builder (debug mode). When I applied for the key it said it would work on all sub domain????? I want to include google maps with others api&#8217;s (ie papervisions,youtube..etc)..So can you compile the google maps swf and then load it????<br />
My root domain is<br />
<a href="http://www.ihearyah.com" rel="nofollow">http://www.ihearyah.com</a><br />
and the sub domain is<br />
<a href="http://www.besttennis.org" rel="nofollow">http://www.besttennis.org</a><br />
Help!</p>
<p>Sincerely,<br />
Henry Mustafa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oliver merx</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-5943</link>
		<dc:creator>oliver merx</dc:creator>
		<pubDate>Tue, 06 Oct 2009 20:03:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-5943</guid>
		<description>Hello, 
I had exactly the same problem ... here are my results:

It seems that there is some information left in the cache after the initial loading so whenever you load google maps a second time into the same holder it will come to a crash.

What I did was to set a rootvariable with the initial loadingprocess to true. This helps to avoid to fire three critical commands a second time:

googleMap.addControl
googleMap.addControl
googleMap.setSize

Because setSize crashes too I resize the holder arround the Map (eg. Canvas or Box).

This workaround works fine for me now - yep!

Regards

Oliver

btw: Thanks a lot for this great blog!!!!

####################################
&lt;pre lang=&quot;actionscript3&quot;&gt;
private function init():void{

    googleMap = new Map();
    googleMap.key = &quot;xyz&quot;

    googleMap.addEventListener( MapMoveEvent.MOVE_END, moveEnd );
    googleMap.addEventListener( MapZoomEvent.ZOOM_END, zoomEnd );
    googleMap.addEventListener( MapEvent.MAPTYPE_CHANGED, mapTypes );
    if( !parentApplication.googleMapReady ){
        googleMap.addControl( new ZoomControl() );// causes Error on reload!
        googleMap.addControl( new MapTypeControl() );// causes Error on reload!
    }
    else{
        parentApplication.googleMapRead = true;
    }
    googleMap.addEventListener( MapEvent.MAP_READY, googleMap_mapReady );
    if( !parentApplication.googleMapReady ){
        googleMap.setSize( new Point( mapContainer.width, mapContainer.height) );// causes Error on reload
    }
    else{
        this.width += 0.001;
        this.height += 0.001;
        this.validateNow();
    }

    mapContainer.addChild( googleMap );
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hello,<br />
I had exactly the same problem &#8230; here are my results:</p>
<p>It seems that there is some information left in the cache after the initial loading so whenever you load google maps a second time into the same holder it will come to a crash.</p>
<p>What I did was to set a rootvariable with the initial loadingprocess to true. This helps to avoid to fire three critical commands a second time:</p>
<p>googleMap.addControl<br />
googleMap.addControl<br />
googleMap.setSize</p>
<p>Because setSize crashes too I resize the holder arround the Map (eg. Canvas or Box).</p>
<p>This workaround works fine for me now &#8211; yep!</p>
<p>Regards</p>
<p>Oliver</p>
<p>btw: Thanks a lot for this great blog!!!!</p>
<p>####################################</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><span style="color: #000000;">&#123;</span>
&nbsp;
    googleMap = <span style="color: #0033ff; font-weight: bold;">new</span> Map<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    googleMap.key = <span style="color: #990000;">&quot;xyz&quot;</span>
&nbsp;
    googleMap.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> MapMoveEvent.MOVE_END, moveEnd <span style="color: #000000;">&#41;</span>;
    googleMap.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> MapZoomEvent.ZOOM_END, zoomEnd <span style="color: #000000;">&#41;</span>;
    googleMap.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> MapEvent.MAPTYPE_CHANGED, mapTypes <span style="color: #000000;">&#41;</span>;
    <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight: bold;">!</span>parentApplication.googleMapReady <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
        googleMap.addControl<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> ZoomControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<span style="color: #009900;">// causes Error on reload!</span>
        googleMap.addControl<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> MapTypeControl<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<span style="color: #009900;">// causes Error on reload!</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #0033ff; font-weight: bold;">else</span><span style="color: #000000;">&#123;</span>
        parentApplication.googleMapRead = <span style="color: #0033ff; font-weight: bold;">true</span>;
    <span style="color: #000000;">&#125;</span>
    googleMap.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span> MapEvent.MAP_READY, googleMap_mapReady <span style="color: #000000;">&#41;</span>;
    <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000; font-weight: bold;">!</span>parentApplication.googleMapReady <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
        googleMap.setSize<span style="color: #000000;">&#40;</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Point</span><span style="color: #000000;">&#40;</span> mapContainer.<span style="color: #004993;">width</span>, mapContainer.<span style="color: #004993;">height</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<span style="color: #009900;">// causes Error on reload</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #0033ff; font-weight: bold;">else</span><span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">width</span> <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">0.001</span>;
        <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">height</span> <span style="color: #000000; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">0.001</span>;
        <span style="color: #0033ff; font-weight: bold;">this</span>.validateNow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #000000;">&#125;</span>
&nbsp;
    mapContainer.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span> googleMap <span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-5861</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 24 Sep 2009 23:24:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-5861</guid>
		<description>Has anyone had a problem with a viewStack and the google map API? My view stack has 3 views, the transitions work fine until the view with the google map in it loads, then im stuck on that view, my only way to solve this problem was to call the unload function to unload the google map then the transitions worked fine. I dont like doing that since whenever they go back to that view the map has to reload all over again. Anyone seen this problem and have a better solution. I tried making the map object not visible that did nto fix the problem either.</description>
		<content:encoded><![CDATA[<p>Has anyone had a problem with a viewStack and the google map API? My view stack has 3 views, the transitions work fine until the view with the google map in it loads, then im stuck on that view, my only way to solve this problem was to call the unload function to unload the google map then the transitions worked fine. I dont like doing that since whenever they go back to that view the map has to reload all over again. Anyone seen this problem and have a better solution. I tried making the map object not visible that did nto fix the problem either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Othman</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-5660</link>
		<dc:creator>Othman</dc:creator>
		<pubDate>Thu, 10 Sep 2009 00:01:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-5660</guid>
		<description>Hey there,

I got the same issue... Did you find a fix for it please?

Tnkx,

Othman</description>
		<content:encoded><![CDATA[<p>Hey there,</p>
<p>I got the same issue&#8230; Did you find a fix for it please?</p>
<p>Tnkx,</p>
<p>Othman</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn Yale</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-4494</link>
		<dc:creator>Shawn Yale</dc:creator>
		<pubDate>Wed, 08 Jul 2009 21:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-4494</guid>
		<description>Great example Matt.</description>
		<content:encoded><![CDATA[<p>Great example Matt.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-4338</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Sun, 28 Jun 2009 10:29:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-4338</guid>
		<description>I found the solution and for noobs like me I have some tips:

1. Make sure the google file swc is attached to the project via:
Project/properties/flex build path/library path/add swc
2. put the appid.txt (including your own google key) file on the webserver in folder src
3. put the google file swc on the webserver in the folder libs

this made it work for me. Thanks for this great code, you are the best!

cheers Don</description>
		<content:encoded><![CDATA[<p>I found the solution and for noobs like me I have some tips:</p>
<p>1. Make sure the google file swc is attached to the project via:<br />
Project/properties/flex build path/library path/add swc<br />
2. put the appid.txt (including your own google key) file on the webserver in folder src<br />
3. put the google file swc on the webserver in the folder libs</p>
<p>this made it work for me. Thanks for this great code, you are the best!</p>
<p>cheers Don</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-4337</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Sat, 27 Jun 2009 23:22:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-4337</guid>
		<description>location of this:   mx:String id=&quot;APP_ID&quot; source=&quot;appid.txt&quot;</description>
		<content:encoded><![CDATA[<p>location of this:   mx:String id=&#8221;APP_ID&#8221; source=&#8221;appid.txt&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/comment-page-1/#comment-4336</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Sat, 27 Jun 2009 23:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexexamples.com/2008/08/03/using-google-maps-in-a-flex-project/#comment-4336</guid>
		<description>plse help,

ok I did everything above,
When I try the swf locally and click the button I get:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at myfolder/button_click()
	at myfolder/__button_click()

When I try the swf after uploading to the webserver, I see the google white box, the address i put in and the button, plus a blank screen below (where the map should be). Pushing the button does nothing. Should this map_flex_1_5.swc file also be on the webserver?
How do i get the map to work? plse help!!!

ps. I had to change the location of this:

totally upward right below mx.application because during debugging it would give me error.

noob needs help :(</description>
		<content:encoded><![CDATA[<p>plse help,</p>
<p>ok I did everything above,<br />
When I try the swf locally and click the button I get:</p>
<p>TypeError: Error #1009: Cannot access a property or method of a null object reference.<br />
	at myfolder/button_click()<br />
	at myfolder/__button_click()</p>
<p>When I try the swf after uploading to the webserver, I see the google white box, the address i put in and the button, plus a blank screen below (where the map should be). Pushing the button does nothing. Should this map_flex_1_5.swc file also be on the webserver?<br />
How do i get the map to work? plse help!!!</p>
<p>ps. I had to change the location of this:</p>
<p>totally upward right below mx.application because during debugging it would give me error.</p>
<p>noob needs help :(</p>
]]></content:encoded>
	</item>
</channel>
</rss>
