Skip to content

Commit

Permalink
Enable zoom and dragging when shapes are not present
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Mar 28, 2023
1 parent 3954fa0 commit f8c3210
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/components/Gallery/GalleryMainImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

<script setup>
import { ref, onMounted, onUnmounted, watch } from 'vue'
import VSpinnerGlobal from '../VSpinner.global.vue'
const props = defineProps({
image: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Map/VMap.global.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ function setGeoJSON(geojson) {
if (geojson) {
L.geoJSON(geojson, {
...geojsonDefaultOptions,
...props.geojsonOptions
...props.geojsonOptions,
pmIgnore: true
}).addTo(geoJSONGroup)
const bounds = geoJSONGroup.getBounds()
Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/VTable.global.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="shadow-md relative sm:rounded-lg">
<div class="relative sm:rounded-lg">
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
<slot />
</table>
Expand Down
3 changes: 1 addition & 2 deletions src/modules/otus/components/Panel/PanelMap/PanelMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
dragging
:zoom="zoom"
:geojson="geojson"
@geojson:ready="isLoading = false"
@geojson:ready="() => (isLoading = false)"
/>

<VButton
Expand Down Expand Up @@ -51,7 +51,6 @@
</template>

<script setup>
import { Georeference } from '@/components/Map/icons'
import { ref, watch } from 'vue'
import TaxonWorks from '../../../services/TaxonWorks'
import OtuSearch from '../../Search/OtuSearch.vue'
Expand Down
9 changes: 6 additions & 3 deletions src/modules/otus/components/Search/ListResults.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<template>
<VTable v-if="list.length">
<VTable
v-if="list.length"
class="shadow-md"
>
<VTableHeader>
<VTableHeaderRow>
<VTableHeaderCell
class="w-full flex justify-between box-border items-center"
>
<span>OTU</span>
<IconClose
class="opacity-30 cursor-pointer"
<IconArrowRight
class="opacity-50 cursor-pointer w-4 h-4"
@click="emit('close:table')"
/>
</VTableHeaderCell>
Expand Down
7 changes: 4 additions & 3 deletions src/modules/otus/components/Search/OtuSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
ref="mapRef"
class="w-screen h-screen"
controls
disable-zoom
:dragging="!shapes"
:disable-zoom="!!shapes"
:zoom-bounds="6"
:geojson="shapes"
@draw:start="() => (geojson = {})"
Expand Down Expand Up @@ -44,7 +45,7 @@
</template>

<script setup>
import { ref, onMounted, onUnmounted, watch } from 'vue'
import { ref, onMounted, onUnmounted } from 'vue'
import { makeAPIRequest } from '@/utils/request'
import SearchBar from './SearchBar.vue'
import ListResults from './ListResults.vue'
Expand All @@ -57,7 +58,7 @@ const props = defineProps({
shapes: {
type: Object,
default: () => ({})
default: undefined
}
})
Expand Down
5 changes: 0 additions & 5 deletions src/modules/otus/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
</div>
</div>
</div>
<OtuSearch
v-if="isOtuSearchVisible"
@close="() => (isOtuSearchVisible = false)"
/>
</template>

<script setup>
Expand All @@ -74,7 +70,6 @@ const route = useRoute()
const router = useRouter()
const routeParams = ref(route.params)
const tabs = [] // useChildrenRoutes()
const isOtuSearchVisible = ref(false)
router.afterEach((route) => {
routeParams.value = route.params
Expand Down

0 comments on commit f8c3210

Please sign in to comment.