cartodb-4.42/lib/assets/javascripts/new-dashboard/components/Backbone/Dialogs/DuplicateMap.vue

42 lines
1.0 KiB
Vue
Raw Normal View History

2024-04-06 13:25:13 +08:00
<template>
<div class="Dialog-content Dialog-content--expanded" ref="injectionHTMLElement"></div>
</template>
<script>
import DuplicateMap from 'dashboard/views/dashboard/dialogs/duplicate-vis/duplicate-vis-view';
import VisualizationModel from 'dashboard/data/visualization-model';
export default {
name: 'DuplicateMap',
props: {
visualization: Object
},
mounted () {
this.dialog = this.renderDialog();
},
beforeDestroy () {
this.dialog.clean();
},
methods: {
renderDialog () {
const configModel = this.$cartoModels.config;
const visDefinitionModel = new VisualizationModel(this.$props.visualization, { configModel });
const table = visDefinitionModel.tableMetadata();
const duplicateMapView = new DuplicateMap({
model: visDefinitionModel,
table,
configModel,
userModel: this.$cartoModels.user,
el: this.$refs.injectionHTMLElement,
clean_on_hide: true
});
duplicateMapView.render();
return duplicateMapView;
}
}
};
</script>