I\'m trying to find a way to get the DOM element of a marker. It seems that Google uses different elements for showing a marker and one of handling the event.
I\'ve
I found a really really bad workaround. One can use the title attribute to pass a id property.
fixMarkerId = function () {
$('div[title^="mtg_"]').each(function (index, elem) {
el = $(elem);
el.attr('id', el.attr('title'));
el.removeAttr('title');
});
},
tryAgainFixMarkerId = function () {
if ($('div[title^="mtg_"]').length) {
fixMarkerId();
} else {
setTimeout(function () {
tryAgainFixMarkerId();
}, 100);
};
}
if ($('div[title^="mtg_"]').length) {
fixMarkerId();
} else {
setTimeout(function () {
tryAgainFixMarkerId();
}, 100);
};
I would strongly not recommend this solution for any production environment. But for now I use it so that I can keep developing. But still looking for a better solution.