gabesmed / ember-leaflet

Ember + Leaflet = Fun with maps
gabesmed.github.io/ember-leaflet
MIT License
164 stars 35 forks source link

Setting options for MarkerCollectionLayer #117

Open mjanda opened 9 years ago

mjanda commented 9 years ago

I'm thinking how to set options on markers belonging to collectionlayer.

One way is to set options key on content and change layers/marker.js

options: null,

to

options: Ember.computed.alias('content.options'),

Not sure if that won't break something else, so far I'm just thinking out loud here.

Other way would be to do it in collection.js / objectWasAdded() - do something like

var childLayer = this.createChildLayer(get(this, 'itemLayerClass'), {
content: obj,
options: obj.options
});

but that seems hacky. But doing it this way would easily allow having global options on collection itself and optionally overriding them on some markers.

Any ideas before I'll put together PR?