Socket
Socket
Sign inDemoInstall

measuretool-googlemaps-v3

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

measuretool-googlemaps-v3

This is an in-progress handy measurement tool for Google Maps API V3 similar to what Google Maps offers.


Version published
Weekly downloads
2.2K
decreased by-2.29%
Maintainers
1
Weekly downloads
 
Created
Source

Measurement Tool for Google Maps API V3

A handy measurement widget for Google Maps API v3. The functionalities are implemented as close as what current Google Maps offers.

Demo

Visit demo page

demo screen shot

Developer Usage

To create the measurement widget, pass in a MeasureTool Object Specification

var measureTool = new MeasureTool(map, {
  showSegmentLength: true,
  unit: MeasureTool.UnitTypeId.IMPERIAL // or just use 'imperial'
});

User Usage

To start measuring, right click a map and choose measure distance.

To end measuring, right click a map and choose clear measurement.

To add a way point, click on the map.

To remove a way point, click on the waypoint (the first point can not be removed).

To insert a way point, hover on the line and drag it.

When the first point and the last point are close enough, the area will show.

API

MeasureTool class

ConstructorDescription
MeasureTool(map:google.maps.Map, opts?:MeasureToolOptions)Creates a new measure tool for the google.maps.Map instance.
PropertiesDescription
areaType: number - the total area of the enclosed polygon, the unit is for metric unit and ft² for imperial unit.
areaTextType: string - the formatted total area with unit of the enclosed polygon.
lengthType: number - the total length of the path drawn, the unit is m for metric unit and ft for imperial unit.
lengthTextType: string - the formatted total length with unit of the path drawn.
versionType: string - the current version number of MeasureTool

MeasureToolOptions object specification

PropertiesDescription
showSegmentLengthType: boolean - display segment length along the path. Enabled by default.
unitType: UnitTypeId - the unit type to use for the measured length and area. Defaults to MeasureTool.UnitTypeId.METRIC.

UnitTypeId constants

Identifiers for common UnitType. Specify these by value, or by using the constant's name. For example, 'metric' or MeasureTool.UnitTypeId.METRIC.

ConstantDescription
IMPERIALThis unit type shows measured length in US foot (ft) and mile (mi), and area in US square foot (ft²) and square mile (mi²).
METRICThis unit type shows measured length in meter (m) and kilometer (km), and area in square meter (m²) and square kilometer (km²).

Keywords

FAQs

Package last updated on 21 Mar 2017

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