Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
leaflet-grid-distance
Advanced tools
AxesLayerWithDistance is a custom Leaflet grid layer that displays a customizable grid with labeled axes on a Leaflet map. This library allows you to visualize distance scales directly on your map tiles, enhancing the map's usability and interactivity for educational, scientific, or navigational purposes.
Install the package via npm:
npm install leaflet-grid-distance
First, import the library and Leaflet into your project:
import * as L from 'leaflet';
import { AxesLayerWithDistance, AxesLayerOptions } from 'axes-layer-with-distance';
Here is a simple example of how to create a Leaflet map and add the AxesLayerWithDistance
:
// Create a map
const map = L.map('map').setView([51.505, -0.09], 13);
// Add a tile layer (e.g., OpenStreetMap)
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
}).addTo(map);
// Create an AxesLayerWithDistance with options
const axesLayerWithDistance = AxesLayerWithDistance({
primaryColor: '#ff0000',
secondaryColor: '#999999',
textColor: '#000000',
fontSize: 12,
kmThreshold: 13,
});
// Add the AxesLayerWithDistance to the map
axesLayerWithDistance.addTo(map);
You can customize the AxesLayerWithDistance using the following options:
changeOptions(options: Partial<AxesLayerOptions>)
: Update the options of the AxesLayerWithDistance and redraw the layer.We welcome contributions to improve this library. Please fork the repository, create a branch, and submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or support requests, please open an issue on the GitHub repository or contact me directly at techyared.main@gmail.com.
FAQs
A Leaflet plugin to show grid distances
The npm package leaflet-grid-distance receives a total of 1 weekly downloads. As such, leaflet-grid-distance popularity was classified as not popular.
We found that leaflet-grid-distance demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.