
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
leaflet-simplestyle
Advanced tools
A small module for incorporating incorporating simple style on geojson layers in leafletjs
Extends L.geoJSON to support the simplestyle spec.
npm install leaflet-simplestyle
Step 1. Include the library after you've included leafletjs.
require('leaflet-simplestyle')
// or
<script src="leaflet-simplestyle/dist/leaflet-simplestyle.min.js"></script>
// or via CDN
<script src="https://unpkg.com/leaflet-simplestyle"></script>
Step 2. Set the useSimpleStyle option to true when adding your L.geoJSON layer.
You can also chose whether to support the Maki Icon Library using the useMakiMarkers property, this enables support for the marker-symbol property, however it does require calling the Mapbox API. If useMakiMarkers=false an inline SVG icon is still available which adjusts size and color.
const rect = {
"type": "Feature",
"properties": {
"fill": "yellow"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
10.45007,
-10.359502
],
...
[
10.45007,
-10.359502
]
]
]
}
},
L.geoJSON(rect, {
useSimpleStyle: true,
useMakiMarkers: true
}).addTo(map);
useSimpleStyle(), adds simple styling to a L.geoJSON objectdiscardSimpleStyle(), Removes simple styling from a L.geoJSON objecttoggleMakiMarkers(), Toggles the maki marker styling on a L.geoJSON objectFor example
const myLayer = L.geoJSON(rect, {
useSimpleStyle: false
}).addTo(map);
myLayer.useSimpleStyle()
This borrows some of the code in the excellent mapbox.js library.
FAQs
A small module for incorporating incorporating simple style on geojson layers in leafletjs
We found that leaflet-simplestyle 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.