A set of geo related modules to use in combination with React, Ant Design and OpenLayers.
Latest commit 19e3b4f Oct 25, 2018

README.md

react-geo

Build Status Coverage Status license: 2-Clause BSD Known Vulnerabilities Greenkeeper badge devDependencies Status dependencies Status

A set of geo related modules. To use in combination with react, antd and ol.

  • testing using jest on es6 modules, optionally with coverage
  • webpack to produce optimized and debug builds
  • documented using React Styleguidist
  • autogenerated examples from a template, including highlighted source code

Feature List

You can find a complete Feature List in the wiki.

Examples and API documentation

Visit https://terrestris.github.io/react-geo/

Workshop

Visit https://terrestris.github.io/react-geo-ws (Currently only working with react-geo@8 or smaller)

Installation

npm i @terrestris/react-geo

Requirements

react-geo is designed to be used with es6-modules. To use a component just import it like we do it in the examples:

import {
  CircleMenu,
  SimpleButton,
  MapComponent,
  MapProvider,
  mappify
} from '@terrestris/react-geo';

The use of webpack and babel is recommended. You need to configure a less-loader inside your webpack-config to receive react-geo specific styling.

module: {
  loaders: [{
    test: /\.less$/,
    loaders: [
      'style-loader',
      'css-loader',
      {
        loader: 'less-loader',
        options: {
          modifyVars: CustomAntThemeModifyVars(),
          javascriptEnabled: true // Less version > 3.0.0
        }
      }
    ]
  }]
}

Development notes

If you like to develop a react-geo component out of your project make use of npm link:

In react-geo:

npm link

In your project:

npm link @terrestris/react-geo