Ok. But I don't know: how can I send response with mouse click...

------------------------------------------------------
import mx.controls.Alert;
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapMouseEvent;
import com.google.maps.MapZoomEvent;
import com.google.maps.MapType;
import com.google.maps.controls.ZoomControl;
import com.google.maps.controls.MapTypeControl;
import com.google.maps.InfoWindowOptions;
import com.google.maps.services.GeocodingEvent;
import com.google.maps.services.ClientGeocoder;
import com.google.maps.services.GeocodingResponse;
import com.google.maps.services.Placemark;

private var map:Map;

private function onMapReady(event:Event):void {
        map.enableScrollWheelZoom();
        map.enableContinuousZoom();
        map.setCenter(new LatLng(37.773527, 29.086490), 9,
MapType.HYBRID_MAP_TYPE);
        map.addEventListener(MapMouseEvent.CLICK, onMapClick);
}

public function onHolderCreated(event:Event):void {
        map = new Map();
        map.language = "en";
        map.key = "key";
        map.addEventListener(MapEvent.MAP_READY, onMapReady);
        mapHolder.addChild(map);
}


public function onHolderResized(event:Event):void {
        map.setSize(new Point(mapHolder.width, mapHolder.height));
}

private function onMapClick(event:MapMouseEvent):void{
        map.setCenter( event.latLng, map.getZoom() ,
MapType.HYBRID_MAP_TYPE);
        var geocoder:ClientGeocoder = new ClientGeocoder();
        geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS,
                function(e:GeocodingEvent):void {
                        var placemarks:Array = e.response.placemarks;
                        map.openInfoWindow(event.latLng, new InfoWindowOptions( 
{ title:
"Address Information :", content: placemarks[0].address }));
                }
        );
}
------------------------------------------------------

--

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