gabesmed/ember-leaflet — pull request #60 by edance (2014-06-21 19:25:29+00:00)
Title: Update popup.js

Thanks so much for adding the popupViewClass and great work on the whole repo itself. This has saved me a lot of time.

I have a question about the content in the PopupView. I would like the view to have the content of the individual marker, not the whole index controller. Here is my code...

```javascript
MarkersApp = Ember.Application.create();
MarkersApp.PopupView = Ember.View.extend({
// reference the location of the given marker
});

MarkersApp.MarkerLayer = EmberLeaflet.MarkerLayer.extend(
EmberLeaflet.PopupMixin, {
popupViewClass: "popup"});

MarkersApp.MarkerCollectionLayer =
EmberLeaflet.MarkerCollectionLayer.extend({
contentBinding: 'controller'});

MarkersApp.IndexView =
EmberLeaflet.MapView.extend({
childLayers: [
EmberLeaflet.DefaultTileLayer,
MarkersApp.MarkerCollectionLayer]});

MarkersApp.IndexController =
Ember.ArrayController.extend({
content: [
{location: L.latLng(40.714, -74.000)},
{location: L.latLng(40.714, -73.989)},
{location: L.latLng(40.721, -73.991)}]});
```

By changing this line, I now have access to the content of the individual marker. I don't know if this is the correct way to do it. It may break other use cases. Maybe it would be better to create an item controller for each marker and reference that controller. Any thoughts?

Thanks again for all your help!