@planet/maps
Advanced tools
Comparing version 8.0.0-dev.1666713300824 to 8.0.0-dev.1666714337006
{ | ||
"name": "@planet/maps", | ||
"version": "8.0.0-dev.1666713300824", | ||
"version": "8.0.0-dev.1666714337006", | ||
"description": "Declarative mapping components for React", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -5,13 +5,17 @@ # @planet/maps | ||
## Background | ||
## Use | ||
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`](https://www.npmjs.com/package/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. | ||
``` | ||
npm install @planet/maps | ||
``` | ||
This library provides declarative mapping components representing imperative APIs from OpenLayers. | ||
Import the components you need for your map. Provide an `options` prop to pass to the underlying OpenLayers constructor. Provide other props for values that you want to update with state changes. | ||
## Example | ||
```js | ||
import Map from '@planet/maps/lib/Map'; | ||
import OSM from '@planet/maps/source/OSM'; | ||
import ScaleLine from '@planet/maps/control/ScaleLine'; | ||
import View from '@planet/maps/lib/View'; | ||
import WebGLTile from '@planet/maps/layer/WebGLTile'; | ||
Here is an example of what a map looks like with components from this package: | ||
```js | ||
function MyApp() { | ||
@@ -32,2 +36,8 @@ return ( | ||
## Background | ||
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`](https://www.npmjs.com/package/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. | ||
## Design Goals | ||
@@ -34,0 +44,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
104373
80