Closed drewmo closed 8 years ago
I found a solution to the problem. I decided to try using bindPopup in order to create a new popup, get the already assigned html, and inject new options for it to work.
Inside of my $on function I now have:
marker.leafletObject.bindPopup(marker.leafletObject.options.message, {closeButton: false, offset: [0, -40]});
marker.leafletObject.openPopup();
marker.leafletObject.options.message is the location of my already preset HTML set in my marker array in the message section. Hopefully this helps anyone else with the same issue.
@dremonkey thanks :+1:
So I have Markers that are already in an array which have messages added to them.
What I am trying to do is on mouseover I want to show the popup and on mouseout I want to close the popup, basically alleviating the popup flicker until you truly mouseout of the marker. I use this function to open the popup:
I am not sure how to add the offset option to the popup without having to rebind every marker I already have added to the map since I have structured divs in the popup. Here are the leaflet options: http://leafletjs.com/reference.html#popup-options I have already tried this without anything changing:
Do you think rebinding the message from the marker in the $on function is the only option?