Closed oskarrough closed 9 years ago
See just above the example, there: you can define the target, and the action you'll define will receive that target. Anyway by default the target is the view where you defined the googleEvents
property, so to access the marker's model, you can use Ember's controller
property of the view:
theActionNameYouDefined: function(target) {
var marker = target.get('controller.model'); // here is the clicked marker's record/object
//...
}
Also see the example here.
Thanks so much!
Hi, I followed your example https://github.com/huafu/ember-google-map/wiki/Provided-Tools-and-Classes-%28API%29#example-use-case-responding-to-events and now I can trigger an action when you click a marker.
How can I pass, say, the marker title with the event?
Usecase: I have a list of locations on the left and a map on the right. When you tap a marker, I need to scroll to the corresponding list-item for that marker.