MCPcopy Index your code
hub / github.com/visgl/react-map-gl / createSource

Function createSource

modules/react-mapbox/src/components/source.ts:27–38  ·  view source on GitHub ↗
(map: MapInstance, id: string, props: SourceProps)

Source from the content-addressed store, hash-verified

25let sourceCounter = 0;
26
27function createSource(map: MapInstance, id: string, props: SourceProps) {
28 // @ts-ignore
29 if (map.style && map.style._loaded) {
30 const options = {...props};
31 delete options.id;
32 delete options.children;
33 // @ts-ignore
34 map.addSource(id, options);
35 return map.getSource(id);
36 }
37 return null;
38}
39
40/* eslint-disable complexity */
41function updateSource(source: AnySourceImplementation, props: SourceProps, prevProps: SourceProps) {

Callers 1

SourceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…