10.2.15 • Published 2 years ago

@saeon/ol-react v10.2.15

Weekly downloads
68
License
MIT
Repository
github
Last release
2 years ago

@saeon/ol-react

Install the package via the NPM registry

npm install @saeon/ol-react ol

@saeon/ol-react references the ol NPM package as a peer dependency. In the entry point of your app it's necessary to load the OpenLayers CSS:

import 'ol/ol.css'

Modules

The basis of the Atlas is that it comprises of many Modules. Please see ./dev/index.jsx (in this repository) for a working proof of concept that uses all the 'built-in' modules. This documentation describes how the example works, and is aimed at showing how to structure your own modules. These examples show two different mechanisms for 'composition' when authoring modules.

Built in modules

SingleFeatureSelector

TODO

LayerManager

The OpenLayers library maintains it's own layer state. This is problematic when using React.js, since React will not update state automatically in response to changes to an OpenLayers map instance. This modules provides an array of 'proxy' layer objects, and helper functions to update these objects; these proxy layer objects are stored in React state. Essentially this module 'binds' react state to OpenLayers state, and makes working with layers easier.

TODO example

Example 1

class App extends PureComponent {
  constructor(props) { ... }

  render() {
    return (
      <Map>
        {({ map }) => (
          <div>
            {/* Add your modules here */}
            <Module1 map={map} />
            <Module2 map={map}/>
            <Module3 map={map}/>
          </div>
        )}
      </Map>
    )
  }
}

Example 2

Since you can define your own modules, you can define composition. Nested module composition might be useful if, for example, Module1 contained filtering logic that you want to make available to other modules.

class App extends PureComponent {
  constructor(props) { ... }

  render() {
    return (
      <Map>
        {({ map }) => (
          <Module1 map={map}>
          {({ someFn }) => (
            <Module2 map={map}>
            {({ ... }) => (
              <Module3 map={map}></Module3>
            )}</Module2>
          )}
          </Module1>
        )}
      </Map>
    )
  }
}

Publish to NPM

There are 4 scripts included in this repository for publishing - when you clone this repository you need to check that they are executable:

chmod +x ./scripts/*

If you don't already have an NPM account, create one! Then login from the root of the source code

npm login
# Enter your username
# Enter your password
# Enter your email address (probably best to use a work email address, since this is public)

This project uses semantic versioning. This means that package versioning is controlled by 3 numbers: major.minor.patch, which in the case of this project means:

  • major - Users should expect breaking changes
  • minor - Users should not expect breaking changes
  • patch - Minor changes, updates, improvements, etc.

With this in mind, 3 scripts are defined in the package.json file:

  • publish-patch - Patch version is bumped, and code is pushed to NPM
  • publish-minor - Minor version is bumped, and code is pushed to NPM
  • publish-major - Major version is bumped, and code is pushed to NPM

Running these scripts will provide CLI prompts that you need to answer, and then a new package version will be pushed to NPM. In all cases existing changes are committed prior to version bump, and then the code on that branch is packaged. Please don't push non-master branch changes to the NPM registry!! Unless otherwise intended, please run the publish-patch script (npm run publish-patch).

agentkeepaliveagent-baseabbrevansi-alignaprobaare-we-there-yetargparsebabel-plugin-polyfill-corejs2babel-plugin-dynamic-import-nodebabel-plugin-polyfill-regeneratorbabel-plugin-polyfill-corejs3buffer-frombrace-expansionbracesbrowserslistbuiltin-modulescacachecall-bindcamelcasecaniuse-litechownrcli-tableclone-responsecolor-namecolor-convertcommondircommanderconcat-mapconsole-control-stringsconvert-source-mapcore-js-compatcolor-supportcsscolorparserdebugdeepmergedeep-extenddefine-propertiesdelegatesdir-globduplexer3encodingelectron-to-chromiumend-of-streamesutilsfast-memoizefast-globfiggy-puddingfastqfill-rangefp-and-orfs.realpathfunction-bindfs-minipassgaugeget-intrinsicgensyncglobal-dirsgeotiffglobgraceful-fshashas-symbolshosted-git-infohas-unicodehttp-cache-semanticshttp-proxy-agenthttps-proxy-agenthumanize-msiconv-liteignoreieee754ignore-walkimurmurhashinflightinfer-ownerinheritsiniipis-core-moduleis-extglobis-globis-installed-globallyis-lambdais-numberis-typedarrayis-moduleisexejs-yamljjujson-parse-even-better-errorsjson5jsonlinesjson-parse-helpfulerrorjsonparselerclibnpmconfiglodashlodash.debounceloose-envifymagic-stringlru-cachemake-dirmerge2make-fetch-happenmapbox-to-css-fontmicromatchescalademinipassminipass-collectminimatchminimistminipass-sizedminizlibmsmkdirpnegotiatornode-releasesminipass-flushnoptnpm-bundlednpm-install-checksnpm-package-argnpm-normalize-package-binnpm-packlistnpm-pick-manifestminipass-json-streamnpmlognpm-registry-fetchobject-assignobject-keysobject.assignol-mapbox-styleoncepacoteparse-github-urlparse-headerspakopath-is-absoluteminipass-pipelinepath-parsepbfpicocolorsproc-logprogresspicomatchpromise-inflightpromise-retrypromptsprotocol-buffers-schemapumpqueue-microtaskquickselectrbushrc-config-loaderrcread-package-jsonread-package-json-fastreadable-streamregenerateregenerator-runtimerequire-from-stringregistry-auth-tokenresolveresolve-protobuf-schemaregenerator-transformnormalize-package-datarwreusifysafe-buffersafer-buffersemverset-blockingsemver-utilssignal-exitsisteransismart-buffersockssocks-proxy-agentsource-map-supportsourcemap-codecspawn-pleasespdx-correctspdx-exceptionsspdx-expression-parsespdx-license-idsstring_decodersupports-preserve-symlinks-flagtarto-regex-rangeunicode-canonical-property-names-ecmascriptssriunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunique-filenameunicode-match-property-ecmascriptunique-slugutil-deprecateweb-workerupdate-notifiervalidate-npm-package-namevalidate-npm-package-licensewebfont-matcherwide-alignwhichxml-utilswrappyyamlyallistrun-parallel
10.2.14

2 years ago

10.2.15

2 years ago

10.2.12

2 years ago

10.2.13

2 years ago

10.2.11

2 years ago

10.2.10

3 years ago

10.2.9

3 years ago

10.2.8

3 years ago

10.2.7

3 years ago

10.2.6

3 years ago

10.2.4

3 years ago

10.2.5

3 years ago

10.2.3

3 years ago

10.2.2

3 years ago

10.2.1

3 years ago

10.2.0

3 years ago

10.1.3

3 years ago

10.1.2

3 years ago

10.1.1

4 years ago

10.1.0

4 years ago

10.0.3

4 years ago

10.0.2

4 years ago

9.2.2

4 years ago

9.2.1

4 years ago

9.2.0

4 years ago

9.1.1

4 years ago

9.0.10

4 years ago

9.0.9

4 years ago

9.0.8

4 years ago

9.0.7

4 years ago

9.0.6

4 years ago

9.0.5

4 years ago

9.0.4

4 years ago

9.0.3

4 years ago

8.2.0

4 years ago

9.0.2

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago

8.0.1

4 years ago

7.7.0

4 years ago

8.0.0

4 years ago

7.6.0

4 years ago

7.5.0

4 years ago

7.4.0

4 years ago

7.1.32

4 years ago

7.3.0

4 years ago

7.1.5

4 years ago

7.1.4

4 years ago

7.1.3

4 years ago

7.1.2

4 years ago

7.1.0

4 years ago

7.0.0

4 years ago

6.1.9

4 years ago

6.1.4

4 years ago

6.1.3

4 years ago

6.1.6

4 years ago

6.1.5

4 years ago

6.1.8

4 years ago

6.1.7

4 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago