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.
@planet/maps
Advanced tools
Declarative mapping components
npm install @planet/maps
See the planetlabs.github.io/maps website for more details and examples using the library.
React lets you build interactive UIs with (mostly) declarative syntax. OpenLayers provides an imperative API for building mapping apps. It can be awkward to map React's component API to an imperative API. However, the React team provides a package for creating custom renderers: react-reconciler
. This is how they integrate with imperative APIs themselves. The react-dom
package uses react-reconciler
to provide a mapping to the imperative DOM API. react-native
uses react-reconciler
to map to imperative native APIs.
This library provides declarative mapping components representing imperative APIs from OpenLayers.
The purpose of this project is to provide a mapping between React's declarative components and OpenLayers' imperative API. In other words, this project provides a React renderer for OpenLayers.
Here are some of the goals of this project:
options
(passed to the constructor only), listener props (e.g. onChange
), and ref
.ref
that provide access to the underlying OpenLayers instance.This project does not intend to provide any of the following:
We hope that this package can provide the foundation for other, higher-level libraries with more opinions about the look and feel of mapping components.
The development setup depends on Node 18 (most things work on 16, but not all).
Install project dependencies:
npm install
Start the development server:
npm start
The rendering tests use Playwright for visual snapshot comparison. See the tests/rendering/readme.md
for more detail.
Before running tests for the first time, install the required Playwright browser:
npx playwright install chromium
Run the tests:
npm test
After updating the ol
package to a new version, the generated component sources should be updated:
npm run generate
To publish a new release, choose the release type, update the package.json
version and create a tag with npm version
, and then push the change:
npm version minor
git push --tags origin main
After pushing the changes, draft release notes based on the tag and publish the GitHub release.
Other projects like react-openlayers-fiber
and react-ol-fiber
use a similar approach and provided inspiration for this project. The major difference between this project and those is that this project provides importable components for OpenLayers layers, sources, controls, and interactions. The other projects bundle all of OpenLayers in their renderer. So a simple "hello world" map with one of the existing projects is about 1.5 MB while the same with this project is about 460 KB.
FAQs
Declarative mapping components for React
We found that @planet/maps demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 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.