From 2926971b318531d52c99a84cd7d4dd8ea0c5db96 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Mon, 26 Aug 2019 15:36:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20removelayer=20=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E4=BA=A4=E4=BA=92=E4=BA=8B=E4=BB=B6=E7=9A=84bug=20fix?= =?UTF-8?q?=20demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demos/01_circle.html | 3 +-- demos/01_point_circle.html | 9 +++++---- src/core/layer.js | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/demos/01_circle.html b/demos/01_circle.html index cb43185a1b..3236c5aa79 100644 --- a/demos/01_circle.html +++ b/demos/01_circle.html @@ -47,7 +47,7 @@ opacity: 0.9 }).render(); - scene.TextLayer({ + const layer2 = scene.PointLayer({ zIndex: 5 }) .source(data) @@ -73,7 +73,6 @@ - const popup = new L7.Popup({anchor:'left'}).setText('hello world') const marker = new L7.Marker({color:'blue'}) .setLnglat( [120.19382669582967, 30.258134]) diff --git a/demos/01_point_circle.html b/demos/01_point_circle.html index 8014217389..dd49aafa4c 100644 --- a/demos/01_point_circle.html +++ b/demos/01_point_circle.html @@ -54,7 +54,7 @@ window.scene = scene; scene.on('loaded', () => { $.get('https://gw.alipayobjects.com/os/rmsportal/epnZEheZeDgsiSjSPcCv.json', data => { console.log(data); - const circleLayer = = scene.PointLayer({ + const circleLayer = scene.PointLayer({ zIndex: 0, }) .source(data,{ @@ -70,8 +70,8 @@ scene.on('loaded', () => { opacity: 1 }) .render(); - - scene.TextLayer({ + + scene.PointLayer({ zIndex: 5 }) .source(circleLayer.layerSource) @@ -91,7 +91,8 @@ scene.on('loaded', () => { }) .render(); -}); + + }); }); diff --git a/src/core/layer.js b/src/core/layer.js index 6a1250b82e..a4c37c6000 100644 --- a/src/core/layer.js +++ b/src/core/layer.js @@ -608,7 +608,7 @@ export default class Layer extends Base { */ destroy() { this.removeAllListeners(); - this.clearAllInteractions(); + this.get('interacionController').clearAllInteractions(); this.clearMapEvent(); if (this._object3D.type === 'composer') { this.remove(this._object3D); @@ -639,7 +639,6 @@ export default class Layer extends Base { } } this.layerMesh.geometry = null; - this.layerMesh.material.dispose(); this.layerMesh.material = null; if (this._pickingMesh) { this._pickingMesh.children[0].geometry = null;