Hello All,

I am facing an issue when creating markers in a flex app. They are
plotted in a right way, but when I click in any one of them I get
always the last marker data. On the example below I am trying to alert
the tooltip for an specific marker when clicked.

Thanks a lot,

Gines

                       private function onResult(e:ResultEvent):void
                       {
                               var m:Marker;
                               var options:MarkerOptions;

                               map.setCenter(new LatLng
(-15.623036831528251, -49.5703125), 4,
MapType.PHYSICAL_MAP_TYPE);
                               list = e.result.map.loc;
                               for(var i:int=0; i<list.length; i++)
                               {
                                               options = new
MarkerOptions();
                                               var stroke:StrokeStyle
= new StrokeStyle({color: 0x300000 });
                                               var fill:FillStyle =
new FillStyle({color: 0xFF0000, alpha:
0.8});
                                               options.label = "";
                                               options.radius = 8;
                                               options.tooltip = list
[i].name;
                                               options.hasShadow =
true;
                                               options.strokeStyle =
stroke;
                                               options.fillStyle =
fill;
                                               options.gravity = 0.5;
                                               var position:LatLng =
new LatLng(list[i].lat, list[i].lon);
                                               m = new Marker
(position, options);
                                               m.addEventListener
(MapMouseEvent.CLICK, function
(event:MapMouseEvent):void {
                                               map.setCenter(new LatLng
(event.latLng.lat
(),event.latLng.lng()), 14, MapType.NORMAL_MAP_TYPE);
                                                       Alert.show
(m.getOptions().tooltip);
                                               });


                                       map.addOverlay(m);

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