@grafana/ui
Version:
Grafana Components Library
1 lines • 1.32 kB
Source Map (JSON)
{"version":3,"file":"OpenLayersProvider.cjs","sources":["../../../../../src/components/Table/geo/OpenLayersProvider.tsx"],"sourcesContent":["import WKT from 'ol/format/WKT';\nimport { type ReactNode, useMemo } from 'react';\n\nimport { OpenLayersContext, type OpenLayersContextValue } from './OpenLayersContext';\n\ninterface Props {\n children: ReactNode;\n}\n\nexport function OpenLayersProvider({ children }: Props) {\n const wkt = useMemo(() => new WKT(), []);\n const value = useMemo<OpenLayersContextValue>(\n () => ({\n formatGeometry: (geometry) =>\n wkt.writeGeometry(geometry, {\n featureProjection: 'EPSG:3857',\n dataProjection: 'EPSG:4326',\n }),\n }),\n [wkt]\n );\n\n return <OpenLayersContext.Provider value={value}>{children}</OpenLayersContext.Provider>;\n}\n"],"names":["useMemo","WKT","jsx","OpenLayersContext"],"mappings":";;;;;;;;;;;;;;AASO,SAAS,kBAAA,CAAmB,EAAE,QAAA,EAAS,EAAU;AACtD,EAAA,MAAM,MAAMA,aAAA,CAAQ,MAAM,IAAIC,oBAAA,EAAI,EAAG,EAAE,CAAA;AACvC,EAAA,MAAM,KAAA,GAAQD,aAAA;AAAA,IACZ,OAAO;AAAA,MACL,cAAA,EAAgB,CAAC,QAAA,KACf,GAAA,CAAI,cAAc,QAAA,EAAU;AAAA,QAC1B,iBAAA,EAAmB,WAAA;AAAA,QACnB,cAAA,EAAgB;AAAA,OACjB;AAAA,KACL,CAAA;AAAA,IACA,CAAC,GAAG;AAAA,GACN;AAEA,EAAA,uBAAOE,cAAA,CAACC,mCAAA,CAAkB,QAAA,EAAlB,EAA2B,OAAe,QAAA,EAAS,CAAA;AAC7D;;;;"}