Map component for Searchkit
yarn add searchkit-geomap --save
- GeoMap : Display aggregations on a MapGL map using Mapbox with react-map-gl.
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"));
git clone https://github.com/gaving/searchkit-geomap.git
yarn
yarn start
MIT