
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
prebaked-geojson-map
Advanced tools
This package makes it very easy to add GeoJSON data to a preconfigured Leaflet map.
prebaked-geojson-mapThis package makes it very easy to add GeoJSON data to a to a preconfigured Leaflet map.
npm install --save-dev prebaked-geojson-map
This module exports a UMD object named PrebakedGeoJSONMap; you can see the
exported members in src/index.ts.
Here are the basic steps to use this module in a webpage:
index.css and index.js into your page.var map = window.PrebakedGeoJSONMap.add();. .add takes the same options
as Leaflet's L.map. It includes some default options
(see src/map.ts) and automatically adds some base layers (see
src/layers.ts).window.PrebakedGeoJSONMap.renderPaths(data, map);
and window.PrebakedGeoJSONMap.renderPoints(data, map);. data must be
valid GeoJSON data, either as a JavaScript object literal or via
JSON.parse.You can see these steps demonstrated by example/index.html. The
instant-map project is slightly more complex; the user drags a
GeoJSON file into the browser window and the GeoJSON data is projected on the
map.
The Map instance returned by .add has some custom event listeners that
work around limitations in Leaflet’s API:
"addBaseLayer" allows you to add a new base Layer to the existing
layers control. Leaflet’s API only allows you to add new layers by
calling L.control.layers, which will always add
a new control. Use it like
map.fire("addBaseLayer", { baseLayer: layer, key: 'foo' });."addOverlayLayer" allows you to add a new Layer or LayerGroup overlay
to the existing layers control. Use it like
map.fire("addOverlayLayer", { overlayLayer: layer, key: 'foo' });."resetOverlayLayers" allows you to remove all the overlay layers from the
layers control. Use it like map.fire("resetOverlayLayers"). Note that this
will not remove Markers added by .renderPoints: to remove those, run
map.eachLayer(layer => { if (!layer._url) map.removeLayer(layer) });.FAQs
This package makes it very easy to add GeoJSON data to a preconfigured Leaflet map.
We found that prebaked-geojson-map 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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.