Skip to content

Commit

Permalink
Fixed centering & drawing geometries on spatial search, removed spati…
Browse files Browse the repository at this point in the history
…al search Pinia stores
  • Loading branch information
jamiefeiss committed Aug 31, 2023
1 parent fc05e5d commit 10ba156
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 538 deletions.
10 changes: 10 additions & 0 deletions src/components/MapClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ export enum ShapeTypes {
}

export type DrawingModes = 'MARKER' | 'RECTANGLE' | 'POLYGON'

/** well known text simplified result object, as returned by mapSearch */
export type WKTResult = {
uri: string
link: string
wkt: string
fcLabel: string
label: string
id?: string
}
2 changes: 1 addition & 1 deletion src/components/MapClient.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { wktToGeoJSON } from "@terraformer/wkt"
import { mapConfigKey, type MapConfig } from "@/types";
import { convertConfigTypes } from '@/util/mapSearchHelper'
import type { MapOptionsCenter } from '@/types'
import type { WKTResult } from '@/stores/mapSearchStore.d';
import type { WKTResult } from "@/components/MapClient.d";
import { ShapeTypes, type DrawingModes } from "@/components/MapClient.d";
Expand Down
2 changes: 0 additions & 2 deletions src/components/search/CatPrezSearchMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ async function getThemes() {
* Performs search via a SPARQL query
*/
async function doSearch() {
console.log("performing search...")
const searchData = await searchSparqlGetRequest(`${apiBaseUrl}/sparql`, query.value);
if (searchData && !searchError.value) {
results.value = (searchData.results.bindings as SparqlBinding[]).map(result => {
Expand Down Expand Up @@ -317,7 +316,6 @@ onMounted(async () => {
</div>
<div class="search-map">
<MapClient
ref="searchMapRef"
:drawing-modes="['RECTANGLE']"
@selectionUpdated="handleMapSelectionChange"
/>
Expand Down
3 changes: 3 additions & 0 deletions src/components/search/SpacePrezSearchMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ async function doSearch() {
label: result.f_label ? result.f_label.value : ""
}
});
if (searchMap.value) {
searchMap.value.drawShape(results.value);
}
}
}
}
Expand Down
20 changes: 0 additions & 20 deletions src/stores/catalogQueries.d.ts

This file was deleted.

99 changes: 0 additions & 99 deletions src/stores/catalogQueries.ts

This file was deleted.

41 changes: 0 additions & 41 deletions src/stores/datasetsStore.d.ts

This file was deleted.

Loading

0 comments on commit 10ba156

Please sign in to comment.