
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
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 0 weekly downloads. As such, leaflet-grid-distance popularity was classified as not popular.
We found that leaflet-grid-distance demonstrated a not healthy version release cadence and project activity because the last version was released 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
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.