Hi again, In the same way as the last post, is there any way to get the position of the feature which has been clicked? If there was a way to find it, then I could find the nearest point in the linestring, and work with that point..
I need to find the "clicked" point of a linestring, and on another place I need to know which vertex of a linestring has been dragged.. Thanks! 2010/11/12 JuKiM <[email protected]> > Hi list, > > I would like to know if there is a simple way to find the modified item of > a vector... > > By now, I have a layer > > lyr1 = new OpenLayers.Layer.Vector(''); > lyr1.events.on({ > "beforefeaturemodified": report, > "featuremodified": report, > "afterfeaturemodified": report, > "vertexmodified": report, > "sketchmodified": report, > "sketchstarted": report, > "sketchcomplete": report > }); > (While testing I have all the events..) > > In wich I draw a line.. > > var line = new OpenLayers.Geometry.LineString(points); > var lineFeature = new OpenLayers.Feature.Vector(line, { type: "LN" }, > def_style); > lyr1.addFeatures([lineFeature]); > > And I add a modify control > > m_control = new OpenLayers.Control.ModifyFeature(lyr1, > {virtualStyle:v_Style}); > map.addControl(m_control); > m_control.activate(); > > But, when an event gets fired, I can't find the vertex of the line which > has been dragged.. I'm a little lost with that.. > > Can anyone point me in the right direction? > > Thanks a lot! >
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
