MCPcopy
hub / github.com/visgl/deck.gl / getProjection

Function getProjection

modules/mapbox/src/deck-utils.ts:160–174  ·  view source on GitHub ↗
(map: Map)

Source from the content-addressed store, hash-verified

158}
159
160export function getProjection(map: Map): 'mercator' | 'globe' {
161 const projection = map.getProjection?.();
162 const type =
163 // maplibre projection spec
164 projection?.type ||
165 // mapbox projection spec
166 projection?.name;
167 if (type === 'globe') {
168 return 'globe';
169 }
170 if (type && type !== 'mercator') {
171 throw new Error('Unsupported projection');
172 }
173 return 'mercator';
174}
175
176export function getDefaultView(map: Map): GlobeView | MapView {
177 if (getProjection(map) === 'globe') {

Callers 2

MapboxOverlayClass · 0.90
getDefaultViewFunction · 0.85

Calls 1

getProjectionMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…