Index: /lang/actionscript/swfgmap/trunk/gyuque/gmap/GMapView.as
===================================================================
--- /lang/actionscript/swfgmap/trunk/gyuque/gmap/GMapView.as (revision 2320)
+++ /lang/actionscript/swfgmap/trunk/gyuque/gmap/GMapView.as (revision 2320)
@@ -0,0 +1,118 @@
+package gyuque.gmap
+{
+	import flash.display.*;
+	import flash.text.TextField;
+	import flash.text.TextFormat;
+	import flash.events.MouseEvent;
+	
+	public class GMapView extends MovieClip
+	{
+		private var txDebugOut:TextField = null;
+		private var fmtDebugOut:TextFormat;
+		private var mDrag:DragInfo = new DragInfo();
+		private var mBaseSprite:Sprite;
+		
+		public function GMapView(options:*)
+		{
+			mBaseSprite = putBaseSprite();
+			if (options.initial_size)
+			{
+				clearBase(options.initial_size[0], options.initial_size[1]);
+				
+			}
+
+			if (options.debug_box)
+			{
+				txDebugOut = new TextField();
+				addChild(txDebugOut);
+				
+				txDebugOut.selectable = false;
+				fmtDebugOut = new TextFormat();
+				fmtDebugOut.size = 9;
+				txDebugOut.height = height;
+			}
+			
+			hookStdEvents();
+		}
+		
+		protected function putBaseSprite():Sprite
+		{
+			var s:Sprite = new Sprite();
+			addChild(s);
+			
+			return s;
+		}
+		
+		protected function clearBase(w:int, h:int):void
+		{
+			var g:Graphics = mBaseSprite.graphics;
+			g.beginFill(0xe5e0d5);
+			g.drawRect(0,0, w, h);
+			g.endFill();
+		}
+		
+		protected function hookStdEvents():void
+		{
+			 addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
+			 addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
+			 addEventListener(MouseEvent.MOUSE_UP  , onMouseUp);
+		}
+		
+		protected function onMouseMove(e:MouseEvent):void
+		{
+			if (mDrag.dragging)
+			{
+				mDrag.update(e.localX, e.localY);
+				
+				puts(mDrag.dx.toString()+","+mDrag.dy.toString());
+			}
+		}
+		
+		protected function onMouseDown(e:MouseEvent):void
+		{
+			mDrag.dragging = true;
+			mDrag.update(e.localX, e.localY);
+		}
+		
+		protected function onMouseUp(e:MouseEvent):void
+		{
+			mDrag.dragging = false;
+		}
+		
+		public function puts(s:String):void
+		{
+			if (!txDebugOut)
+				return;
+			
+			txDebugOut.appendText(s);
+			txDebugOut.appendText("\r\n");
+			txDebugOut.setTextFormat(fmtDebugOut);
+		}
+		
+		public function d_outMetrics():void
+		{
+			puts("w: "+ width.toString());
+			puts("h: "+ height.toString());
+		}
+	}
+}
+
+class DragInfo
+{
+	public function DragInfo (){dragging=false;}
+	public var prevX:Number;
+	public var prevY:Number;
+	public var dx:Number;
+	public var dy:Number;
+	public var dragging:Boolean;
+	
+	public function update(x:Number, y:Number):void
+	{
+		dx = x - prevX;
+		dy = y - prevY;
+		
+		prevX = x;
+		prevY = y;
+	}
+}
+
Index: /lang/actionscript/swfgmap/trunk/TestApp-config.xml
===================================================================
--- /lang/actionscript/swfgmap/trunk/TestApp-config.xml (revision 2320)
+++ /lang/actionscript/swfgmap/trunk/TestApp-config.xml (revision 2320)
@@ -0,0 +1,3 @@
+<flex-config>
+<default-frame-rate>30</default-frame-rate>
+</flex-config>
Index: /lang/actionscript/swfgmap/trunk/TestApp.as
===================================================================
--- /lang/actionscript/swfgmap/trunk/TestApp.as (revision 2320)
+++ /lang/actionscript/swfgmap/trunk/TestApp.as (revision 2320)
@@ -0,0 +1,18 @@
+package
+{
+	import flash.display.*;
+	import gyuque.gmap.*;
+	
+	public class TestApp extends GMapView
+	{
+		public function TestApp()
+		{
+			super({
+					debug_box   : true,
+					initial_size: [640, 480]
+				});
+			
+			d_outMetrics();
+		}
+	}
+}
Index: /lang/actionscript/swfgmap/trunk/testapp.html
===================================================================
--- /lang/actionscript/swfgmap/trunk/testapp.html (revision 2320)
+++ /lang/actionscript/swfgmap/trunk/testapp.html (revision 2320)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
+	<head>
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+		<title>TestApp</title>
+	</head>
+	<body>
+		<div>
+			<object data="TestApp.swf" type="application/x-shockwave-flash" width="640" height="480">
+				<param name="movie" value="TestApp.swf" />
+				<p>Install Flash Player 9</p>
+			</object>
+		</div>
+	</body>
+</html>
