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

@types/maplibre-gl missing padding field in CameraOptions #60

Closed
MikkoSteerpath opened this issue Jan 21, 2021 · 2 comments
Closed

@types/maplibre-gl missing padding field in CameraOptions #60

MikkoSteerpath opened this issue Jan 21, 2021 · 2 comments

Comments

@MikkoSteerpath
Copy link

MikkoSteerpath commented Jan 21, 2021

Padding is missing in CameraOptions type definitions.

source: https://github.com/maplibre/maplibre-gl-js/blob/main/src/ui/camera.js#L65

export type CameraOptions = {
    center?: LngLatLike,
    zoom?: number,
    bearing?: number,
    pitch?: number,
    around?: LngLatLike,
    padding?: PaddingOptions
};

types: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/maplibre-gl/index.d.ts#L1781

    export interface CameraOptions {
        /** Map center */
        center?: LngLatLike;
        /** Map zoom level */
        zoom?: number;
        /** Map rotation bearing in degrees counter-clockwise from north */
        bearing?: number;
        /** Map angle in degrees at which the camera is looking at the ground */
        pitch?: number;
        /** If zooming, the zoom center (defaults to map center) */
        around?: LngLatLike;
    }

While the types have the padding option for bounds related methods, it looks like the other methods like jumpTo and easeTo take the padding into consideration:

https://github.com/maplibre/maplibre-gl-js/blob/main/src/ui/camera.js#L810

@HarelM
Copy link
Member

HarelM commented Jun 30, 2021

I've migrated the types into this repository.
Please submit a PR to this repo and I'll be happy to merge it :-)

@HarelM
Copy link
Member

HarelM commented Sep 6, 2021

Probably not relevant any more, typings is generated from typescript code.

@HarelM HarelM closed this as completed Sep 6, 2021
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