Skip to content

Commit

Permalink
Minor fix: mmgis-stac db in adj-srv sample.envs, fix pathing when ser…
Browse files Browse the repository at this point in the history
…ved at subpath
  • Loading branch information
tariqksoliman committed Dec 23, 2024
1 parent 2a2d9a4 commit cf2a8b1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
3 changes: 2 additions & 1 deletion adjacent-servers/stac/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
POSTGRES_USER=
POSTGRES_PASS=
POSTGRES_DBNAME=
# hardcoded to mmgis-stac
POSTGRES_DBNAME=mmgis-stac
POSTGRES_HOST=localhost
POSTGRES_HOST_READER=localhost
POSTGRES_HOST_WRITER=localhost
Expand Down
3 changes: 2 additions & 1 deletion adjacent-servers/tipg/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ TITILER_PGSTAC_API_DEBUG=TRUE

POSTGRES_USER=
POSTGRES_PASS=
POSTGRES_DBNAME=
# hardcoded to mmgis-stac
POSTGRES_DBNAME=mmgis-stac
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
3 changes: 2 additions & 1 deletion adjacent-servers/titiler-pgstac/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ TITILER_PGSTAC_SEARCH_SKIPCOVERED=FALSE

POSTGRES_USER=
POSTGRES_PASS=
POSTGRES_DBNAME=
# hardcoded to mmgis-stac
POSTGRES_DBNAME=mmgis-stac
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
8 changes: 4 additions & 4 deletions configure/src/pages/APIs/APIs.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const apiCards = {
subtitle: "FastAPI implementation of the STAC API spec.",
description: "",
link: `${window.location.pathname
.replace(`${window.mmgisglobal.ROOT_PATH || ""}/configure-beta`, "")
.replace(`/configure-beta`, "")
.replace(/^\//g, "")}/stac/api.html`,
active: window.mmgisglobal.WITH_STAC === "true",
},
Expand All @@ -56,7 +56,7 @@ const apiCards = {
"A modern dynamic tile server built on top of FastAPI and Rasterio/GDAL.",
description: "",
link: `${window.location.pathname
.replace(`${window.mmgisglobal.ROOT_PATH || ""}/configure-beta`, "")
.replace(`/configure-beta`, "")
.replace(/^\//g, "")}/titiler/api.html`,
active: window.mmgisglobal.WITH_TITILER === "true",
},
Expand All @@ -66,7 +66,7 @@ const apiCards = {
"TiTiler-PgSTAC is a TiTiler extension that connects to a PgSTAC database to create dynamic mosaics based on search queries.",
description: "",
link: `${window.location.pathname
.replace(`${window.mmgisglobal.ROOT_PATH || ""}/configure-beta`, "")
.replace(`/configure-beta`, "")
.replace(/^\//g, "")}/titilerpgstac/api.html`,
active: window.mmgisglobal.WITH_TITILER_PGSTAC === "true",
},
Expand All @@ -76,7 +76,7 @@ const apiCards = {
"Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.",
description: "",
link: `${window.location.pathname
.replace(`${window.mmgisglobal.ROOT_PATH || ""}/configure-beta`, "")
.replace(`/configure-beta`, "")
.replace(/^\//g, "")}/tipg/api.html`,
active: window.mmgisglobal.WITH_TIPG === "true",
},
Expand Down
15 changes: 13 additions & 2 deletions configure/src/pages/STAC/STAC.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,14 @@ export default function STAC() {
aria-label="info"
onClick={() => {
window
.open(`/stac/collections/${row.id}`, "_blank")
.open(
`${window.location.pathname
.replace(`/configure-beta`, "")
.replace(/^\//g, "")}/stac/collections/${
row.id
}`,
"_blank"
)
.focus();
}}
>
Expand All @@ -457,7 +464,11 @@ export default function STAC() {
onClick={() => {
window
.open(
`/stac/collections/${row.id}/items`,
`${window.location.pathname
.replace(`/configure-beta`, "")
.replace(/^\//g, "")}/stac/collections/${
row.id
}/items`,
"_blank"
)
.focus();
Expand Down
4 changes: 3 additions & 1 deletion src/essence/Basics/Map_/Map_.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,9 @@ async function makeTileLayer(layerObj) {
case 'stac-collection':
splitColonType = splitColonLayerUrl[0]
const splitParams = splitColonLayerUrl[1].split('?')
layerUrl = `/titilerpgstac/collections/${
layerUrl = `${window.location.origin}${(
window.location.pathname || ''
).replace(/\/$/g, '')}/titilerpgstac/collections/${
splitParams[0]
}/tiles/${
layerObj.tileMatrixSet || 'WebMercatorQuad'
Expand Down

0 comments on commit cf2a8b1

Please sign in to comment.