Skip to main content

Vector sources in standard styles

A style vector source accepts url or tiles. Inline tiles starts tile requests directly without a separate TileJSON service. Save the following shape as Style JSON; replace tile endpoints and source-layer with the actual provider's values.

{
  "version": 8,
  "sources": {
    "roads": {
      "type": "vector",
      "tiles": ["https://tiles.example.com/{z}/{x}/{y}.pbf"],
      "scheme": "xyz",
      "minzoom": 0,
      "maxzoom": 14,
      "bounds": [-180, -85, 180, 85],
      "attribution": "© Data provider"
    }
  },
  "layers": [{
    "id": "roads", "type": "line", "source": "roads", "source-layer": "transportation",
    "paint": {"line-color": "#426f93", "line-width": 2}
  }]
}

Load the hosted JSON using a shared script:

// @gis-api 0.5-session
// @permissions ["project.read", "map.write"]
import { map } from 'sqsmap';
map.setStyle('https://your-site.example/style.json', { diff: false });
await map.sqs.flush();
console.log(await map.sqs.getCapabilities());
console.log(await map.sqs.getAttributions());

flush() confirms application, not completion of tile downloads. The raw browser SDK uses MapView, view.flush(), view.sqs.getCapabilities() and view.getAttributions(). Native libraries retain sqsm_map_set_style_json: {"style":"https://your-site.example/style.json","options":{"diff":false}}. Hosts poll resource requests, download within resource.maxBytes and submit responses. The core has no HTTP client.

Templates, bounds and overrides

  • url and tiles are mutually exclusive. Supply 1–8 templates, each at most 8192 bytes, including {z}, {x} and {y}. Relative templates resolve against the style or TileJSON URL, retaining query parameters. Canonical XYZ rows/columns deterministically select mirrors; world copies share resources.
  • scheme: "tms" flips requested rows while geometry and caches retain XYZ coordinates. Use scheme, not a literal {-y}. Other dynamic placeholders, MLT, promoteId and volatile: true remain unsupported and reject explicitly. encoding: "mvt" and volatile: false are supported.
  • minzoom/maxzoom are integers 0–24, default 0/22. Below the minimum, no tiles are requested or drawn. Above the maximum, existing overzoom applies. Fractional, negative and excessive levels cannot truncate or wrap.
  • bounds is [west, south, east, north], with longitude ±180 and latitude ±90; west greater than east expresses a date-line crossing. Nonintersecting tiles are neither requested nor drawn and do not block readiness. Bounds select tiles; they do not clip geometry within a tile.
  • With a fetched TileJSON, explicit style zoom limits, bounds and scheme take precedence. Remote values are still validated completely; invalid metadata preserves existing templates, limits, bounds and attribution. Existing attribution behavior remains: nonempty TileJSON credit replaces that source's credit without affecting root or other-source credits.

The same coverage and mirror selection apply to main threads, Workers, native maps and desktop offline packages. When observing readiness after style replacement, also wait for a new resource generation so an old ready cannot count as success.

Capabilities and scope

map.sqs.getCapabilities() reports styleVectorInlineTiles/styleVectorSourceTms/styleVectorSourceBounds/styleVectorSourceOverrides as true. vectorTileSourceStore is false: these are style sources; the shared vector-tile map.addSource/getSource/removeSource lifecycle remains pending. styleRasterSources is false; raster/DEM style sources remain in progress. setStyle currently accepts URLs or null; inline style objects and diff:true remain pending.

Complete HTML/CSS and every handler displays attribution, switches projections and demonstrates source coverage. It defaults to SqsMap's hosted compatible OpenFreeMap style with OpenFreeMap/OpenMapTiles/OpenStreetMap links. Supply your own style URL. A copied standalone HTML requires the deployed matching SDK, or a sdk parameter pointing to the local preview. Local build success does not imply remote deployment.

Evidence includes actual native resource queues/five software GPU frames, browser main-thread/strict Worker requests/twelve actual frames, the same read-only script on four hosts and existing OpenFreeMap compilation regressions. Windows/macOS, mobile hosts and formal releases require separate acceptance.

Shared tile URL templates extend quadkey, bbox, prefix, ratio and actual density changes. Earlier batch evidence remains historical; full source parameters remain separately pending.

Effective tile metadata documents current overrides, actual sizing/DEM decoding and accepted data during refresh waits/failures. Earlier evidence is not relabeled.