0

Map here: http://tinyurl.com/potjxlu

I can click an orange icon, popup appears, hit the X button to exit out of the popup.That is OK.

But if I want to bring that popup again for the same point, I have to click it twice, not once.

Also, sometimes the X button in the popup becomes disabled. It's not a consistent error so not sure what's going on there.

Looking at the OL docs for SelectFeature, I thought highlightOnly may be the solution but it is not.

The current code for my select feature control:

var selector = new OpenLayers.Control.SelectFeature([wfs, vectors_origin, vectors_destination], {
            clickout: false,
            toggle: true,
            hover: false,
            autoActivate:true
    });

Any input on how to achieve my desired functionality is appreciated.

Edit: If I just use the default vectors (the little orange circles), what's basically happening is:

-I'll click the orange circle, the orange circle becomes highlighted with a dark purple: the popup now appears.

-The popup has an X button. I click this to exit out and that aspect works.

-Now at this point: the orange circle is still highlighted the dark purple: in other words it is still selected.

-So what happens is I have to click WITHIN the orange circle (currently highlighted dark purple) to UNSELECT it. Now that dark purple has turned back to the initial orange.

-Now I can click it again and the popup should appear correctly: which it does.

-So how do I skip this middle step? Note that my issue is only for points that you want to click again: if I click the Austin, TX feature then the Los Angeles, CA feature, there are no issues with the popups. But I basically want to cut out this middle deselection step as it seems unncessary for what I want to achieve.

1

Please check out JsFiddle actually the trick is to unselect feature when user clicks close (red button on popup) to close information popup.

i hope it will help.

  • Fantastic, I was missing this selectControl.unselect(feature) . Line 50 from the fiddle. Thank you for your reply. – Nubtacular Dec 3 '13 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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