gistda-sphere-react

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.

Loading categories…0 on

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

PropTypeDescription
namestringRequired. 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.
visibleRangeRangeZoom levels where the POIs show.
labelRange | booleanZoom levels where names show, or true to show them across visibleRange.
icon"big" | "small" | IconBigger or smaller default icons, or your own image icon.
areastringOnly show POIs inside this area (geocode), e.g. "10" for Bangkok.
datasetstringPOI dataset to use.
type"WFS" | "OGC"Load features from your own WFS or OGC API service instead.
sourcestringService URL for type, or another tag server.
versionstringWFS version (default 2.0.0).
extraQuerystringExtra 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.

On this page