The mapReady event is called after the map has completed initialization.
You do not need to do anything here. At this point the only thing displayed
is a big map of the United States.
However I usually do something like the following in the mapReady event:
public function setupMap( ):void {
this.initMapTypeControl()
this.initZoomControl()
this.googleM.addEventListener("placemarkClicked",placemarkClicked);
}
All this method is doing is setting up the look and feel of the map control
objects.
At this point your map is waiting for something to happen. The user clicks
a button and you would execute something like this:
Typical geocoding code then takes place.
public function startGeoCoding(infoDataO:Object):void {
this.mapDetailO = infoDataO;
geoAddress = infoDataO.address + " " + infoDataO.city + " " +
infoDataO.state
geocoder = new ClientGeocoder();
geocoder.addEventListener(GeocodingEvent.GEOCODING_SUCCESS,
geocoderSuccess);
geocoder.addEventListener(GeocodingEvent.GEOCODING_FAILURE,
geocoderFailure);
geocoder.geocode(geoAddress);
}
private function geocoderSuccess(evt:GeocodingEvent):void {
pm = GeocodingResponse(evt.response).placemarks[0];
createStandardMarker(pm);
googleM.setCenter(pm.point, zoomAmt, MapType.NORMAL_MAP_TYPE);
geocoder.removeEventListener(GeocodingEvent.GEOCODING_SUCCESS,
geocoderSuccess);
geocoder.removeEventListener(GeocodingEvent.GEOCODING_FAILURE,
geocoderFailure);
}
private function geocoderFailure(evt:GeocodingEvent):void {
this.dispatchEvent(new
Event(GeocodingEvent.GEOCODING_FAILURE,true));
}
--
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.