Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
216 views
in Technique[技术] by (71.8m points)

javascript - What events are available for google.maps.data.addListener?

I'm using:

mydatalayer.addListener('click', function(event) { ... });
mydatalayer.addListener('addfeature', function(event) { ... });

without problems.

Now I'm trying to use:

mydatalayer.addListener('dragend', function(event) { ... });

but event listener is not fired, although the selected polygon on that layer is correctly dragged on the screen.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The events available on a Google Maps Javascript API v3 Data Layer are listed in the Google Maps Javascript API v3 documentation

Events

  • addfeature | Arguments: Data.AddFeatureEvent - This event is fired when a feature is added to the collection.
  • click | Arguments: Data.MouseEvent - This event is fired for a click on the geometry.
  • dblclick | Arguments: Data.MouseEvent - This event is fired for a double click on the geometry.
  • mousedown | Arguments: Data.MouseEvent- This event is fired for a mousedown on the geometry.
  • mouseout | Arguments: Data.MouseEvent - This event is fired when the mouse leaves the area of the geometry.
  • mouseover | Arguments: Data.MouseEvent - This event is fired when the mouse enters the area of the geometry.
  • mouseup | Arguments: Data.MouseEvent - This event is fired for a mouseup on the geometry.
  • removefeature | Arguments: Data.RemoveFeatureEvent - This event is fired when a feature is removed from the collection.
  • removeproperty | Arguments: Data.RemovePropertyEvent - This event is fired when a feature's property is removed.
  • rightclick | Arguments: Data.MouseEvent - This event is fired for a rightclick on the geometry.
  • setgeometry | Arguments: Data.SetGeometryEvent - This event is fired when a feature's geometry is set.
  • setproperty | Arguments: Data.SetPropertyEvent - This event is fired when a feature's property is set.

As you can see, dragend is not listed at the current time.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...