Skip to content

mapcomponents/ra-geospatial

Repository files navigation

MapComponents logo

@mapcomponents/ra-geospatial

npm version License: MIT downloads downloads

Input and view components to work with geospatial data in react admin. This package is based on @mapcomponents/react-maplibre and uses MapLibre-gl to display geospatial data on a map.

RaGeospatialInput & RaGeospatialShow

RaGeospatialInput & RaGeospatialShow used to edit a polygon geometry in a react-admin application.

Demos

Installation

yarn add @mapcomponents/ra-geospatial

Exports

RaGeospatialInput

Input component to edit or create geospatial data.

RaGeospatialShow

Show component to display geospatial data.

Props

  • embeddedMap: boolean (default: false) - If true, the map will be embedded in the component. If false, the component will not create it's own MapContext and add a MapLibreMap component but instead expect a MapContext and a MapLibreMap component to be present in the parent component.

Examples

import {
  RaGeospatialInput,
  RaGeospatialShow,
} from "@mapcomponents/ra-geospatial";

export const PoiEdit = () => (
  <Edit>
    <SimpleForm>
      <TextInput source="title" />
      <TextInput source="geom" />
      <RaGeospatialInput source="geom" />
    </SimpleForm>
  </Edit>
);
export const PoiCreate = () => (
  <Create>
    <SimpleForm>
      <TextInput source="title" />
      <TextInput source="geom" />
      <RaGeospatialInput source="geom" />
    </SimpleForm>
  </Create>
);

export const PoiShow = () => (
  <Show>
    <SimpleShowLayout>
      <TextField source="id" />
      <TextField source="title" />
      <RaGeospatialShow source="geom" />
    </SimpleShowLayout>
  </Show>
);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published