-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
wmts.maxZoom = maxZoom; | ||
|
||
const nodes = wmts.toVNode(); | ||
const nodes = wmts.buildWmtsCapabilities(); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 = [ |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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)
No description provided.