Matt-Jensen / ember-cli-g-maps

Deprecated Google Maps Addon
http://matt-jensen.github.io/ember-cli-g-maps
MIT License
59 stars 31 forks source link

marker is undefined #77

Closed OakBehringer closed 7 years ago

OakBehringer commented 7 years ago

In your documentation, it states that the click handler (for markers), receives the event and marker objects as arguments. Marker (second argument) is undefined.

Having the marker obj passed in would make it much easier to manipulate the marker on click (for example, changing the icon size to indicate it is highlighted).

BaasNiel commented 7 years ago

From what I can tell, the marker is returned here as the 1st argument, and the event is not returned.

You should be able to access the marker like this:

click: (marker) => { console.log(marker.id); }

OakBehringer commented 7 years ago

You're absolutely right. I must have been smoking crack. Sorry!

BaasNiel commented 7 years ago

I am not sure you should be closing the issue. Either the documentation should be updated to indicate that the event is not accessible, or the component should be updated to return the event, as indicated in the documentation.

I've tried to see where the event is defined but I'm still very new to Ember, so I got completely lost. If someone could point me in the right direction, I would gladly investigate further. Does it use Google Maps' click event, or is it defined somewhere in the component?

Matt-Jensen commented 7 years ago

It's okay to close this. It's a bug with a bower dependency used by this addon called gmaps-for-apps.

Matt-Jensen commented 7 years ago

Published fix, be sure to update gmaps-for-apps:

bower cache clean
rm -rf bower_components/gmaps-for-apps
bower install