cartodb-4.42/lib/assets/javascripts/builder/embed/style-collection.js

22 lines
448 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
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});
}
});