The most important object in Google maps should be gmapsapplication. Its definition uses the Javascript object-oriented design method.
VaR A = Z. Prototype;
W ("gmapsapplication", Z );
P (Z, "getmap", A. N );
Function W (a, B) {window [a] = B}
Function p (A, B, C) {A. Prototype [B] = c}
Z. Prototype. n = function () {return this.}
W function puts the object in the window attribute and can define a name for an object;
The P function adds a method alias to the object through ptototype.
With these, you can use
VaR A = new gmapsapplication (E ("map "));
Instantiate gmapsapplication like instantiating a javascript built-in object.
It's really convenient to use. I feel that C # programming and Script Programming are brought closer together.
I also wrote a test case myself:
< Script >
Window [ " Hello " ] = AA;
Function AA ()
{
This . X = 5 ;
This . Y = 6 ;
This . Test = Function ()
{< br> alert (A + " , " + This . x + " , " + This . y);
}
}
VaR Xx = New Hello ();
XX. Test ( " Bb " );
</ Script >