private var _yahooMap:YahooMap; private var _address:Address; private function onCreationComplete():void { var appid:String = Application.application.parameters.appid;
_yahooMap = new YahooMap(); _yahooMap.addEventListener(YahooMapEvent.MAP_INITIALIZE, handleMapInitialize); _yahooMap.init(appid,mapContainer.width,mapContainer.height);
private function handleMapInitialize(event:YahooMapEvent):void { // Tu dodajemy isntrukcje wykonywane po zainicjalizowaniu mapy, // np. wyszukiwanie i dodawanie punktów na mapie
_address = new Address("warszawa"); _address.addEventListener(GeocoderEvent.GEOCODER_SUCCESS, onGeocodeSuccess); _address.geocode(); }
private function onGeocodeSuccess(event:GeocoderEvent):void { var result:GeocoderResult = _address.geocoderResultSet.firstResult;
private function onMapContainerResize(event:ResizeEvent):void { _yahooMap.setSize(mapContainer.width,mapContainer.height); } ]]>
Listing 2. Modyfikacja funkcji onGeocodeSuccess() private function onGeocodeSuccess(event:GeocoderEvent):void { var result:GeocoderResult = _address.geocoderResultSet.firstResult;
[Embed("Marker.swf", symbol="MarkerRed")] public class FlashMarker extends MovieClip { public function FlashMarker() { super(); }
} }
Listing 5. Modyfikacja funkcji onGeocodeSuccess private function onGeocodeSuccess (event:GeocoderEvent):void { var result:GeocoderResult = _address.geocoderResultSet.firstResult;