Does the Marker Clusterer support custom icons? It seems to work fine
whenever I am not usual a custom icon for my markers. As soon as I add
in custom markers, I get an error when zooming in. I believe the error
is triggered when a marker is removed from a cluster but I cannot say
for sure since I am new to using marker clusterer.

The error I see is...

ArgumentError: Error #2025: The supplied DisplayObject must be a child
of the caller.
        at flash.display::DisplayObjectContainer/removeChild()
        at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::
$removeChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx
\core\UIComponent.as:5096]
        at mx.core::UIComponent/removeChild()[C:\autobuild\3.2.0\frameworks
\projects\framework\src\mx\core\UIComponent.as:5004]
        at com.google.maps.wrappers::SpriteFactory/removeChild()
        at com.google.maps.wrappers::ISpriteFactoryWrapper/removeChild()
        at com.google.maps.overlays::Pane/removeOverlay()
        at com.google.maps.overlays::Pane/addOverlay()
        at com.google.maps.wrappers::IPaneWrapper/addOverlay()
        at com.google.maps.extras.markerclusterer::Cluster/redraw()[C:
\SourceCode\Libs\GoogleMapsUtilities\src\com\google\maps\extras
\markerclusterer\Cluster.as:230]
        at com.google.maps.extras.markerclusterer::MarkerClusterer/redraw_()
[C:\SourceCode\Libs\GoogleMapsUtilities\src\com\google\maps\extras
\markerclusterer\MarkerClusterer.as:248]
        at com.google.maps.extras.markerclusterer::MarkerClusterer/
resetViewport()[C:\SourceCode\Libs\GoogleMapsUtilities\src\com\google
\maps\extras\markerclusterer\MarkerClusterer.as:360]
        at com.google.maps.extras.markerclusterer::MarkerClusterer/mapMoved()
[C:\SourceCode\Libs\GoogleMapsUtilities\src\com\google\maps\extras
\markerclusterer\MarkerClusterer.as:102]
        at <anonymous>()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks
\projects\framework\src\mx\core\UIComponent.as:9298]
        at com.google.maps.wrappers::BaseEventDispatcher/dispatchEvent()
        at com.google.maps.wrappers::EventDispatcherWrapper/dispatchEvent()
        at com.google.maps.core::MapImpl/finishContinuousZoom()
        at com.google.maps.core::MapImpl/doContinuousZoom()
        at com.google.maps.core::MapImpl/enterFrame()

*************
Snippets of my code
*************

[Embed( "../../../../../assets/Gnome-Stock-Person-32.png" )]
private static const userMapIconClass:Class;

public function updateMapMarkers():void
{
        var markers:Array = new Array();

        for ( var i:int = 0; i < model.users.length; i++ )
        {
                markers.push( createMarker( model.users[i] ) );
        }

        markerClusterer = new MarkerClusterer(map, markers);
}

private function createMarker( user:UserModel ):UnitMarker
{
        var icon:DisplayObject = DisplayObject( new userMapIconClass );

        var markerOptions:MarkerOptions = new MarkerOptions( { icon: icon,
iconAlignment: MarkerOptions.ALIGN_HORIZONTAL_CENTER |
MarkerOptions.ALIGN_VERTICAL_CENTER } );
        var marker:UnitMarker = new UnitMarker( new LatLng( user.latitude,
user.longitude ), markerOptions );

        return marker;
}

--

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