I am trying to place a button inside the Openlayers popup. As long as the button is displayed correctly, with the following code, the "handlerFunc" function is not executed when the button is pressed. The code segment that I posted is within the same function (therefore handlerFunc is actually a nested function). I use jQuery for the button itself. Any ideas on what could go wrong? Thanks!
var feature = new OpenLayers.Feature(presences, ll); feature.popupClass = popupClass; feature.data.popupContentHTML = "<button id='popupButton'>Click me</button>"; feature.data.overflow = (overflow) ? "auto" : "hidden"; feature.data.icon = markerIcon; $('#popupButton').button(); $('#popupButton').click(handlerFunc); function handlerFunc() {
source share