Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
mapbox-gl-controls
Advanced tools
[![Ruler](./docs/map.png)](https://bravecow.github.io/mapbox-gl-controls/)
npm install mapbox-gl-controls
<link href="mapbox-gl-controls/theme.css" rel="stylesheet">
import RulerControl from 'mapbox-gl-controls/lib/ruler';
map.addControl(new RulerControl(), 'top-right');
map.on('ruler.on', () => console.log('ruler: on'));
map.on('ruler.off', () => console.log('ruler: off'));
// with miles:
map.addControl(new RulerControl({
units: 'miles',
labelFormat: n => `${n.toFixed(2)} ml`,
}), 'top-right');
import StylesControl from 'mapbox-gl-controls/lib/styles';
// with default styles:
map.addControl(new StylesControl(), 'top-left');
// with custom styles:
map.addControl(new StylesControl({
styles: [
{
label: 'Streets',
styleName: 'Mapbox Streets',
styleUrl: 'mapbox://styles/mapbox/streets-v9',
}, {
label: 'Satellite',
styleName: 'Satellite',
styleUrl: 'mapbox://styles/mapbox/satellite-v9',
},
],
onChange: (style) => console.log(style),
}), 'top-left');
import CompassControl from 'mapbox-gl-controls/lib/compass';
map.addControl(new CompassControl(), 'top-right');
import ZoomControl from 'mapbox-gl-controls/lib/zoom';
map.addControl(new ZoomControl(), 'top-right');
import LanguageControl from 'mapbox-gl-controls/lib/language';
// with browser detect:
map.addControl(new LanguageControl());
// with custom language:
const languageControl = new LanguageControl({
language: 'ru',
});
map.addControl(languageControl);
// change language to multi language after control has been added:
languageControl.setLanguage('mul');
options
Object (optional, default {}
)
options.instant
Boolean Show compass if bearing is 0 (optional, default true
)Language can be set dynamically with .setLanguage(lang)
method.
options
Object (optional, default {}
)
options.supportedLanguages
Array? (Supported languages)[https://docs.mapbox.com/help/troubleshooting/change-language/]options.language
String? One of the supported languages to applyoptions.excludedLayerIds
Array Array of layer id to exclude from localization (optional, default []
)options.getLanguageField
Function? Accepts language and returns language field.
By default fields are name_LANGUAGE
and name
for multi language (mul).Fires map ruler.on
and ruler.off
events at the beginning and at the end of measuring.
options
Object (optional, default {}
)
options.units
String Any units @turf/distance supports (optional, default 'kilometers'
)options.labelFormat
Function? Accepts number and returns label.
Can be used to convert value to any measuring unitsoptions
Object (optional, default {}
)
FAQs
Controls for mapbox-gl
The npm package mapbox-gl-controls receives a total of 990 weekly downloads. As such, mapbox-gl-controls popularity was classified as not popular.
We found that mapbox-gl-controls 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.