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

Extension of layerSpecificExport to allow more config options #2040

Open
MattiasSp opened this issue Sep 6, 2024 · 2 comments · May be fixed by #2053
Open

Extension of layerSpecificExport to allow more config options #2040

MattiasSp opened this issue Sep 6, 2024 · 2 comments · May be fixed by #2053

Comments

@MattiasSp
Copy link
Contributor

Description
The layerSpecificExport options for the infoWindow are great, but could be more flexible with the request specifications.

Adding the option to include URL-parameters and choose between making a POST- or a GET request would go a long way to making this feature more general and make it possible to export selected features to many different types of APIs.

Proposed solution
Adding a bunch of config parameters to the layerSpecificExport which control how the requests are made.

Alternatives considered
Adding more hardcoded export modes other than simpleExport and layerSpecificExport would make the configuration simpler as each mode could be better tailored to a specific type of API. But I prefer the proposed solution because hard coded modes would make the code more bloated and repeated, and would also require the code to be updated to match any changes to the APIs.

@steff-o
Copy link
Contributor

steff-o commented Sep 17, 2024

Will the bunch of parameters have some sort of variable substitution like:

{
    "url": "https://reportserver.kommun.se/reports",
    "bunchOfParmeters" : {
        "PageSize": "{{localStorage.userSettingPageSize}}",
        "Filename": "{{feature[0].Attribute['name']}}",
       "format" : "pdf"
    }
}

... or is it just constants?

@MattiasSp MattiasSp linked a pull request Sep 27, 2024 that will close this issue
@MattiasSp
Copy link
Contributor Author

Will the bunch of parameters have some sort of variable substitution like [...] or is it just constants?

The posted PR only handles features from selected attributes and the special case of "valueless" parameters. But I like your idea of allowing generic code like localStorage.userSettingPageSize to be substituted as well!

That, authentication and posting other data formats would be awesome further additions :)

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

Successfully merging a pull request may close this issue.

3 participants