From d14b4788a1c0889b9f0be260b58d2f396cb766cb Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Thu, 16 Sep 2021 20:46:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=81=A2=E5=A4=8D=20province/layer=20c?= =?UTF-8?q?ontrol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/component/src/control/layer.ts | 2 +- stories/Components/components/Scale.tsx | 37 ++++--------------------- stories/District/Layer/province.tsx | 10 ++----- 3 files changed, 10 insertions(+), 39 deletions(-) diff --git a/packages/component/src/control/layer.ts b/packages/component/src/control/layer.ts index f921478f0f..06169079f8 100644 --- a/packages/component/src/control/layer.ts +++ b/packages/component/src/control/layer.ts @@ -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); }); } diff --git a/stories/Components/components/Scale.tsx b/stories/Components/components/Scale.tsx index 615aa97ff2..1f2061f41f 100644 --- a/stories/Components/components/Scale.tsx +++ b/stories/Components/components/Scale.tsx @@ -81,7 +81,7 @@ export default class ScaleComponent extends React.Component { pointLayer.on('mouseout', (e) => { console.log(2, e); }); - // const scaleControl = new Scale(); + const scaleControl = new Scale(); const layers = { 点图层: pointLayer, 面图层: layer, @@ -91,37 +91,12 @@ export default class ScaleComponent extends React.Component { position: 'bottomright', }); - // scene.addControl(scaleControl); + scene.addControl(scaleControl); scene.addControl(layerControl); - // const zoomControl = new Zoom({ - // position: 'bottomright', - // }); - // scene.addControl(zoomControl); - - setTimeout(() => { - const pointLayer3 = new PointLayer({ - name: '02', - enablePropagation: true, - }) - .source(pointsData, { - cluster: true, - }) - .shape('circle') - .scale('point_count', { - type: 'quantile', - }) - .size('point_count', [3]) - .animate(false) - .active(false) - .color('red') - .style({ - opacity: 0.5, - strokeWidth: 1, - }); - scene.addLayer(pointLayer3); - - layerControl.addVisualLayer(pointLayer3, 'pointLayer3'); - }, 2000); + const zoomControl = new Zoom({ + position: 'bottomright', + }); + scene.addControl(zoomControl); } public render() { diff --git a/stories/District/Layer/province.tsx b/stories/District/Layer/province.tsx index 1226a0d852..4a634fcce5 100644 --- a/stories/District/Layer/province.tsx +++ b/stories/District/Layer/province.tsx @@ -219,7 +219,7 @@ export default class Country extends React.Component { data, geoDataLevel: 1, joinBy: ['adcode', 'code'], - adcode: [province], + adcode: [], stroke: '#7096B3', depth: 2, showBorder: false, @@ -244,7 +244,7 @@ export default class Country extends React.Component { return ( <>