From 2c17242e09ce99f82d128f24abadb6e377788022 Mon Sep 17 00:00:00 2001 From: jlpereira Date: Tue, 18 Apr 2023 15:21:31 -0300 Subject: [PATCH 1/3] Refactor geojson options --- src/components/Map/VMap.global.vue | 2 +- src/components/Map/icons/AssertedDistribution.js | 5 ++--- src/components/Map/icons/CollectionObject.js | 6 ++---- src/components/Map/icons/Georeference.js | 6 ++---- src/components/Map/icons/TypeMaterial.js | 6 ++---- src/components/Map/utils/geojsonOptions.js | 9 ++++++--- .../Panel/PanelNomenclature/PanelNomenclature.vue | 10 ++++++++++ 7 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/components/Map/VMap.global.vue b/src/components/Map/VMap.global.vue index 886668d..4a09878 100644 --- a/src/components/Map/VMap.global.vue +++ b/src/components/Map/VMap.global.vue @@ -258,7 +258,7 @@ onUnmounted(() => { function setGeoJSON(geojson) { if (geojson) { L.geoJSON(geojson, { - ...geojsonDefaultOptions, + ...geojsonDefaultOptions(L), ...props.geojsonOptions }).addTo(geoJSONGroup) diff --git a/src/components/Map/icons/AssertedDistribution.js b/src/components/Map/icons/AssertedDistribution.js index f3bc761..77c351a 100644 --- a/src/components/Map/icons/AssertedDistribution.js +++ b/src/components/Map/icons/AssertedDistribution.js @@ -1,7 +1,6 @@ import L from 'leaflet' - -export const AssertedDistribution = L.divIcon({ +export const AssertedDistribution = { className: 'bg-map-asserted bg-opacity-50 rounded-full', iconSize: [8, 8], iconAnchor: [4, 4] -}) +} diff --git a/src/components/Map/icons/CollectionObject.js b/src/components/Map/icons/CollectionObject.js index 462814f..e6ade65 100644 --- a/src/components/Map/icons/CollectionObject.js +++ b/src/components/Map/icons/CollectionObject.js @@ -1,7 +1,5 @@ -import L from 'leaflet' - -export const CollectionObject = L.divIcon({ +export const CollectionObject = { className: 'bg-map-collection-object bg-opacity-50 rounded-full', iconSize: [8, 8], iconAnchor: [4, 4] -}) +} diff --git a/src/components/Map/icons/Georeference.js b/src/components/Map/icons/Georeference.js index 75ab09e..c41015f 100644 --- a/src/components/Map/icons/Georeference.js +++ b/src/components/Map/icons/Georeference.js @@ -1,7 +1,5 @@ -import L from 'leaflet' - -export const Georeference = L.divIcon({ +export const Georeference = { className: 'bg-map-georeference bg-opacity-50 rounded-full', iconSize: [8, 8], iconAnchor: [4, 4] -}) +} diff --git a/src/components/Map/icons/TypeMaterial.js b/src/components/Map/icons/TypeMaterial.js index ca5d9cb..a5d6162 100644 --- a/src/components/Map/icons/TypeMaterial.js +++ b/src/components/Map/icons/TypeMaterial.js @@ -1,7 +1,5 @@ -import L from 'leaflet' - -export const TypeMaterial = L.divIcon({ +export const TypeMaterial = { className: 'bg-map-type-material bg-opacity-50 rounded-full', iconSize: [8, 8], iconAnchor: [4, 4] -}) +} diff --git a/src/components/Map/utils/geojsonOptions.js b/src/components/Map/utils/geojsonOptions.js index 55c5b75..d5d5a26 100644 --- a/src/components/Map/utils/geojsonOptions.js +++ b/src/components/Map/utils/geojsonOptions.js @@ -25,7 +25,7 @@ function getRelevantType(base) { return types[0] } -export default { +export default (L) => ({ onEachFeature: (feature, layer) => { const label = `
@@ -53,7 +53,10 @@ export default { pointToLayer: (feature, latLng) => { const type = getRelevantType(feature.properties.base) - const marker = L.marker(latLng, { icon: Icons[type] || Icon.Georeference }) + const markerStyle = Icons[type] || Icon.Georeference + const marker = L.marker(latLng, { + icon: L.divIcon(markerStyle) + }) marker.pm.setOptions(DEFAULT_OPTIONS) @@ -67,4 +70,4 @@ export default { return Shape[type] } } -} +}) diff --git a/src/modules/otus/components/Panel/PanelNomenclature/PanelNomenclature.vue b/src/modules/otus/components/Panel/PanelNomenclature/PanelNomenclature.vue index 69d73f8..89a6e80 100644 --- a/src/modules/otus/components/Panel/PanelNomenclature/PanelNomenclature.vue +++ b/src/modules/otus/components/Panel/PanelNomenclature/PanelNomenclature.vue @@ -18,6 +18,16 @@ const props = defineProps({ taxonId: { type: [Number, String], required: true + }, + + taxon: { + type: Object, + default: undefined + }, + + otu: { + type: Object, + default: undefined } }) From 42780f450b0c2f97e652f0ff496b70e4d75cbe48 Mon Sep 17 00:00:00 2001 From: jlpereira Date: Tue, 18 Apr 2023 16:16:17 -0300 Subject: [PATCH 2/3] Fix mobile menu button --- src/components/Navbar/NavbarMobile.vue | 40 +++++++++----------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/src/components/Navbar/NavbarMobile.vue b/src/components/Navbar/NavbarMobile.vue index 3a6214c..7002ac9 100644 --- a/src/components/Navbar/NavbarMobile.vue +++ b/src/components/Navbar/NavbarMobile.vue @@ -1,40 +1,23 @@