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

1.2.3 • 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

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; antimeridian?: boolean | 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: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Nicholas Husher, and Michael Bullington.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @types/mapbox__sphericalmercator

      Weekly Downloads

      3,224

      Version

      1.2.3

      License

      MIT

      Unpacked Size

      4.68 kB

      Total Files

      5

      Last publish

      Collaborators

      • types