@grafana/ui
Version:
Grafana Components Library
1 lines • 1.27 kB
Source Map (JSON)
{"version":3,"file":"OpenLayersProvider.mjs","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":[],"mappings":";;;;;;AASO,SAAS,kBAAA,CAAmB,EAAE,QAAA,EAAS,EAAU;AACtD,EAAA,MAAM,MAAM,OAAA,CAAQ,MAAM,IAAI,GAAA,EAAI,EAAG,EAAE,CAAA;AACvC,EAAA,MAAM,KAAA,GAAQ,OAAA;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,uBAAO,GAAA,CAAC,iBAAA,CAAkB,QAAA,EAAlB,EAA2B,OAAe,QAAA,EAAS,CAAA;AAC7D;;;;"}