New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

googlemaps-utils

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

googlemaps-utils

A collection of utility functions for Google Maps.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

googlemaps-utils

Google Maps utilities for;

  • calculating bounds - get the bounds of a static map API request.
  • calculating zoom - determine the zoom level to use for a given bounds.

Installation

$ npm install -g googlemaps-utils

Examples

The following examples show you how to use googlemaps-utils.

var gmu = require('googlemaps-utils');

// Static map we want the bounds for
// http://maps.googleapis.com/maps/api/staticmap?center=-26.6812783, 153.1215971&zoom=15&size=649x480&sensor=false

// calculate the bounds for a given lonlat, zoom, width and height
var bounds = gmu.calcBounds(-26.6812783, 153.1215971, 15, 649, 480);
/* 
{ bounds: [
	153.10767107079468,
    -26.690480881985657,
    153.13552312920532,
    -26.67207497516463
  ],
  bbox: '153.10767107079468,-26.690480881985657,153.13552312920532,-26.67207497516463',
  top: -26.67207497516463,
  right: 153.13552312920532,
  bottom: -26.690480881985657,
  left: 153.10767107079468
}
*/

// calculate the zoom for a given bounds (l, b, r, t), width and height
var zoom = gmu.calcZoomForBounds([153.10767107079468, -26.690480881985657, 153.13552312920532, -26.67207497516463], 649, 480);
// 15

Running tests

$ npm test

Keywords

FAQs

Package last updated on 13 Jun 2014

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