1111 <v-col sm =" 12" md =" 3" >
1212 <v-container >
1313 <v-row justify =" center" fill-height >
14- <template v-if =" dataset .hasSynop " >
15- <v-card class =" pa-0 ma-0" @click =" loadMap(dataset.id)" @keydown.enter =" loadMap(dataset.id)"
14+ <template v-if =" dataset .mapType != ' unknown ' " >
15+ <v-card class =" pa-0 ma-0" @click =" loadMap(dataset.id, dataset.mapType )" @keydown.enter =" loadMap(dataset.id, dataset.mapType )"
1616 aria-label =" Dataset map" >
1717 <v-overlay open-on-hover contained activator =" parent" class =" align-center justify-center" >
1818 <v-btn flat >
@@ -117,15 +117,20 @@ export default defineComponent({
117117 }
118118
119119 for (const feature of data .features ) {
120-
121120 // if "wmo:topicHierarchy" not is available in the properties hasSynop should be false
121+ let mapType = " unknown" ;
122122 let hasSynop = false ;
123123 let hasTemp = false ;
124124 let hasTopic = false ;
125125 if (feature .properties [" wmo:topicHierarchy" ]) {
126126 hasTopic = true ;
127127 hasSynop = feature .properties [" wmo:topicHierarchy" ].includes (" surface-based-observations/synop" );
128128 hasTemp = feature .properties [" wmo:topicHierarchy" ].includes (" surface-based-observations/temp" );
129+ if (hasSynop ) {
130+ mapType = " synop" ;
131+ } else if (hasTemp ) {
132+ mapType = " temp" ;
133+ }
129134 }
130135 const uiLinks = [];
131136
@@ -195,7 +200,7 @@ export default defineComponent({
195200 const bbox = feature .geometry .coordinates [0 ].flat (2 );
196201
197202 this .datasets .push ({
198- hasSynop ,
203+ mapType ,
199204 bbox ,
200205 uiLinks ,
201206 ... feature ,
@@ -207,8 +212,12 @@ export default defineComponent({
207212 this .loading = false ;
208213 }
209214 },
210- loadMap(topic : string ) {
211- this .$router .push (` /fixed-land-station-map/${topic } ` );
215+ loadMap(topic : string , mapType : string ) {
216+ if (mapType === " synop" ) {
217+ this .$router .push (` /fixed-land-station-map/${topic } ` );
218+ } else if (mapType === " temp" ) {
219+ this .$router .push (` /fixed-upper-air-map/${topic } ` );
220+ }
212221 },
213222 },
214223});
0 commit comments