You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 10, 2023. It is now read-only.
Thanks for writing this directive.
My question is about adding a click event to custom markers, where the array of markers gets attached to the gl-markers attribute.
I am able to do similar inside an angularjs controller using the "element" property of the markers api.
My concerns here are:
(1) Is there a different or recommended way of adding a click event using your plugin? (It seems the answer here is "no").
(2) If I have a function in the angular controller to add an event listener to each marker,
do I have to worry about somehow destroying these event listeners in the angular controller's $destroy event? If yes, then how best to remove the listeners added to the custom markers?
function createElementForDivMarker(m_marker, m_index) {
var el = document.createElement('div');
el.id = "marker-" + m_index;
el.className = 'marker marker-' + m_marker.properties.map_marker_class;
el.addEventListener('click', function(e) {
console.log(m_marker.properties);
});
return el;
}