Browse Source

change classes in geodata column type

pull/4749/head
flisowna 2 years ago
parent
commit
0f21027a80
  1. 13
      packages/nc-gui/components/cell/GeoData.vue
  2. 5
      packages/nc-gui/components/smartsheet/Map.vue

13
packages/nc-gui/components/cell/GeoData.vue

@ -106,7 +106,7 @@ const onClickSetCurrentLocation = () => {
/>
</a-form-item>
<a-form-item>
<div style="display: flex; align-items: center; margin-right: 0.5rem">
<div class="flex set-location-group">
<MdiReload v-if="isLoading" :class="{ 'animate-infinite animate-spin text-gray-500': isLoading }" />
<a-button class="ml-2" @click="onClickSetCurrentLocation">{{ $t('labels.yourLocation') }}</a-button>
</div>
@ -125,15 +125,17 @@ input[type='number']:focus {
@apply ring-transparent;
}
.input-lat {
input[type='number'] {
width: 180px;
}
.input-lat {
margin-top: 1rem;
margin-bottom: 0.5rem;
margin-right: 0.5rem;
margin-left: 0.5rem;
}
.input-lng {
width: 180px;
margin-right: 0.5rem;
margin-left: 0.5rem;
}
@ -149,4 +151,9 @@ input[type='number']:focus {
height: fit-content;
align-items: flex-end;
}
.set-location-group {
align-items: center;
margin-right: 0.5rem;
}
</style>

5
packages/nc-gui/components/smartsheet/Map.vue

@ -3,9 +3,8 @@ import 'leaflet/dist/leaflet.css'
import L, { LatLng } from 'leaflet'
import 'leaflet.markercluster'
import { ViewTypes } from 'nocodb-sdk'
import { OpenNewRecordFormHookInj, onMounted, provide, ref } from '#imports'
import { OpenNewRecordFormHookInj, latLongToJoinedString, onMounted, provide, ref } from '#imports'
import type { Row as RowType } from '~/lib'
import { latLongToJoinedString } from '~~/utils/geoDataUtils'
const route = useRoute()
@ -130,6 +129,7 @@ onMounted(async () => {
})
},
})
myMap.addLayer(markersClusterGroupRef.value)
myMap.on('zoomend', function () {
@ -137,6 +137,7 @@ onMounted(async () => {
localStorage.setItem(getMapZoomLocalStorageKey(mapMetaData.value.fk_view_id), myMap.getZoom().toString())
}
})
myMap.on('moveend', function () {
if (localStorage != null && mapMetaData?.value?.fk_view_id) {
localStorage.setItem(getMapCenterLocalStorageKey(mapMetaData?.value?.fk_view_id), JSON.stringify(myMap.getCenter()))

Loading…
Cancel
Save