cartodb-4.42/lib/assets/javascripts/builder/embed/style-collection.js
2024-04-06 05:25:13 +00: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});
}
});