cartodb/lib/assets/javascripts/builder/embed/style-collection.js
2020-06-15 10:58:47 +08:00

22 lines
448 B
JavaScript

var Backbone = require('backbone');
module.exports = Backbone.Collection.extend({
model: function (d, opts) {
var attrs = {};
attrs.id = d.id;
if (d.options.tile_style) {
attrs.cartocss = d.options.tile_style;
}
return new Backbone.Model(attrs);
},
resetByLayersData: function (data) {
this.reset(data, {
silent: true
});
},
findById: function (id) {
return this.findWhere({id: id});
}
});