修改代码
This commit is contained in:
parent
e3341dcd04
commit
fcd9f7dad4
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -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([
|
||||
|
Loading…
Reference in New Issue
Block a user