@react-gis/openlayers
v1.1.3
Published
React components and hooks for OpenLayers
Maintainers
Readme
ReactGIS - @react-gis/openlayers
React wrapper for OpenLayers.
Getting Started
Installation
Install via your preferred package manager
npm i @react-gis/openlayerspnpm add @react-gis/openlayersyarn add @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>
);
}