GISTDA Sphere React

Interactive playground

Docs
Zoom –Rotation –Pitch –
Center–

Base map

Map labels

Changes the label language in place, without reloading the map.

Color filter

Dark/light themes and color-blind friendly palettes.

View

Fly to

Zoom limits

The zoomRange prop. Users can't zoom past these levels.

Data layers

Overlays from Sphere. Some only have data in certain seasons.

Live overlays

Real-time data, loaded with <PredefinedOverlay>.

Advanced layers

MapLibre styles, WMS, 3D tiles and deck.gl layers through <Layer>. Sample data: MapLibre, Longdo, Cesium, deck.gl and Khronos.

Map controls

Built-in controls via the controls prop. Custom adds a <MapControl> (top left) and a <MenuBar> (bottom left).

Interaction

Right-click the map for its menu. The lock covers the map until clicked, so pages scroll past it.

Tools

Pick a tool, then click the map. With no tool, clicking the map shows the coordinates.

Style

Color, width and line style update shapes in place, without re-creating them.

Shapes (0)

Nothing drawn yet.

Spatial analysis

Draw at least two shapes to compare them.

Uses the spatial methods on shape refs. Results are drawn in red.

Import data

WKT, KML and GPX are converted with useSphereUtils, which loads Sphere's converters on demand.

Show your own data on the map with <GeoJson>.

Search

Suggestions appear as you type (useSearch().suggest).

Around the map center

Nearby places use useSearch().nearPoi. Addresses need the address service on your key.

POI tags

Loading…

Food & Dining(10)
Services(4)
Tourism(4)

Show places by category with <Tag>. The list is loaded live with useTagCategories.

Stops (0)

Stops are Sphere route markers: drag them on the map, or click one to remove it.

Travel mode

The fastest route, avoiding traffic jams with live and predicted traffic.

Options

Labels on the route

Auto re-route recalculates when stops change or are dragged. Right-click routing adds route items to the map menu.

Route

Add at least two stops.

Sphere's route guide

<RouteGuide> renders Sphere's own turn-by-turn panel. It also turns on auto re-routing.

Location

13.75630, 100.50180

The web services below are asked about this point. It's shown on the map while this tab is open.

Web services

Province, district, subdistrict and road at the point.

Calls go through createSphereServices (useSphereServices), with no map needed. Each service must be enabled for your API key.

Static & embed maps

Static map of the selected location
Open embed map

Map images from the static map service: handy for emails, PDFs and link previews.

Tile URLs

  • Raster tiles (XYZ)
    https://basemap.sphere.gistda.or.th/tiles/sphere_streets/EPSG3857/{z}/{x}/{y}.jpeg?key=YOUR_API_KEY
  • Vector tiles
    https://basemap.sphere.gistda.or.th/maps/sphere/{z}/{x}/{y}.pbf?key=YOUR_API_KEY
  • Vector style (MapLibre)
    https://basemap.sphere.gistda.or.th/vector/sphere_streets.json
  • WMTS capabilities
    https://basemap.sphere.gistda.or.th/service?key=YOUR_API_KEY

Use Sphere base maps in other map libraries. Replace YOUR_API_KEY with your key.

Events (0)

Interact with the map to see its events here.

Every SphereMap event prop is logged. Fast, continuous events (mouse moves, zoom, tiles…) only show in verbose mode.