feat: test open layer initLayer update

This commit is contained in:
2912401452 2021-09-16 17:36:14 +08:00
parent e99ea7d8b3
commit e2a78cbc96
5 changed files with 7 additions and 7 deletions

View File

@ -135,7 +135,7 @@ export default class Layers extends Control {
this.addLayer(baseLayers[name], name, false);
});
Object.keys(overlayers).forEach((name: any, index: number) => {
// overlayers[name].once('inited', this.update);
overlayers[name].once('inited', this.update);
this.addLayer(overlayers[name], name, true);
});
}

View File

@ -2,6 +2,7 @@ import { decodePickingColor, DOM, encodePickingColor } from '@antv/l7-utils';
import { inject, injectable } from 'inversify';
import 'reflect-metadata';
import { TYPES } from '../../types';
import { isEventCrash } from '../../utils/dom';
import { IGlobalConfigService, ISceneConfig } from '../config/IConfigService';
import {
IInteractionService,
@ -14,7 +15,6 @@ import { gl } from '../renderer/gl';
import { IFramebuffer } from '../renderer/IFramebuffer';
import { IRendererService } from '../renderer/IRendererService';
import { IPickingService } from './IPickingService';
import { isEventCrash } from '../../utils/dom'
@injectable()
export default class PickingService implements IPickingService {

View File

@ -43,4 +43,4 @@ export function isEventCrash(obj: any) {
}
});
return notCrash;
}
}

View File

@ -120,8 +120,8 @@ export default class ScaleComponent extends React.Component {
});
scene.addLayer(pointLayer3);
layerControl.addVisualLayer(pointLayer3, 'pointLayer3')
}, 2000)
layerControl.addVisualLayer(pointLayer3, 'pointLayer3');
}, 2000);
}
public render() {

View File

@ -254,7 +254,7 @@ export default class Country extends React.Component {
}}
// onChange={this.handleProvinceChange}
onChange={() => {
console.log('change')
console.log('change');
}}
>
{ProvinceData.map((province, i) => {
@ -283,7 +283,7 @@ export default class Country extends React.Component {
this.setState({
province: value,
});
console.log('value', value)
console.log('value', value);
this.provinceLayer.updateDistrict([value]);
};
}