0

I have two points which are marked dynamically on the map and when I mark the start point it is returning lon,lat, but I want to assign this coordinates to the variable that marked/handled the start symbol and a point. Ex:

measureControls={
              start: new OpenLayers.Control.DrawFeature(start, OpenLayers.Handler.Point),
              stop: new OpenLayers.Control.DrawFeature(stop, OpenLayers.Handler.Point),

for the same start and stop, I would like to add event 'click' and assign the point when clicked.

1
  • Please clarify more your question. I could not understand what you want. Your sample could looks like truncated.
    – cavila
    Jan 4, 2013 at 12:19

1 Answer 1

1

I think you are talking about click event feature enter code here

    function onFeatureSelect(evt) {
            
                          }
        
        
        var selectCtrl = new OpenLayers.Control.SelectFeature(yourlayername,
            {
            clickout: true, onSelect:onFeatureSelect }
                              );
        
        map.addControl(selectCtrl);
        selectCtrl.activate();
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.