You would get the properties of the marker in the MapMouseEvent Click
handler.
marker.addEventListener(MapMouseEvent.CLICK, MarkerClick);
private function MarkerClick(event:MapMouseEvent)
{
var marker = event.feature;
//now do what you want with the marker
}
As for you second question about how to get the address, you're
creating your marker based on an address with that last line of code
geocoder.geocode(testAddress); So if you want to reference that
address later, save it in some kind of a data structure. The slow way
would to do a reverse geocode on the lat, lng coords of the marker.
The way I would do it would create a new Class called CustomMarker
which inherits from Marker. Then put some extra information in there
like address or anything else you want to save along with that
marker. However, depending on your programming skills that may be too
daunting. To delete a marker with a button, in the click handler of
the button, just call map.removeOverlay(marker) where marker is the a
reference to one you want to remove. Again, you can save all your
markers in a data structure so you can reference them at any time.
Just a piece of advise, strip your event handlers into stand along
functions rather than defining them inline. Your code above is pretty
hard to read.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---