Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

barbora-delivery-coordinate

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

barbora-delivery-coordinate

Coordinate wrapper

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

Coordinate utility package

This package have functionality to convert multiple format from one to another

Problem

Depends on system multiple systems can use different coordinate formats. For example:

MapBox, Vroom, OSRM uses [lng,lat] Google uses { latitude: x, longitude: y } or { lat: x, lng: x } or [lat,lng]

This project provides unified experience with working with coordinates

Usage


import { Coordinate } from "barbora-delivery-coordinate"


Coordinate.from([1,1])
Coordinate.from({ lat, lng })
Coordinate.from({ longitude, latitude })

new Coordinate([1,2]).tuple() // [1,2] return strict Coordinate tuple [number, number]
new Coordinate([1,2]).lngLat() // { lat: 2, lng: 1 }
new Coordinate([1,2]).long() // { longitude: 1, latitude: 2 }
new Coordinate([1,2]).toString() // 1,2
new Coordinate([1,2]).toString() // 1,2

FAQs

Package last updated on 13 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts