maaash.jp

what I create

[as3][umap]PositionControlの位置を動かす

memo

UMapラッパー自前クラスのコンストラクタはこんな

[as]package {
// 省略
public class MyUMap extends UMap {
// 省略
st = s;
super();
setSize(st.stageWidth,st.stageHeight);
//setMapType(“hybrid”); // normal / satellite
setCenter(new LatLng(Params.MAP_INITIAL_CENTER_LAT,Params.MAP_INITIAL_CENTER_LNG), 2);

animatePan = true;
animateZoom = true;
panSpeed = 10;
enableScrollWheelZoom = false; // do this manually cause it zooms too much
//zoomAtPointer = true; // looks like its useful when enabledScrollWheelZoom==true
// define GoogleProvider with custom paths
var settings :URLRequest = new URLRequest(“http://www.afcomponents.com/components/g_map_as3/settings.xml?rand=” + Math.random());
var language :URLRequest = new URLRequest(“http://maps.google.com/maps?file=api&v=2″)
var copyright :URLRequest = new URLRequest(“http://www.afcomponents.com/proxy/g_map_as3/copyright.php”);
control.provider = new GoogleProvider(false, settings, language, copyright);

var pc :PositionControl = new PositionControl;
pc.autoRepeat = true;
//pc.y = 50; // ng
//pc.stackAlignment = PositionControl.RIGHT; // ng
//pc.stackAlignment = PositionControl.CENTER; // ng
//pc.stackPadding = new Point(100,100); // ボタンが離れる!
pc.offset = new Offset( 100, 100 ); // positioncontrolが左上から100,100に
//pc.align = new Align( Align.RIGHT, Align.TOP ); // this is also ok
pc.refresh();
addControl(pc);
addControl(new ZoomControl);
}
}[/as]

Comments