例−45:180度線をまたいでポリラインを描画する
180度線を越えてラインを描画するときの方法です。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:maps="com.google.maps.*" viewSourceURL="srcview/index.html">
<maps:Map key="[GoogleMapsAPIKey]"
width="100%" height="100%" sensor="false" mapevent_mapready="{onReady();}" id="map" />
<mx:Script>
<![CDATA[
import com.google.maps.overlays.Marker;
import com.google.maps.controls.ZoomControl;
import com.google.maps.LatLng;
import com.google.maps.overlays.Polyline;
import com.google.maps.overlays.PolylineOptions;
private function onReady():void{
this.map.setCenter(new LatLng(0, 180), 2);
this.map.addControl(new ZoomControl());
//points
var points : Array = new Array();
points.push(new LatLng(35.681382, 139.766084)); //Tokyo Japan
//points.push(new LatLng(40.756054, -73.986951)); //こうするとただしく描画されません
points.push(new LatLng(40.756054, -73.986951 + 360, true)); //N.Y. USA
//markers
this.map.addOverlay(new Marker(points[0]));
this.map.addOverlay(new Marker(points[1]));
//draw lines
var opts : PolylineOptions = new PolylineOptions({color : 0x0000FF, thickness : 5});
var line : Polyline = new Polyline(points, opts);
this.map.addOverlay(line);
}
]]>
</mx:Script>
</mx:Application>




