Tag
Show points of interest by category, or features from your own WFS and OGC API services
<Tag> shows a layer of points of interest (POIs) while it's mounted. Sphere has about 260 tags in 20 categories, such as banks, hospitals, temples and cafés.
import { SphereMap, Tag } from "gistda-sphere-react";
<SphereMap>
<Tag name="โรงพยาบาล" />
<Tag name="วัด,พิพิธภัณฑ์" visibleRange={{ min: 12, max: 22 }} />
</SphereMap>Tags are identified by their Thai names, such as "โรงพยาบาล" (hospitals), "ธนาคาร/สถาบันการเงิน" (banks) or "อาหารไทย" (Thai food). Use useTagCategories for the full list with English labels. A few tags also accept English aliases, such as "ATM" and "Hotel".
Props
| Prop | Type | Description |
|---|---|---|
name | string | Required. A tag name. Separate several names with commas for one layer or with | for separate layers, or use "%" for all POIs. For WFS/OGC sources, the name of the data layer or collection. |
visibleRange | Range | Zoom levels where the POIs show. |
label | Range | boolean | Zoom levels where names show, or true to show them across visibleRange. |
icon | "big" | "small" | Icon | Bigger or smaller default icons, or your own image icon. |
area | string | Only show POIs inside this area (geocode), e.g. "10" for Bangkok. |
dataset | string | POI dataset to use. |
type | "WFS" | "OGC" | Load features from your own WFS or OGC API service instead. |
source | string | Service URL for type, or another tag server. |
version | string | WFS version (default 2.0.0). |
extraQuery | string | Extra query string for WFS/OGC requests. |
Any other prop is passed to Sphere's Tags.add. For WFS/OGC sources these are deck.gl GeoJsonLayer props, such as getLineWidth or pickable.
Your own WFS or OGC API data
import { Tag } from "gistda-sphere-react";
<Tag
name="StructurePnt"
type="OGC"
source="https://services.interactive-instruments.de/t15/daraa"
getLineWidth={5}
lineWidthUnits="pixels"
/>Popups
Clicking a POI opens Sphere's popup with the place's details. Turn them off with useTags().enablePopup(false), or customize them with SphereProvider's formatPoi.
To add and remove tags imperatively, see useTags.