Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting useTileLayerAsFallback building option to false has no effect #227

Closed
jfbourgon opened this issue Sep 16, 2022 · 4 comments
Closed
Assignees
Milestone

Comments

@jfbourgon
Copy link
Collaborator

In order to overcome the issue about GeoTransform mentioned in #222, our local setup is built with both tileSourceTemplate and useTileLayerAsFallback options set. However this has no issue on the map renderer behavior since the useTileLayerAsFallback setting is ignored.

The issue seems related to the fact the value set as a building option through a command such as npm run build -- --useTileLayerAsFallback=false ... is interpreted/stored as a string in the resulting javascript file, thus never evaluated to false

See below for a snippet of the resulting file:

const Pt = Object.assign(vt, {
	report: !0,
	useTileLayerAsFallback: "false",
	pathPrefix: "/stac-browser/",
	catalogUrl: "https://my.own.stacapi.com/api/",
	tileSourceTemplate: "https://my.own.titiler.com/cog/tiles/{z}/{x}/{y}?url={url}"
})

manually fixing the resulting javascript file this way is sufficient to solve the issue and have our own Tiler service used for the COG asset rendering.

const Pt = Object.assign(vt, {
	report: !0,
	useTileLayerAsFallback: false,
	pathPrefix: "/stac-browser/",
	catalogUrl: "https://my.own.stacapi.com/api/",
	tileSourceTemplate: "https://my.own.titiler.com/cog/tiles/{z}/{x}/{y}?url={url}"
})
@m-mohr
Copy link
Collaborator

m-mohr commented Sep 16, 2022

Thanks for the report. To clarify: You are using the config option and set it to boolean false and that does not work? Or are you using the CLI option and that doesn't work? I assume it's the latter, but I just want to make sure I dig into the right part of the code.

@jfbourgon
Copy link
Collaborator Author

I'm using the CLI option on the npm run build command.

@m-mohr
Copy link
Collaborator

m-mohr commented Sep 16, 2022

Thanks, I've committed a fix.

(I was only able to test that it arrives correctly in the build file as my train is about to arrive, but I think it should work. Please let me know if you still have issues.)

@m-mohr m-mohr closed this as completed Sep 16, 2022
@m-mohr m-mohr self-assigned this Sep 16, 2022
@m-mohr m-mohr added this to the 3.0.0-rc.1 milestone Sep 16, 2022
@m-mohr m-mohr added the bug label Sep 16, 2022
@jfbourgon
Copy link
Collaborator Author

Also confirm that the proposed fix is addressing the issue on my end too The javascript file now contains the following config and the viewer is using a Tile Service by default once deployed.

const Pt = Object.assign(vt, {
	report: !0,
	useTileLayerAsFallback: !1,
	pathPrefix: "/stac-browser/",
	catalogUrl: "https://my.own.stacapi.com/api/",
	tileSourceTemplate: "https://my.own.titiler.com/cog/tiles/{z}/{x}/{y}?url={url}"
});

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants