[OpenLayers-Trac] Re: [OpenLayers] #3578: Need a way to get the coordinates of the click on vector features/layers

OpenLayers trac-20090302 at openlayers.org
Tue Nov 22 18:13:13 EST 2011


#3578: Need a way to get the coordinates of the click on vector features/layers
------------------------------------+---------------------------------------
  Reporter:  vishcious              |       Owner:  tschaub     
      Type:  feature                |      Status:  reopened    
  Priority:  minor                  |   Milestone:  2.12 Release
 Component:  Control.SelectFeature  |     Version:  2.11        
Resolution:                         |    Keywords:              
     State:  Review                 |  
------------------------------------+---------------------------------------

Comment(by jorix):

 Replying to [comment:6 ahocevar]:
 > Solution here: https://github.com/openlayers/openlayers/pull/67 - no
 need to set {{{OpenLayers.Events.prototype.includeXY = true}}}.

 I was working on extending your patch to work with hover+highlightOnly and
 I have seen that there is a hidden bug.

 Why?: If you add the listener {{{beforefeatureselected}}}, the event
 {{{featureselected}}} has {{{evt.type ="beforefeatureselected"}}}. See:
 [http://trac.osgeo.org/openlayers/browser/trunk/openlayers/lib/OpenLayers/Events.js#L753
 Events.js - Line 753 in triggerEvent method]

 See the problem with this change [attachment:3578-bug-more-test.patch 3578
 -bug-more-test.patch]. then the test {{{"featureselected: evt.type is
 proper set."}}} fails (Without pull/67 this test works)

 Note: In this case it is not what is the best way to present the problem,
 a pull requesst in ahocevar/openlayers?

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3578#comment:7>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list