cartodb/lib/assets/javascripts/builder/editor/layers/layer-views/background-image-layer-view.js

21 lines
619 B
JavaScript
Raw Normal View History

2020-06-15 10:58:47 +08:00
var _ = require('underscore');
var BaseLayerViewBase = require('./base-layer-view-base');
var template = require('./image-thumbnail-layer.tpl');
module.exports = BaseLayerViewBase.extend({
_getCompiledTemplate: function () {
return template({
title: this._getImageFileName(),
desc: _t('editor.layers.image.title-label'),
imgURL: this.model.get('image')
});
},
_getImageFileName: function () {
var imageURL = this.model.get('image');
var fileNameWithParameters = _.last(imageURL.split('/'));
var fileName = fileNameWithParameters.split('?')[0];
return fileName;
}
});