{"version":3,"file":"init.mjs","sources":["../../../../packages/map/use/init.ts"],"sourcesContent":["import { toLngLat } from \"~/utils/converter\";\r\nimport type { Props } from \"./\";\r\n\r\nexport function useInit(props: Props, dom?: HTMLElement) {\r\n  const { mid, projection, minZoom, maxZoom, center, zoom } = props;\r\n  const instance = new T.Map(dom ?? mid, {\r\n    projection,\r\n    minZoom,\r\n    maxZoom,\r\n    center: toLngLat(center),\r\n    zoom\r\n  });\r\n  instance.centerAndZoom(toLngLat(center), zoom);\r\n  return instance;\r\n}\r\n"],"names":["useInit","props","dom","mid","projection","minZoom","maxZoom","center","zoom","instance","toLngLat"],"mappings":";AAGgB,SAAAA,EAAQC,GAAcC,GAAmB;AACvD,QAAM,EAAE,KAAAC,GAAK,YAAAC,GAAY,SAAAC,GAAS,SAAAC,GAAS,QAAAC,GAAQ,MAAAC,MAASP,GACtDQ,IAAW,IAAI,EAAE,IAAIP,KAAOC,GAAK;AAAA,IACrC,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAQI,EAASH,CAAM;AAAA,IACvB,MAAAC;AAAA,EAAA,CACD;AACD,SAAAC,EAAS,cAAcC,EAASH,CAAM,GAAGC,CAAI,GACtCC;AACT;"}