Hi,
I'm using xml to draw polygons on a map. When the user clicks on a
polygon, an infowindow is supposed to show the name of the
neighborhood. The map is working fine and the polygons are overlaying
properly. But, I can't figure out how to get the info window caption
to work. Specifically, I don't know how to reference the neighborhood
name of the chosen polygon. I studied Pamela Fox's example "State
Map", but I'm stumped.
Please find below some abbreviated code.
My button with an id of "allHoodsToggle" calls the following function:
private function allEncodedPolygons(event:MouseEvent) : void {
var myPaneManager:IPaneManager = map.getPaneManager();
var myMapPane:IPane = myPaneManager.createPane();
if (allHoodsToggle.selected) {
for each (var node:XML in
detailMapResultData){
var
encodedData:EncodedPolylineData = new EncodedPolylineData
(node.encoding.toString(), node.zoomFactor.toString(),
node.level.toString(), node.numlevels.toString());
var encodedList:Array =
[encodedData];
var polyOptions:PolygonOptions
= new PolygonOptions ({
strokeStyle: {
thickness: 3,
color: 0x123456,
alpha: 0.5,
pixelHinting:
true
},
fillstyle: {
color: 0xff0080,
apha: 0.8}
});
var neighbShapes:Polygon =
Polygon.fromEncoded(encodedList,
polyOptions);
map.addOverlay(neighbShapes);
neighbShapes.addEventListener(MapMouseEvent.CLICK, function
(event:MapMouseEvent): void {
map.openInfoWindow(event.latLng, new InfoWindowOptions
({content: 'WHAT SHOULD I PUT HERE?'}));
});
allHoodsToggle.removeEventListener(MouseEvent.CLICK,
allEncodedPolygons)
}
}
else {myPaneManager.clearOverlays();
allHoodsToggle.removeEventListener(MouseEvent.CLICK,
allEncodedPolygons);}
}
Here's some abbreviated xml:
<group>
<neighborhood>
<name>West End</name>
<latitudeCenter>38.90699756549191</latitudeCenter>
<longitudeCenter>-77.05252647399902</longitudeCenter>
<encoding>}cmlftdium...@oayegcdkd}aeh_cybobibsdmigemifj??czl\bz?zi@</
encoding>
<level>p...@c@b...@feigp</level>
<zoomFactor>2</zoomFactor>
<numlevels>18</numlevels>
</neighborhood>
<neighborhood>
<name>Woodland</name>
<latitudeCenter>38.85605916398143</latitudeCenter>
<longitudeCenter>-76.97493553161621</longitudeCenter>
<encoding>m`dlF`kytMsLwMvFgJdLfMiFnJ</encoding>
<level>PFGFP</level>
<zoomFactor>2</zoomFactor>
<numlevels>18</numlevels>
</neighborhood>
</group>
How do I reference the xml neighborhood name of the selected
neighbShapes polygon? If you have any suggestions, please let me know.
Thank you!!!
-Chris
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---