Skip to content

Commit

Permalink
Fix IdentifierTool TiTiler calls when served at a subpath
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed Feb 12, 2025
1 parent 4866acc commit 2ae97e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/essence/Basics/Layers_/Layers_.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ const L_ = {
resamplingParam = `&resampling=${layerData.cogResampling}`
}

nextUrl = `${window.location.origin}/titiler/cog/tiles/${
nextUrl = `${window.location.origin}${(
window.location.pathname || ''
).replace(/\/$/g, '')}/titiler/cog/tiles/${
layerData.tileMatrixSet || 'WebMercatorQuad'
}/{z}/{x}/{y}.webp?url=${nextUrl}${bandsParam}${resamplingParam}`
}
Expand Down Expand Up @@ -3612,6 +3614,16 @@ function parseConfig(configData, urlOnLayers) {
//Create parsed layers named
L_.layers.data[d[i].name] = d[i]

if (d[i].display_name === 'TimeCogs') {
d[i].time.current = '2025-02-12T01:20:55Z'
d[i].time.start = ''
d[i].time.end = ''
d[i].time.startProp = ''
d[i].time.endProp = ''
d[i].time.refresh = '1 hours'
d[i].time.increment = '5 minutes'
}

if (
d[i].time &&
d[i].time.enabled === true &&
Expand Down
8 changes: 6 additions & 2 deletions src/essence/Tools/Identifier/IdentifierTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,9 @@ function queryDataValue(url, lng, lat, numBands, layerUUID, callback) {
`${
mmgisglobal.NODE_ENV === 'development'
? 'http://localhost:8888'
: ''
: `${window.location.origin}${(
window.location.pathname || ''
).replace(/\/$/g, '')}`
}/titilerpgstac/collections/${
url.split('stac-collection:')[1]
}/point/${lng},${lat}?assets=asset&items_limit=10${timeParam}${bandsParam}`,
Expand Down Expand Up @@ -734,7 +736,9 @@ function queryDataValue(url, lng, lat, numBands, layerUUID, callback) {
`${
mmgisglobal.NODE_ENV === 'development'
? 'http://localhost:8888'
: ''
: `${window.location.origin}${(
window.location.pathname || ''
).replace(/\/$/g, '')}`
}/titiler/cog/point/${lng},${lat}?assets=asset&url=${L_.getUrl(
'tile',
url
Expand Down

0 comments on commit 2ae97e8

Please sign in to comment.