Excellent,  thanks Pamela,  I tried exactly that and adding the
map.closeInfoWindow seems to work :o).

I think there may also be some bugs in the country location for ISO
country codes listed on the country site.   When I use
geocoder.setBaseCountryCode(countryiso) for some of the countries it
still doesn't work and I have to play with the text string.   E.g.
doing the below seems to get me to the correct country for these.


if(StringUtil.trim(countryiso) == "TW"){
                        country = "TAIWAN" ;
                }
                if(StringUtil.trim(country) == "HOLY SEE (VATICAN CITY STATE)"){
                        country = "VATICAN CITY";
                }
                if(StringUtil.trim(country) == "VATICAN CITY STATE"){
                        country = "VATICAN CITY";
                }
                if(StringUtil.trim(country) == "LAO PEOPLE'S DEMOCRATIC
REPUBLIC"){
                        country = "LAO";
                }
                if(StringUtil.trim(country) == "SYRIAN ARAB REPUBLIC"){
                        country = "SYRIA";
                }
                if(StringUtil.trim(country) == "KOREA, DEMOCRATIC PEOPLE'S
REPUBLIC OF"){
                        country = "NORTH KOREA";
                }
                if(StringUtil.trim(country) == "KOREA, REPUBLIC OF"){
                        country = "SOUTH KOREA";
                }
                if(StringUtil.trim(country) == "MIDDLE EAST"){
                        country = "SOUDI ARABIA" ;
                }
                if(StringUtil.trim(country) == "WORLD"){
                        country = "ROMANIA" ;
                }
                if(StringUtil.trim(country) == "PALESTINIAN TERRITORY,
OCCUPIED"){
                        country = "WEST BANK PALESTINE" ;
                        //countryiso = "WEST BANK PALESTINE" ;
                }
                if(StringUtil.trim(country) == "IRAN, ISLAMIC REPUBLIC OF"){
                        country = "IRAN";
                }
                if(StringUtil.trim(country) == "MACEDONIA, THE FORMER YUGOSLAV
REPUBLIC OF"){
                        country = "MACEDONIA";
                }
                if(StringUtil.trim(country) == "MICRONESIA, FEDERATED STATES 
OF")
{
                        country = "MICRONESIA";
                }

                if(StringUtil.trim(country) == "MOLDOVA, REPUBLIC OF"){
                        country = "MOLDOVA";
                }

On Oct 11, 7:59 am, "pamela (Google Employee)" <[EMAIL PROTECTED]>
wrote:
> Hi jackdee-
>
> It sounds like it may be a bug on our end. What happens if you call
> map.closeInfoWindow() before you call clearOverlays? Does the error
> still occur? Does it only occur if you do a search without closing an
> info window first?
>
> - pamela
>
> On Sat, Oct 11, 2008 at 12:54 PM, jackdee <[EMAIL PROTECTED]> wrote:
>
> > I'm using flex to interact with google maps.
>
> > I've created a map and I allow users to search for a location.  I
> > then allow them to look for markers within a particular distance of
> > this location.  The map zooms to an appropriate level to show all
> > these markers.
> > When you click on any of the markers an infowindow opens and shows
> > some details.
>
> > Users can then search for a new location and then see markers within a
> > particular distance again etc.
>
> > After clicking, zooming and pulling up new locations I get an
> > intermittent problem of
>
> > TypeError: Error #1009: Cannot access a property or method of a null
> > object reference.
> >       at com.google.maps.core::MapImpl/closeInfoWindow()
> >       at com.google.maps.core::MapImpl/openInfoWindow()
> >       at com.google.maps.overlays::Marker/openInfoWindow()
> >       at com.google.maps.wrappers::IMarkerWrapper/openInfoWindow()
>
> > My create marker code is
>
> >       public function createMarkermap(currentLocation:Object,
> > number:int,
> > type:String):void {
> >               var opts:MarkerOptions = new MarkerOptions({
> >                       strokeStyle: new StrokeStyle({color:
> > 0x987654}),
> >                       fillStyle: new FillStyle({color: 0x3399FF,
> > alpha: 0.8}),
> >                       radius: 12,
> >                       hasShadow: true
> >                       });
> >               opts.label = String(number);
> >               var marker:Marker = new Marker(new
> > LatLng(currentLocation.latitude, currentLocation.longitude),opts);
> >               marker.addEventListener(MapMouseEvent.CLICK,
> > function(e:Event):void {
> >               marker.openInfoWindow(new
> > InfoWindowOptions({contentHTML:
> > "<b>" + "MAP" + "</b><br/>" + currentLocation.shorttitle + "</b><br/>"
> > + Math.round(currentLocation.distance) + " " + type + " from current
> > location"}));
> >               });
>
> >               map.addOverlay(marker);
> >       }
>
> > Whenever I look for a new location or new markers I clear all overlays
> > and start again passing new marker objects to the createmarkermap
> > function.   I've no idea why i get this problem.   However I have a
> > sneaking feeling it's something to do with the zoom.  It happens more
> > often after the map has changed it's zoom.
>
> > Any ideas ??
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to