修改代码

This commit is contained in:
ival 2019-07-19 09:40:22 +08:00
parent e3341dcd04
commit fcd9f7dad4
4 changed files with 9 additions and 9 deletions

View File

@ -136,8 +136,8 @@ class Jmap {
if (this.methods.optionsUpdate instanceof Function) { this.methods.optionsUpdate(); }
}
setLevelInvisible(list) {
this.$painter.setLevelInvisible(list);
setLevelVisible(list, show) {
this.$painter.setLevelVisible(list, show);
}
render(list) {

View File

@ -32,10 +32,10 @@ class MouseController extends Eventful {
super();
this.events = jmap.getEvents();
this.$zr = jmap.getZr();
this.initController(this.$zr);
this.initHandler(this.$zr);
}
initController(zr) {
initHandler(zr) {
if (zr) {
const clickHandler = this.click.bind(this);
const contextmenuHandler = this.contextmenu.bind(this);

View File

@ -101,16 +101,16 @@ class Painter {
}
/**
* 设置图层显隐
* 设置图层可见
* @param {*} code
*/
setLevelInvisible(list) {
setLevelVisible(list, show) {
zrUtil.each(Object.values(deviceType), type => {
const level = this.mapInstanceLevel[type];
if (list.includes(type)) {
level.hide();
show ? level.show() : level.hide();
} else {
level.show();
show ? level.hide() : level.show();
}
});
}

View File

@ -57,7 +57,7 @@ export default {
getPublishMapDetail('03').then(resp => {
this.jmap.load(resp.data);
// this.jmap.setDefaultState();
this.jmap.setLevelInvisible([deviceType.Link]);
this.jmap.setLevelVisible([deviceType.Link], false);
});
// this.jmap.render([