![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
measuretool-googlemaps-v3
Advanced tools
Readme
A handy measurement widget for Google Maps API v3. The functionalities are implemented as close as what current Google Maps offers.
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'
});
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.
Constructor | Description |
---|---|
MeasureTool(map:google.maps.Map , opts?:MeasureToolOptions ) | Creates a new measure tool for the google.maps.Map instance. |
Properties | Description |
---|---|
area | Type: number - the total area of the enclosed polygon, the unit is m² for metric unit and ft² for imperial unit. |
areaText | Type: string - the formatted total area with unit of the enclosed polygon. |
length | Type: number - the total length of the path drawn, the unit is m for metric unit and ft for imperial unit. |
lengthText | Type: string - the formatted total length with unit of the path drawn. |
version | Type: string - the current version number of MeasureTool |
Properties | Description |
---|---|
showSegmentLength | Type: boolean - display segment length along the path. Enabled by default. |
unit | Type: UnitTypeId - the unit type to use for the measured length and area. Defaults to MeasureTool.UnitTypeId.METRIC . |
Identifiers for common UnitType. Specify these by value, or by using the constant's name. For example, 'metric'
or MeasureTool.UnitTypeId.METRIC
.
Constant | Description |
---|---|
IMPERIAL | This unit type shows measured length in US foot (ft) and mile (mi), and area in US square foot (ft²) and square mile (mi²). |
METRIC | This unit type shows measured length in meter (m) and kilometer (km), and area in square meter (m²) and square kilometer (km²). |
FAQs
A handy measurement widget for Google Maps API v3. The functionalities are implemented as close as to what current Google Maps offers.
The npm package measuretool-googlemaps-v3 receives a total of 1,944 weekly downloads. As such, measuretool-googlemaps-v3 popularity was classified as popular.
We found that measuretool-googlemaps-v3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.