Hi,
what you can do is to create a class that extends Marker, like
class MyMarker extends Marker { }
and add some attributes in it like this :
class MyMarker extends Marker {
public var list : Array;
}
and then you can do :
var m : MyMarker = new MyMarker(latLng);
m.list = [value1, value2, value3].
m.addEventListener(MapMouseEvent.CLICK, _mClickHandler);
private function mClickHandler(e : MapMouseEvent) : void {
var list : Array = (e.currentTarget as MyMarker).list;
}
I think this should work,
Good luck,
Florian
On Apr 29, 2:42 am, jord3t <[email protected]> wrote:
> I needed to pass several custom variables to my marker so i could use
> them in a function when the marker is clicked.
>
> The marker options are limited so I gave the marker icon a name of
> comma separated values which I then use as an array when it's clicked
> like:
>
> var nameVar = "value1,value2,value3";
> markerOptions.icon.name = nameVar;
> marker.addEventListener(MapMouseEvent.CLICK, markerClickEvent);
>
> public static function markerClickEvent(event:MapMouseEvent):void
> {
> marker = event.target;
> var MarkerAR:Array = marker.getOptions().icon.name.toString
> ().toLowerCase().split(",");
> Variable1 = MarkerAR[0];
> Variable2 = MarkerAR[1];
> Variable3 = MarkerAR[2];
>
> }
>
> I'm not sure if this is the best way to do it but it works well for
> me.
>
> anyone else have a different way of doing it?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---