Sorry this is a pretty specific question, was hoping people who use Google Maps regularly would known here. I thought about posting to Stack Overflow but I was trying not to get crucified.

I have been searching and searching, this top question here doesn’t seem to be accurate anymore.

I’m not trying to display a window or anything, I think that part is still possible. What I’m trying to tell is what marker I clicked on so I can take action outside of the map eg. render something else related to that map icon.

But try as I might, can’t seem to get any properties to show up inside the marker click event listener.

I’m not sure if it matters that I’ve got my methods inside of a class. But when I console log the marker it outputs an object like _.Xm {latLng: _.L, tb: MouseEvent, pixel: _.I, ab: undefined}

But nothing I put in there shows up eg. an id

When I create the marker I can pass in a title/that shows up on hover.

My code is very basic

ahhh formatting, this code is inside a method of a class

Post image

Source link

Write A Comment