OsmFeatureAdd

A button that merges OpenStreetMap areas into 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. A merge 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 add for you.

A button that merges OpenStreetMap areas into 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. A merge 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 add for you.

Installation

import { OsmFeatureAdd } 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`.