The Google Maps script is worth looking.

Source: Internet
Author: User

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 >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.