Skip to content

Can not set default map rotation in RMap #290

@itsdapi

Description

@itsdapi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions