@types/mapbox__sphericalmercator
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.5 • Public • Published

    Installation

    npm install --save @types/mapbox__sphericalmercator

    Summary

    This package contains type definitions for @mapbox/sphericalmercator (https://github.com/mapbox/sphericalmercator).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__sphericalmercator.

    index.d.ts

    // Type definitions for @mapbox/sphericalmercator 1.1
    // Project: https://github.com/mapbox/sphericalmercator, https://github.com/mapbox/node-sphericalmercator
    // Definitions by: Nicholas Husher <https://github.com/nhusher>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    export as namespace SphericalMercator;
    
    interface XYBounds {
        minX: number;
        minY: number;
        maxX: number;
        maxY: number;
    }
    
    export {};
    
    type LatLngPoint = [number, number];
    type XYPoint = [number, number];
    type BoundingBox = [number, number, number, number];
    type Projection = 'WGS84' | '900913';
    
    declare class SphericalMercator {
        constructor(options: { size?: number | undefined })
        px(ll: LatLngPoint, zoom: number): XYPoint;
        ll(px: XYPoint, zoom: number): LatLngPoint;
        bbox(x: number, y: number, zoom: number, tms_style?: boolean, srs?: Projection): BoundingBox;
        xyz(bbox: BoundingBox, zoom: number, tms_style?: boolean, srs?: Projection): XYBounds;
        convert(bbox: BoundingBox, to?: Projection): BoundingBox;
        forward(ll: LatLngPoint): XYPoint;
        inverse(xy: XYPoint): LatLngPoint;
    }
    
    export = SphericalMercator;

    Additional Details

    • Last updated: Thu, 08 Jul 2021 16:23:57 GMT
    • Dependencies: none
    • Global values: SphericalMercator

    Credits

    These definitions were written by Nicholas Husher.

    Keywords

    none

    Install

    npm i @types/mapbox__sphericalmercator

    DownloadsWeekly Downloads

    1,215

    Version

    1.1.5

    License

    MIT

    Unpacked Size

    5 kB

    Total Files

    4

    Last publish

    Collaborators

    • types