Google Maps API entry: gevent namespace Introduction

Source: Internet
Author: User
From: http://hi.baidu.com/xfm_zhr/blog/item/eed0c7dc6e58e4a6cc116629.html

1.Gevent namespace

How to add event listening

 

Gevent. addlistener (source, event, Handler );

Add event listening for googlemaps objects.

Sourse: the object to be monitored.

Event: the event to be monitored.

Handler: Event Response Function.

For details about events of the googlemaps object, refer to the Google documentation.

Gevent. adddomlistener (sourse, envent, Handler );

Add event listening for common DOM objects.

Sourse: DOM object.

Envent: events supported by DOM objects.

Handler: Event Response Processing Method.

Example:

VaR nomap = Document. getelementbyid ("nomap ");

Gevent. adddomlistener (nomap, "click", function ()

{

Alert (nomap. innertext );

});

 

Remove event listening

Gevent. removelistener (handler );

Removes the specified event listener.

Handler: Listener corresponding to the added listener.

Gevent. clearlisteners (sourse, event );

Removes all listeners from an object event.

Sourse: Response object. Googlemaps object or DOM object.

Event: the monitored event.

Gevent. clearinstancelisteners (sourse );

All event listeners of the specified object are clear.

Sourse: clears the object of the event listener.

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.