Closed MoritzLost closed 2 years ago
Definitely a regression bug. Good catch, thanks for reporting it!
I'll follow up with you via Discord DM to resolve this and #48.
@lindseydiloreto Thanks! I've tried the latest branch and it does fix the error message – but I still can't get the info window to show up. I've tried to show all info windows just to test if they're being created at all, but it looks like they aren't:
const marker = {
id: `marker-lat-lng-123,456`,
lat: 123,
lng: 456,
};
const infoWindowHtml = '<p>the title</p>';
map.markers(marker, {
infoWindowOptions: {
content: infoWindowHtml,
},
markerClick: () => map.openInfoWindow('*'),
})
This doesn't do anything. I've also put some logging inside dynamicmap.js
just to check, looks like this._infoWindows
is completely empty, even after calling the map.markers
with the infoWindowOptions
shown above. I've looked through the 4.1.1 branch again, in this version, the map.markers
function included some code to attach the info window. Those lines are gone in 4.1.5, so maybe the info windows aren't being attached at all?
This is now fixed in v4.1.6. Thanks again for reporting it! 👍
I'm trying to initialize an info window in JavaScript, but it's not working correctly. In 4.1.1, the following code worked fine (simplified to relevant parts):
While this doesn't cause any errors, the info window doesn't open when the marker is clicked. I tried to attach an event listener to open it manually using the
markerClick
option, at which point I get the following error message in the console:Indeed it looks like the
_markerClick
function doesn't exist anymore indynamicmap.js
. I checked the JS file in 4.1.1, which still includes the _markerClick function. Regression bug?In addition to this bug, what is the 'correct' way to attach simple info windows to markers in 4.1.5?