Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

gaving/searchkit-geomap

Repository files navigation

searchkit-geomap

npm

build status

Map component for Searchkit

searchkit-geomap

Installation

yarn add searchkit-geomap --save

Features

  • GeoMap : Display aggregations on a MapGL map using Mapbox with react-map-gl.

Example

import React, { Component } from "react";
import { GeoMap } from "searchkit-geomap";

const host = "http://demo.searchkit.co/api/crimes";
const searchkit = new SearchkitManager(host);
const opts = {
  width: 800,
  height: 600,
  latitude: 37.7577,
  longitude: -122.4376,
  mapboxApiAccessToken: "key"
};

class Demo extends Component {
  render() {
    return (
      <SearchkitProvider searchkit={searchkit}>
        <Layout>
          <TopBar>
            <SearchBox autofocus={true} searchOnChange={false} />
          </TopBar>
          <LayoutBody>
            <LayoutResults>
              <GeoMap {...opts} />
            </LayoutResults>
          </LayoutBody>
        </Layout>
      </SearchkitProvider>
    );
  }
});

render(<Demo />, document.querySelector("#demo"));

Development

  • git clone https://github.com/gaving/searchkit-geomap.git
  • yarn
  • yarn start

License

MIT

Releases

No releases published

Packages