Skip to content
forked from Bayer-Group/ol-kit

Easy to use, open source React/Openlayers component toolkit.

License

Notifications You must be signed in to change notification settings

rwithers/ol-kit

 
 

Repository files navigation

ol-kit

Easy to use, open source React/Openlayers component toolkit.

Getting Started

It's easy to start building map apps with ol-kit. For simple projects the following will get you started:

import React from 'react'
import { Map, Popup, Controls, zoomToExtent } from '@bayer/ol-kit'

import VectorLayer from 'ol/layer/Vector'
import VectorSource from 'ol/source/Vector'

class App extends React.Component {
  onMapInit = map => {
    const data = new VectorLayer({
      source: new VectorSource({
        features: [/** Get some data and have fun with it */]
      })
    })

    // add the data to the map
    map.addLayer(data)

    // quickly take the map
    zoomToExtent([0, 0], 12)
  }

  render () {
    return (
      <Map onMapInit={this.onMapInit}>
        <Popup />
        <Controls />
      </Map>
    )
  }

About

Easy to use, open source React/Openlayers component toolkit.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 89.3%
  • HTML 10.7%