Getting Started
Documentation WIP
See Storybook for available features with examples and code in the meantime while we update the documentation here.
Installation
Install via your preferred package manager
npm i @react-gis/openlayersBasic Usage
Basic map with OpenStreetMap:
import { View } from "ol";
import { OSM } from "ol/source";
import { TileLayer } from "@react-gis/openlayers/layer";
import { Map } from "@react-gis/openlayers/map";
import "ol/ol.css";
function App() {
return (
<Map
mapOptions={{ view: new View({ center: [0, 0], zoom: 4 }) }}
style={{ width: "100%", height: "100%" }}
>
<TileLayer name="osm" source={new OSM()} />
</Map>
);
}