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

feat(lambda-tiler): Refactoring the wmts Capablity to builder interface. #2686

Merged
merged 6 commits into from
Mar 20, 2023

Conversation

Wentao-Kuang
Copy link
Contributor

No description provided.

@Wentao-Kuang Wentao-Kuang requested a review from a team as a code owner February 12, 2023 23:53
wmts.maxZoom = maxZoom;

const nodes = wmts.toVNode();
const nodes = wmts.buildWmtsCapabilities();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toVnode would be better here

}

setFormats(formats?: ImageFormat[]): void {
this.formats = formats ? formats : ImageFormatOrder;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the defaulting should be in the getter not the setter

if (provider == null) return;
const { serviceIdentification, serviceProvider } = provider;
const { contact } = serviceProvider;
this.provider = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be best to leave all the vnode stuff in toVnode() and just store the provider

];
}

buildLayer(tileSet: ConfigTileSet): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be best to addLayer and then leave the rendering to vNode to the end.

}

toXml(): string {
return '<?xml version="1.0" encoding="utf-8"?>\n' + this.toVNode().toString();
return '<?xml version="1.0" encoding="utf-8"?>\n' + this.builder.toVNode().toString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be great to move this into the builder too

export class WmtsCapabilities {
builder: WmtsCapabilitiesBuilder;

constructor(builder: WmtsCapabilitiesBuilder, params: WmtsCapabilitiesParams) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this class, rename build to WmtsCapabilities then this function could be WmtsCabilities.fromParams(parms)

this.builder.addFormats(params.formats);

// Build wmts capabilities
this.builder.addTileSet(params.tileSet);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addX needs to be able to be called multiple times, eg

x.addFormats(ImageFormat.WebP)
x.addFormats(ImageFormat.Avif)

another option there would be to support

x.addFormat(ImageFormat.WebP, ImageFormat.Avif)
x.addFormat(...params.formats)

should add both webp and avif

for (const im of imagery) x.addImagery(im)

blacha
blacha previously approved these changes Feb 26, 2023
@blacha blacha added this pull request to the merge queue Mar 20, 2023
@blacha blacha merged commit 4d223b6 into master Mar 20, 2023
@blacha blacha deleted the feat/refator-wmts branch March 20, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants