GoogleMaps API for Flash – 3D表示できるMap3Dクラスを試してみました (AS3.0)
This movie requires Flash Player 9
GoogleMaps API for Flash にMap3D class が追加されたので早速試してみました。また、ライブラリの導入については公式サイトのチュートリアルに詳しく方法が書かれています。
上のFlashは以下のソースで表示しています。
import com.google.maps.LatLng; import com.google.maps.Map3D; import com.google.maps.MapEvent; import com.google.maps.MapMouseEvent; import com.google.maps.MapOptions; import com.google.maps.MapType; import com.google.maps.View; import com.google.maps.geom.Attitude; import com.google.maps.controls.*; var container:Sprite = new Sprite( ); addChild( container ); var map:Map3D = new Map3D( ); map.key = "API key"; map.setSize( new Point( stage.stageWidth, stage.stageHeight ) ); var mapOption:MapOptions = new MapOptions( ); mapOption.zoom = 17; mapOption.center = new LatLng( 34.984727, 135.756922 ); mapOption.viewMode = View.VIEWMODE_PERSPECTIVE; mapOption.attitude = new Attitude( 20, 30, 0 ); map.setInitOptions( mapOption ); container.addChild( map ); map.addEventListener( MapEvent.MAP_READY, function( event:Event ):void { map.setMapType( MapType.HYBRID_MAP_TYPE ); map.addControl( new MapTypeControl( ) ); map.addControl( new NavigationControl( ) ); } );
また、以下のポストを非常に参考にさせていただきました。
http://geoquake.jp/blog/2009/07/31/pv3dovergooglemaps/
http://uu-uu.com/blog/?p=874