40 lines
1.5 KiB
JavaScript
40 lines
1.5 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const tslib_1 = require("tslib");
|
|
const selectionRewriter_1 = require("../utils/selectionRewriter");
|
|
const oak_common_aspect_1 = require("oak-common-aspect");
|
|
const amap_1 = tslib_1.__importDefault(require("oak-common-aspect/lib/map/amap"));
|
|
const mapWorld_1 = tslib_1.__importDefault(require("oak-common-aspect/lib/map/mapWorld"));
|
|
let mapService;
|
|
const startRoutines = [
|
|
{
|
|
name: '注入对合并的user的selection的改写',
|
|
routine: async (context) => {
|
|
context.rowStore.registerSelectionRewriter(selectionRewriter_1.rewriteSelection);
|
|
context.rowStore.registerOperationRewriter(selectionRewriter_1.rewriteOperation);
|
|
return {};
|
|
},
|
|
},
|
|
{
|
|
name: '注入common-aspect取MapService逻辑',
|
|
routine: async () => {
|
|
(0, oak_common_aspect_1.registerGetMapService)((context) => {
|
|
if (mapService) {
|
|
return mapService;
|
|
}
|
|
const application = context.getApplication();
|
|
const { config } = application.system;
|
|
if (config.Map?.mapWorld) {
|
|
mapService = new mapWorld_1.default(config.Map.mapWorld.webApiKey);
|
|
}
|
|
else if (config.Map?.amaps) {
|
|
mapService = new amap_1.default(config.Map.amaps);
|
|
}
|
|
return mapService;
|
|
});
|
|
return {};
|
|
},
|
|
}
|
|
];
|
|
exports.default = startRoutines;
|