Skip to content

Commit

Permalink
Remove pm event
Browse files Browse the repository at this point in the history
  • Loading branch information
jlpereira committed Mar 28, 2023
1 parent cd00192 commit d36ad9c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 29 deletions.
10 changes: 0 additions & 10 deletions src/components/Map/VMap.global.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,11 @@ onMounted(() => {
emit('add:layer', convertGeoJSONWithPointRadius(e.layer))
})
/* drawnItems.on('pm:change', (e) => {
emit('geojson', getDrawItemsInGeoJson())
emit('edit:layer', convertGeoJSONWithPointRadius(e.layer))
}) */
drawnItems.on('pm:edit', (e) => {
emit('geojson', getDrawItemsInGeoJson())
emit('edit:layer', convertGeoJSONWithPointRadius(e.layer))
})
drawnItems.on('pm:drag', (e) => {
emit('geojson', getDrawItemsInGeoJson())
emit('drag:layer', convertGeoJSONWithPointRadius(e.layer))
})
mapObject.on('pm:drawstart', (e) => {
clearDrawLayers()
emit('draw:start', e)
Expand Down
17 changes: 5 additions & 12 deletions src/modules/otus/components/Search/OtuSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<VSpinner v-if="isLoading" />
<SearchBar
:label="otu.object_tag"
@search="loadOTUs"
@close="() => emit('close')"
/>
<div class="relative">
Expand All @@ -18,10 +17,9 @@
:disable-zoom="!!shapes"
:zoom-bounds="6"
:geojson="shapes"
@add:layer="setLayer"
@edit:layer="setLayer"
@drag:layer="setLayer"
@draw:start="() => (geojson = {})"
@add:layer="(layer) => loadOTUs(JSON.stringify(layer.geometry))"
@edit:layer="(layer) => loadOTUs(JSON.stringify(layer.geometry))"
@drag:layer="(layer) => loadOTUs(JSON.stringify(layer.geometry))"
:zoom="4"
/>
<div
Expand Down Expand Up @@ -62,7 +60,6 @@ const props = defineProps({
const root = ref()
const emit = defineEmits(['close'])
const geoJson = ref({})
const mapRef = ref(null)
const list = ref([])
const isTableVisible = ref(false)
Expand All @@ -86,13 +83,9 @@ const handleKeyboard = ({ key }) => {
}
}
function setLayer(geojsonLayer) {
geoJson.value = JSON.stringify(geojsonLayer.geometry)
}
function loadOTUs() {
function loadOTUs(geojson) {
const payload = {
geo_json: geoJson.value,
geo_json: geojson,
taxon_name_id: [props.otu.taxon_name_id],
descendants: true
}
Expand Down
8 changes: 1 addition & 7 deletions src/modules/otus/components/Search/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
class="bottom-0 w-screen bg-base-foreground z-[1000] left-0 p-4 text-sm flex flex-row justify-between align-middle box-border border-b border-base-muted"
>
<div>
<VButton
primary
@click="() => emit('search')"
>
Search
</VButton>
<span
class="ml-2"
v-html="label"
Expand All @@ -22,7 +16,7 @@
</template>

<script setup>
const emit = defineEmits(['search', 'close'])
const emit = defineEmits(['close'])
const props = defineProps({
label: {
Expand Down

0 comments on commit d36ad9c

Please sign in to comment.