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

Export Selection to redlining #511

Open
cazitouni opened this issue Dec 22, 2023 · 2 comments
Open

Export Selection to redlining #511

cazitouni opened this issue Dec 22, 2023 · 2 comments

Comments

@cazitouni
Copy link

Actually it's possible to export selection to file/clipboard.

Wouldn't it be nice to be able to export the current selection to a redlining layer, in order to let user modify some elements before printing/export to image.

It may be added as a new button in this section ?
image

@manisandro
Copy link
Member

Yes why not, potentially one could add a "Add to redlining layer" button where one can pick an existing layer or a create a new one.

@cazitouni
Copy link
Author

Hello @manisandro,

I made a custom exporter (using js/IdentifyExtensions.js) for our own needs regarding this issue.

export const customExporters = [
    {
        id: "exportEdition",
        title: "Dessin",
        export: function(features) {
            Object.keys(features).forEach(key => {
                let data = features[key];
                const layer = {
                    id: "dessin",
                    role: LayerRole.USERLAYER,
                    title:"Dessin",
                };
                const layerFeatures = [];
                if (Array.isArray(data)) {
                    data.forEach(item => {
                            if (item.geometry) {
                                item.crs = item.crs;
                                item.styleName = 'default';
                                item.styleOptions = {
                                    fillColor:  [242, 151, 84, 0.30],
                                    strokeColor: [242, 151, 84, 0.75],
                                    strokeWidth: 2,
                                    strokeDash: []
                                };
                                layerFeatures.push(item);
                            }
                    });
                }
                window.qwc2.addLayerFeatures(layer, layerFeatures, false)
            });
        }
    }
];

Would it be interesting for you if I modified it a little to integrate it into the default exporters?
Regards, Clément.

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