Hi guys,
I hav been trying to display google maps in the container
after the click of a button, but i m not able to get the proper
output.Here is the code,
CODE:
<?xml version="1.0"?>
<!-- events/SimpleEventHandler.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="initApp();">
<mx:Script><![CDATA[
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
private var gMap:Map;
private function init():void
{
gMap = new Map();
gMap.key =
"ABQIAAAAHK4Tb778RwSfNMdvrVFMBRTqD8KII8nGCHEOs63QpaP31mkaURSy_mXEpOcC2Tp0ljBYLfXrcijnZw";
gMap.width = 600;
gMap.height = 400;
/* gMap.addEventListener(MapEvent.MAP_READY, mapReadyHandler);*/
mapContainer.addChild(gMap);
}
private function initApp():void {
gMap.addEventListener(MouseEvent.CLICK, myEventHandler);
}
private function myEventHandler(event:Event):void {
gMap.map.setCenter(new LatLng(40.736072,-73.992062), 14,
MapType.NORMAL_MAP_TYPE);
}
]]></mx:Script>
<mx:Button id="b1" label="Click Me"/>
<mx:UIComponent id="mapContainer"
width="100%"
height="100%"
resize="mapContainer_resize(event);"/>
</mx:Application>
Plz help me out...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" 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/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---