mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 15:36:28 +00:00
map fixes
This commit is contained in:
@@ -546,14 +546,14 @@
|
|||||||
showModal(ErrorMessageModal, { message: 'There is nothing to be shown on map' });
|
showModal(ErrorMessageModal, { message: 'There is nothing to be shown on map' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
openNewTab({
|
openNewTab(
|
||||||
|
{
|
||||||
title: 'Map',
|
title: 'Map',
|
||||||
icon: 'img map',
|
icon: 'img map',
|
||||||
tabComponent: 'MapTab',
|
tabComponent: 'MapTab',
|
||||||
props: {
|
|
||||||
selection,
|
|
||||||
},
|
},
|
||||||
});
|
{ editor: selection.map(x => _.omit(x, ['engine'])) }
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script lang="ts" context="module">
|
<script lang="ts" context="module">
|
||||||
export function selectionCouldBeShownOnMap(selection) {
|
export function selectionCouldBeShownOnMap(selection) {
|
||||||
console.log('selection', selection);
|
|
||||||
if (selection.length > 0 && _.find(selection, x => isWktGeometry(x.value))) {
|
if (selection.length > 0 && _.find(selection, x => isWktGeometry(x.value))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -39,6 +38,7 @@
|
|||||||
let geoJson;
|
let geoJson;
|
||||||
|
|
||||||
function createColumnsTable(cells) {
|
function createColumnsTable(cells) {
|
||||||
|
if (cells.length == 0) return '';
|
||||||
return `<table>${cells.map(cell => `<tr><td>${cell.column}</td><td>${cell.value}</td></tr>`).join('\n')}</table>`;
|
return `<table>${cells.map(cell => `<tr><td>${cell.column}</td><td>${cell.value}</td></tr>`).join('\n')}</table>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,14 +164,14 @@
|
|||||||
{
|
{
|
||||||
text: 'Open on new tab',
|
text: 'Open on new tab',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
openNewTab({
|
openNewTab(
|
||||||
|
{
|
||||||
title: 'Map',
|
title: 'Map',
|
||||||
icon: 'img map',
|
icon: 'img map',
|
||||||
tabComponent: 'MapTab',
|
tabComponent: 'MapTab',
|
||||||
props: {
|
|
||||||
selection,
|
|
||||||
},
|
},
|
||||||
});
|
{ editor: selection.map(x => _.omit(x, ['engine'])) }
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,19 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import MapView from '../elements/MapView.svelte';
|
import MapView from '../elements/MapView.svelte';
|
||||||
|
|
||||||
export let selection;
|
import useEditorData from '../query/useEditorData';
|
||||||
|
|
||||||
|
export let tabid;
|
||||||
|
let selection;
|
||||||
|
|
||||||
|
useEditorData({
|
||||||
|
tabid,
|
||||||
|
onInitialData: value => {
|
||||||
|
selection = value;
|
||||||
|
},
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{#if selection}
|
||||||
<MapView {selection} />
|
<MapView {selection} />
|
||||||
<MapView {selection} />
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user