OpenLayers - add click event on ol.Overlay
问题 I want to add click event to ol.Overlay in OpenLayers. What would be the best way to do this? Reason for using ol.Overlay: I want to add a custom marker with image and text that could be changed dynamically. For this, I am using ol.Overlay to add HTML in element as follows: // Add markers var marker = new ol.Overlay({ position: ol.proj.fromLonLat(lng1, lat1), positioning: 'center-center', element: $(getMarkerContent()) }); map.addOverlay(marker); function getMarkerContent() { var content = "