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

Can not set default map rotation in RMap #290

Open
itsdapi opened this issue Sep 19, 2024 · 1 comment · May be fixed by #320
Open

Can not set default map rotation in RMap #290

itsdapi opened this issue Sep 19, 2024 · 1 comment · May be fixed by #320

Comments

@itsdapi
Copy link

itsdapi commented Sep 19, 2024

The view init is hard coded and can not pass the rotation property to the view.

    constructor(props: Readonly<RMapProps>) {
        super(props);
        this.target = React.createRef();
        this.ol = new Map({
            controls: props.noDefaultControls ? [] : undefined,
            interactions: props.noDefaultInteractions ? [] : undefined,
            view: new View({
                projection: props.projection,
                center: props.initial.center,
                zoom: props.initial.resolution === undefined ? props.initial.zoom : undefined,
                resolution: props.initial.resolution,
                extent: props.extent,
                minResolution: props.minResolution,
                maxResolution: props.maxResolution,
                constrainResolution: props.constrainResolution,
                minZoom: props.minZoom,
                maxZoom: props.maxZoom,
                enableRotation: props.enableRotation,
                constrainRotation: props.constrainRotation
            })
        });
        if (this.props.view) this.ol.on('moveend', this.updateView);
    }

Adding the rotation property to RView would be nice

@mmomtchev
Copy link
Owner

I will accept a PR

@U29 U29 linked a pull request Oct 21, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants