我无法对地图和图形进行居中定位并覆盖这两层。我对position:relative和position:absolute有点困惑。
selectedModel: Controllermodel[] = [];
roleId: number;
constructor() {
this.router.params.subscribe(data => {
this.roleId = +this.router.snapshot.paramMap.get('id');
})
onChangeValue(event, controllerId: string, actionId: number) {
var test = this.selectedModel.find(x => x.controllerId === controllerId);
if (test) {
var findActionId = test.actionsVM.find(x => x.actionId === actionId);
const Index = test.actionsVM.indexOf(findActionId);
if (Index != -1) {
test.actionsVM.splice(Index, 1);
} else {
test.actionsVM.push({ actionEnglishName: null, actionId: actionId, displayName: null });
}
} else {
this.selectedModel.push({
controllerId: controllerId,
roleId: this.roleId,
controllerDisplayName: null,
controllerFarsiName: null,
actionsVM: [{
actionEnglishName: null,
actionId: actionId,
displayName: null
}]
});
}
console.log(this.selectedModel)
}
这是一个小提琴: