Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@placemarkio/geo-viewport

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@placemarkio/geo-viewport

convert between viewports and extents

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
6.2K
decreased by-11.86%
Maintainers
1
Weekly downloads
 
Created
Source

geo-viewport

On npm as @placemarkio/geo-viewport.

Docs

geo-viewport development is supported by 🌎 placemark.io

Turns bounding boxes / extents into centerpoint & zoom combos for static maps.

This is a maintained fork of the Mapbox repository, with the following changes:

  • Fixed crashing bug introduced in 0.5.0
  • Includes TypeScript types
  • Modernized project & dependencies
  • Smaller module and bundle size, with no dependencies
  • ESM & CJS output types

Changes

Most of the improvements to this package are internal, but the viewport method has changed. In the Mapbox version, it grew quite a few parameters and is now:

viewport(bounds, dimensions, minzoom, maxzoom, tileSize, allowFloat, allowAntiMeridian)

In this fork this has changed so that there is less remembering required. The method signature is:

// Showing default values
viewport(bounds, dimensions, {
    minzoom: 0,
    maxzoom: 20,
    tileSize: 256,
    allowFloat: false,
    allowAntiMeridian: false
})

// You can omit any options or the options array:
viewport(bounds, dimensions);

// Just one option:
viewport(bounds, dimensions, {
    tileSize: 256
})

Keywords

FAQs

Package last updated on 05 Jul 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc