Function: logoIconLayer()
logoIconLayer(
rows,o):LogoIconLayerProps
Defined in: packages/sdvplot/src/deckgl.ts:216
deck.gl IconLayer props drawing each row's team logo at its (x, y). The logos are auto-packed icons: deck.gl
fetches each URL once and packs it into its own atlas, at 128 px tall and the logo's aspect, centred on the point.
A team with no logo (or one that does not resolve) is left out with one warning, as the other adapters do; so is a
row with a missing x or y. x and y are in the layer's coordinates: longitude and latitude on a map, or a
surface's own units on surfaceLayer (set coordinateSystem: "cartesian" on both, or use a non-geographic view).
Parameters
rows
readonly Row[]
o
Returns
Example
import { loadLeague } from "@sportsdataverse/sdvplot";
import { logoIconLayer } from "@sportsdataverse/sdvplot/deckgl";
await loadLeague("nhl");
// Edmonton's first shot of game 7 of the 2024 Stanley Cup Final (NHL api-web), in feet from centre ice
const shot = { team: "EDM", x: 82, y: -3 };
const props = logoIconLayer([shot], { x: "x", y: "y", team: "team", league: "nhl", size: 28 });
// in the browser: new IconLayer({ ...props, coordinateSystem: "cartesian" })
props.data[0]?.icon.url;