OsmFeatureSubtract

A button that removes OpenStreetMap areas, such as the water in a delivery area, from the Polygon or MultiPolygon held in source, queried from Overpass by presets and tags. The request runs on the click, and the result is written like a user edit, so the form turns dirty and the field's validators run. Areas that cover the value entirely clear the field to null, and a cut that would leave a Polygon as several pieces is refused with a warning and the value is left as it was. Needs an Overpass provider, from provider or MapsProvider. It is OsmFeatureOperator with mode set to subtract for you.

A button that removes OpenStreetMap areas, such as the water in a delivery area, from the Polygon or MultiPolygon held in source, queried from Overpass by presets and tags. The request runs on the click, and the result is written like a user edit, so the form turns dirty and the field's validators run. Areas that cover the value entirely clear the field to null, and a cut that would leave a Polygon as several pieces is refused with a warning and the value is left as it was. Needs an Overpass provider, from provider or MapsProvider. It is OsmFeatureOperator with mode set to subtract for you.

Installation

import { OsmFeatureSubtract } from "@chelone/react/maps/osm";

See the maps guide for the subpaths, the optional packages and MapsProvider.

Props

PropTypeDefaultDescription
classNamestring—
disabledboolean—
iconReactNode—
labelReactNode—The button text. A string is translated. Defaults to the mode's message.
presetsreadonly "water" | "natural" | "waterway" | "building" | "forest" | "landuse" | "roads" | "highway" | "amenity" | "leisure" | "boundary" | "place" | "man_made" | "shop" | "tourism" | "historic" | "railway" | "barrier" | "power" | "buildings"[]—Named OSM feature sets to query, such as `water`.
providerOverpassProvider—Defaults to the `overpass` of `MapsProvider`. One of the two is required.
sourceSourceProp<TRecord>—The form field holding the Polygon or MultiPolygon.
tagsreadonly templateLiteral[]—Extra Overpass tag filters, such as `natural=wood`.