# ol-react

> React interface for openlayers

Latest version **0.1.5** (published 2016-10-09) · 0 weekly downloads

## Install

```sh
npm install ol-react
pnpm add ol-react
yarn add ol-react
bun add ol-react
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2016-10-09 |
| First published | 2015-12-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | richard.hills@gmail.com |
| Maintainers | richardhills |

## Links

- npm: https://www.npmjs.com/package/ol-react
- npm.io page: https://npm.io/package/ol-react

## Dependencies (1)

- [openlayers](https://npm.io/package/openlayers.md) ^3.16.0

## Recent versions

- 0.1.5 (latest) — 2016-10-09
- 0.1.4 — 2016-10-09
- 0.1.3 — 2016-09-04
- 0.1.0 — 2016-08-21
- 0.0.4 — 2015-12-13
- 0.0.3 — 2015-12-05
- 0.0.2 — 2015-12-03
- 0.0.1 — 2015-12-02

## README

A thin wrapper for [OpenLayers3](http://openlayers.org/) in [React](https://facebook.github.io/react/).

The goal is to be able to write applications using OpenLayers maps in a declarative way. For example, the following is JSX, which can be returned by the render() method on a React component, to generate a map with a red square near the equator.

    <Map view=<View resolution={10000} center={[0, 0]}/>>
      <layer.Tile>
        <source.OSM />
      </layer.Tile>
      <layer.Vector>
        <source.Vector>
          <Feature style={{stroke: {color: [255, 0, 0, 1]}}}>
            <geom.LineString>
              {[[0, 0], [100000, 0], [100000, 100000], [0, 100000]]}
            </geom.LineString>
          </Feature>
        </source.Vector>
      </layer.Vector>
    </Map>

To understand what each element does, read the [OpenLayers API documentation](http://openlayers.org/en/v3.11.2/apidoc/).

It's early days! If you're familiar with react and/or openlayers and are interested in helping, please get in touch. Available on [github](https://github.com/richardhills/ol-react) and [npm](https://www.npmjs.com/package/ol-react).

I am especially interested in assistance with having each component be optionally [controlled](https://facebook.github.io/react/docs/forms.html#controlled-components). This would allow binding of the components with, say, Redux and for sophisticated state management outside of OpenLayers.

---
_Source: https://npm.io/package/ol-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
