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
-~----------~----~----~----~------~----~------~--~---