@@ -76,15 +76,13 @@ export default defineComponent({
7676
7777 const toggleVectorFeatureSearch = () => {
7878 if (MapStore .mapLayerVectorSearchable .value .length ) {
79- MapStore .mapLayerSearchableEnabled .value = ! MapStore .mapLayerSearchableEnabled .value ;
8079 MapStore .toggleContext (' searchableVectors' );
8180 }
8281 };
8382
8483 const chartView = computed (() => MapStore .activeSideBarCard .value === ' charts' );
8584 const toggleChartView = () => {
8685 MapStore .toggleContext (' charts' );
87- MapStore .chartsOpen .value = MapStore .sideBarCardSettings .value .charts .enabled ;
8886 };
8987
9088 const osmBaseMapType = computed (() => {
@@ -102,6 +100,16 @@ export default defineComponent({
102100 return ' 20px' ;
103101 });
104102
103+ const SideBarHasData = computed (() => {
104+ if (MapStore .activeSideBarCard .value === ' searchableVectors' ) {
105+ return !! MapStore .mapLayerVectorSearchable .value .length ;
106+ }
107+ if (MapStore .activeSideBarCard .value === ' charts' ) {
108+ return true ;
109+ }
110+ return false ;
111+ });
112+
105113 return {
106114 oauthClient ,
107115 loginText ,
@@ -129,11 +137,11 @@ export default defineComponent({
129137 mapLayerVectorSearch: MapStore .mapLayerVectorSearchable ,
130138 hasVectorFeatureSearch ,
131139 toggleVectorFeatureSearch ,
132- mapLayerVectorSearchEnabled: MapStore .mapLayerSearchableEnabled ,
133140 sideBarWidth: MapStore .currentSideBarWidth ,
134141 sideBarOpen: MapStore .sideBarOpen ,
135142 activeSideBar: MapStore .activeSideBarCard ,
136143 rightSideBarPadding ,
144+ SideBarHasData ,
137145 };
138146 },
139147});
@@ -232,7 +240,7 @@ export default defineComponent({
232240 v-bind =" props"
233241 class =" mx-2"
234242 size =" 30"
235- :color =" mapLayerVectorSearchEnabled ? 'primary' : ''"
243+ :color =" activeSideBar === 'searchableVectors' ? 'primary' : ''"
236244 @click =" toggleVectorFeatureSearch()"
237245 >
238246 mdi-map-search-outline
@@ -302,10 +310,10 @@ export default defineComponent({
302310 </v-col >
303311 </v-row >
304312 <selected-feature-list />
305- <v-navigation-drawer :model-value =" sideBarOpen" location =" right" :width =" sideBarWidth" permanent >
313+ <v-navigation-drawer v-if = " SideBarHasData " :model-value =" sideBarOpen" location =" right" :width =" sideBarWidth" permanent >
306314 <indicator-filterable-list v-if =" activeSideBar === 'indicators'" :indicators =" indicators" />
307315 <charts v-if =" activeSideBar === 'charts'" />
308- <VectorFeatureSearch v-if =" activeSideBar === 'searchableVectors'" />
316+ <VectorFeatureSearch v-if =" mapLayerVectorSearch.length && activeSideBar === 'searchableVectors'" />
309317 </v-navigation-drawer >
310318 <MapLegend class =" static-map-legend" :style =" `right: ${rightSideBarPadding};transition: all 0.2s ease`" />
311319 </v-container >
0 commit comments