none
problem with click event on different pushpins RRS feed

  • Question

  • Hello,

    following use case:

    there is an entity collection 'A' with pushpins and a click handler added to each pin, that call function 'DisplayInfobox'. Works fine, as expected. Now i add a second entity collection 'B' (i Need to Show and Hide the different layers and afaik this is the only way to handle this) with click handler, that call the same function. All ok.

    Now third collection 'C' with pushpins and click handler, but now the function is 'ShowInfo'. And if i try to click on a pin from layer 'A' or 'B' nothing happens.

    So why are 'A'- and 'B'-Pins losing their Event handler?

    Is there any work around? (Catch each click on the map, identify the clicked object, if 'pushpin', identify the parent collection and call the correct function)?

    Thanks for help

    Patric

    Wednesday, June 10, 2015 3:37 PM

Answers

  • They aren't losing their event handler. Either you have an error in your code, or something in one of your other layers is overtop the area you are trying to click. i.e. you can't click through blank space in an image.

    http://rbrundritt.wordpress.com

    Thursday, June 11, 2015 5:18 PM