package
{
import com.adobe.viewsource.ViewSource;
import com.yahoo.maps.api.YahooMap;
import com.yahoo.maps.api.YahooMapEvent;
import com.yahoo.maps.api.core.location.LatLon;
import com.yahoo.maps.api.overlays.PolylineOverlay;
import flash.display.Sprite;
public class YahooMap_GeodesicPolylines extends Sprite
{
private var _yahooMap:YahooMap;
public function YahooMap_GeodesicPolylines()
{
ViewSource.addMenuItem(this, "srcview/index.html", true);
this.stage.align = "topLeft";
this.stage.scaleMode = "noScale";
var appid:String = this.loaderInfo.parameters.appid;
_yahooMap = new YahooMap();
_yahooMap.addEventListener(YahooMapEvent.MAP_INITIALIZE, handleMapInitialize, false, 0, true);
_yahooMap.init(appid, stage.stageWidth, stage.stageHeight);
_yahooMap.addPanControl();
_yahooMap.addZoomWidget();
_yahooMap.addTypeWidget();
this.addChild(_yahooMap);
}
private function handleMapInitialize(event:YahooMapEvent):void
{
_yahooMap.zoomLevel = 14;
_yahooMap.centerLatLon = new LatLon(45.828,-105.292);
var poly:PolylineOverlay = new PolylineOverlay(0x333333, 0.8, 5, true); _yahooMap.overlayManager.addOverlay(poly);
poly.geodesicElements = 20; poly.dataProvider = [new LatLon(33.945500, -118.400100), new LatLon(40.644600, -73.794800), new LatLon(47.448000,-122.298000) ];
}
}
}