Skip to main content

addLogoImages

[
  "sdv-logo-mff7au-32"
]
import { loadLeague } from "@sportsdataverse/sdvplot";
import { addLogoImages, logoSymbols } from "@sportsdataverse/sdvplot/maplibre";

await loadLeague("nfl");
const logos = logoSymbols([{ team: "KC", lon: -94.714, lat: 39.297 }], { x: "lon", y: "lat", team: "team", league: "nfl" });
// a stand-in for a MapLibre map (in the browser: the map from `new maplibregl.Map(...)`, once it has loaded)
const added: string[] = [];
const map = {
hasImage: (id: string) => added.includes(id),
loadImage: async () => ({ data: { width: 500, height: 500 } as ImageBitmap }),
addImage(id: string) {
added.push(id);
return this;
},
};
await addLogoImages(map as never, logos);
added;

Tags: docstring · addLogoImages. All sdvplot examples.