none
Push Pin Click Events RRS feed

  • Question

  • This is a common example provided by Bing Team  (see below).

    When I use this I never get the infobox to show up because e.target.metadata is not included.   After the pin is created the metadata is set and the event handler for the click is added.  Which is included in the example.

    I have a for loop that adds a dozen pins to a layer, but the click events for each pin is not working as expected.  

    What am I missing here and why/how to get the event data?

     function pushpinClicked(e) {
            //Make sure the infobox has metadata to display.
            if (e.target.metadata) {
                //Set the infobox options with the metadata of the pushpin.
                infobox.setOptions({
                    location: e.target.getLocation(),
                    title: e.target.metadata.title,
                    description: e.target.metadata.description,
                    visible: true
                });
            }

    Sunday, August 12, 2018 7:17 PM

All replies