UNPKG

vue-tianditu2

Version:
1 lines 1.76 kB
{"version":3,"file":"state.mjs","sources":["../../../../../packages/service/route/use/state.ts"],"sourcesContent":["import { inject, reactive } from \"vue\";\nimport type { DrivingState, RouteState, SearchState, TransitState } from \"../types\";\n\nexport function useState() {\n const searchState: SearchState = {\n tdtMap: null,\n localSearch: null,\n startKeyword: \"\",\n startMarker: null,\n endKeyword: \"\",\n endMarker: null,\n routeType: 0,\n poiType: \"start\",\n pois: [],\n current: 1,\n total: 0\n };\n const drivingState: DrivingState = {\n drivingRoute: null,\n drivingLines: [],\n drivingPolicy: 0,\n drivingPlans: [],\n drivingPlanIndex: 0\n };\n const transitState: TransitState = {\n transitRoute: null,\n transitPlans: [],\n transitPlanIndex: 0,\n transitPolicy: 1,\n walkLines: [],\n busLines: [],\n busMarkers: [],\n metroMarkers: []\n };\n\n return inject<RouteState>(\"routeState\", () => reactive({ ...searchState, ...drivingState, ...transitState }), true);\n}\n"],"names":["useState","searchState","drivingState","transitState","inject","reactive"],"mappings":";AAGO,SAASA,IAAW;AACzB,QAAMC,IAA2B;AAAA,IAC/B,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,cAAc;AAAA,IACd,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,IACX,SAAS;AAAA,IACT,MAAM,CAAC;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,EACT,GACMC,IAA6B;AAAA,IACjC,cAAc;AAAA,IACd,cAAc,CAAC;AAAA,IACf,eAAe;AAAA,IACf,cAAc,CAAC;AAAA,IACf,kBAAkB;AAAA,EACpB,GACMC,IAA6B;AAAA,IACjC,cAAc;AAAA,IACd,cAAc,CAAC;AAAA,IACf,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,WAAW,CAAC;AAAA,IACZ,UAAU,CAAC;AAAA,IACX,YAAY,CAAC;AAAA,IACb,cAAc,CAAA;AAAA,EAChB;AAEA,SAAOC,EAAmB,cAAc,MAAMC,EAAS,EAAE,GAAGJ,GAAa,GAAGC,GAAc,GAAGC,EAAc,CAAA,GAAG,EAAI;AACpH;"}