From 90c86832690592d2e94c250a6d07191fba91444a Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 1 Jun 2021 20:14:19 +0800 Subject: [PATCH 01/12] feat: chenge git head --- packages/component/package.json | 2 +- packages/core/package.json | 2 +- packages/l7/package.json | 2 +- packages/layers/package.json | 2 +- packages/map/package.json | 2 +- packages/maps/package.json | 2 +- packages/renderer/package.json | 2 +- packages/scene/package.json | 2 +- packages/source/package.json | 2 +- packages/three/package.json | 2 +- packages/utils/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index 62254315a2..d339c05945 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -32,7 +32,7 @@ "inversify": "^5.0.1", "load-styles": "^2.0.0" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/core/package.json b/packages/core/package.json index d4ea822ea4..e3ed8363a0 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "@types/lodash": "^4.14.138", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/l7/package.json b/packages/l7/package.json index d2ef526ada..3ceeedf170 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -33,7 +33,7 @@ "@antv/l7-utils": "^2.4.1", "@babel/runtime": "^7.7.7" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/layers/package.json b/packages/layers/package.json index d0b29d5fe1..f90619b144 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -53,7 +53,7 @@ "@types/gl-matrix": "^2.4.5", "@types/lodash": "^4.14.138" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/map/package.json b/packages/map/package.json index 1f0d794546..8e77d70e3b 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -44,5 +44,5 @@ "eventemitter3": "^4.0.4", "lodash": "^4.17.15" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83" + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd" } diff --git a/packages/maps/package.json b/packages/maps/package.json index d3a5051748..1e9f46c70b 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -43,7 +43,7 @@ "@types/gl-matrix": "^2.4.5", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 8bff166e19..9419fd6991 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -33,7 +33,7 @@ "reflect-metadata": "^0.1.13", "regl": "^1.6.1" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/scene/package.json b/packages/scene/package.json index 9214c4950e..d12289d9da 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -34,7 +34,7 @@ "mapbox-gl": "^1.2.1", "reflect-metadata": "^0.1.13" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/source/package.json b/packages/source/package.json index b3c31d89c7..96d1a37f61 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -45,7 +45,7 @@ "@types/d3-hexbin": "^0.2.3", "@types/lodash": "^4.14.138" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/three/package.json b/packages/three/package.json index d980306459..3076e1ad6c 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -53,7 +53,7 @@ "devDependencies": { "three": "^0.115.0" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 84f5db92a3..6a76ad3943 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/d3-color": "^1.2.2" }, - "gitHead": "488447e4f819c80c3325bd7a6c25d276fe868f83", + "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", "publishConfig": { "access": "public" } From f2d0f2f45853686f170369943a355d259581240b Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 1 Jun 2021 20:27:32 +0800 Subject: [PATCH 02/12] feat: change githead again --- packages/component/package.json | 2 +- packages/core/package.json | 2 +- packages/l7/package.json | 2 +- packages/layers/package.json | 2 +- packages/map/package.json | 2 +- packages/maps/package.json | 2 +- packages/renderer/package.json | 2 +- packages/scene/package.json | 2 +- packages/source/package.json | 2 +- packages/three/package.json | 2 +- packages/utils/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index d339c05945..c8ed7adadf 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -32,7 +32,7 @@ "inversify": "^5.0.1", "load-styles": "^2.0.0" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/core/package.json b/packages/core/package.json index e3ed8363a0..8809b4f150 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "@types/lodash": "^4.14.138", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/l7/package.json b/packages/l7/package.json index 3ceeedf170..6079908089 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -33,7 +33,7 @@ "@antv/l7-utils": "^2.4.1", "@babel/runtime": "^7.7.7" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/layers/package.json b/packages/layers/package.json index f90619b144..61d3ef0b71 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -53,7 +53,7 @@ "@types/gl-matrix": "^2.4.5", "@types/lodash": "^4.14.138" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/map/package.json b/packages/map/package.json index 8e77d70e3b..748758c634 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -44,5 +44,5 @@ "eventemitter3": "^4.0.4", "lodash": "^4.17.15" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd" + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a" } diff --git a/packages/maps/package.json b/packages/maps/package.json index 1e9f46c70b..cb0d8b4587 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -43,7 +43,7 @@ "@types/gl-matrix": "^2.4.5", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 9419fd6991..499e26d032 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -33,7 +33,7 @@ "reflect-metadata": "^0.1.13", "regl": "^1.6.1" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/scene/package.json b/packages/scene/package.json index d12289d9da..0a7a6fc2c4 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -34,7 +34,7 @@ "mapbox-gl": "^1.2.1", "reflect-metadata": "^0.1.13" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/source/package.json b/packages/source/package.json index 96d1a37f61..fc3ac5fa92 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -45,7 +45,7 @@ "@types/d3-hexbin": "^0.2.3", "@types/lodash": "^4.14.138" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/three/package.json b/packages/three/package.json index 3076e1ad6c..4a6d0e4afb 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -53,7 +53,7 @@ "devDependencies": { "three": "^0.115.0" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 6a76ad3943..6c9ade7e8e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/d3-color": "^1.2.2" }, - "gitHead": "0aab2458a17b35b3c083b0113848effe9473e9fd", + "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", "publishConfig": { "access": "public" } From 1ac42067b1da2ee3d919410a05f9b1fab81b594c Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 1 Jun 2021 20:43:23 +0800 Subject: [PATCH 03/12] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=20git=20head?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/component/package.json | 2 +- packages/core/package.json | 2 +- packages/l7/package.json | 2 +- packages/layers/package.json | 2 +- packages/map/package.json | 2 +- packages/maps/package.json | 2 +- packages/renderer/package.json | 2 +- packages/scene/package.json | 2 +- packages/source/package.json | 2 +- packages/three/package.json | 2 +- packages/utils/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index c8ed7adadf..af1ec994a6 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -32,7 +32,7 @@ "inversify": "^5.0.1", "load-styles": "^2.0.0" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/core/package.json b/packages/core/package.json index 8809b4f150..5fdc5824b5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "@types/lodash": "^4.14.138", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/l7/package.json b/packages/l7/package.json index 6079908089..3bdf36ce0b 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -33,7 +33,7 @@ "@antv/l7-utils": "^2.4.1", "@babel/runtime": "^7.7.7" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/layers/package.json b/packages/layers/package.json index 61d3ef0b71..3b944d3005 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -53,7 +53,7 @@ "@types/gl-matrix": "^2.4.5", "@types/lodash": "^4.14.138" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/map/package.json b/packages/map/package.json index 748758c634..7e382f9a66 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -44,5 +44,5 @@ "eventemitter3": "^4.0.4", "lodash": "^4.17.15" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a" + "gitHead": "f2d0f2f45853686f170369943a355d259581240b" } diff --git a/packages/maps/package.json b/packages/maps/package.json index cb0d8b4587..562334db8e 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -43,7 +43,7 @@ "@types/gl-matrix": "^2.4.5", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 499e26d032..cc7373dedd 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -33,7 +33,7 @@ "reflect-metadata": "^0.1.13", "regl": "^1.6.1" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/scene/package.json b/packages/scene/package.json index 0a7a6fc2c4..f053f6c36e 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -34,7 +34,7 @@ "mapbox-gl": "^1.2.1", "reflect-metadata": "^0.1.13" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/source/package.json b/packages/source/package.json index fc3ac5fa92..08cec8c790 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -45,7 +45,7 @@ "@types/d3-hexbin": "^0.2.3", "@types/lodash": "^4.14.138" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/three/package.json b/packages/three/package.json index 4a6d0e4afb..d1509080be 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -53,7 +53,7 @@ "devDependencies": { "three": "^0.115.0" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 6c9ade7e8e..280f2c921a 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/d3-color": "^1.2.2" }, - "gitHead": "90c86832690592d2e94c250a6d07191fba91444a", + "gitHead": "f2d0f2f45853686f170369943a355d259581240b", "publishConfig": { "access": "public" } From 460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1 Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 1 Jun 2021 21:07:26 +0800 Subject: [PATCH 04/12] feat: change git heads --- packages/component/package.json | 2 +- packages/core/package.json | 2 +- packages/l7/package.json | 2 +- packages/layers/package.json | 2 +- packages/map/package.json | 2 +- packages/maps/package.json | 2 +- packages/renderer/package.json | 2 +- packages/scene/package.json | 2 +- packages/source/package.json | 2 +- packages/three/package.json | 2 +- packages/utils/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index af1ec994a6..d6b64bcabd 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -32,7 +32,7 @@ "inversify": "^5.0.1", "load-styles": "^2.0.0" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/core/package.json b/packages/core/package.json index 5fdc5824b5..6b10bbbf9c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "@types/lodash": "^4.14.138", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/l7/package.json b/packages/l7/package.json index 3bdf36ce0b..1c5ab8f06e 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -33,7 +33,7 @@ "@antv/l7-utils": "^2.4.1", "@babel/runtime": "^7.7.7" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/layers/package.json b/packages/layers/package.json index 3b944d3005..313e3663d3 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -53,7 +53,7 @@ "@types/gl-matrix": "^2.4.5", "@types/lodash": "^4.14.138" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/map/package.json b/packages/map/package.json index 7e382f9a66..5279232e14 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -44,5 +44,5 @@ "eventemitter3": "^4.0.4", "lodash": "^4.17.15" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b" + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c" } diff --git a/packages/maps/package.json b/packages/maps/package.json index 562334db8e..8560853a28 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -43,7 +43,7 @@ "@types/gl-matrix": "^2.4.5", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index cc7373dedd..00cc35ca21 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -33,7 +33,7 @@ "reflect-metadata": "^0.1.13", "regl": "^1.6.1" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/scene/package.json b/packages/scene/package.json index f053f6c36e..e8bc1dc413 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -34,7 +34,7 @@ "mapbox-gl": "^1.2.1", "reflect-metadata": "^0.1.13" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/source/package.json b/packages/source/package.json index 08cec8c790..59c1c2eff0 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -45,7 +45,7 @@ "@types/d3-hexbin": "^0.2.3", "@types/lodash": "^4.14.138" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/three/package.json b/packages/three/package.json index d1509080be..b542db9026 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -53,7 +53,7 @@ "devDependencies": { "three": "^0.115.0" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 280f2c921a..e5f6808827 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/d3-color": "^1.2.2" }, - "gitHead": "f2d0f2f45853686f170369943a355d259581240b", + "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", "publishConfig": { "access": "public" } From 2247382ae4aedaa4e5ee6424ac3881ef89dbff1b Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 1 Jun 2021 21:20:17 +0800 Subject: [PATCH 05/12] feat: change git heads again --- packages/component/package.json | 2 +- packages/core/package.json | 2 +- packages/l7/package.json | 2 +- packages/layers/package.json | 2 +- packages/map/package.json | 2 +- packages/maps/package.json | 2 +- packages/renderer/package.json | 2 +- packages/scene/package.json | 2 +- packages/source/package.json | 2 +- packages/three/package.json | 2 +- packages/utils/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index d6b64bcabd..89e695b13e 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -32,7 +32,7 @@ "inversify": "^5.0.1", "load-styles": "^2.0.0" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/core/package.json b/packages/core/package.json index 6b10bbbf9c..1bf538264a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "@types/lodash": "^4.14.138", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/l7/package.json b/packages/l7/package.json index 1c5ab8f06e..38594ce0aa 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -33,7 +33,7 @@ "@antv/l7-utils": "^2.4.1", "@babel/runtime": "^7.7.7" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/layers/package.json b/packages/layers/package.json index 313e3663d3..56afc0fbe9 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -53,7 +53,7 @@ "@types/gl-matrix": "^2.4.5", "@types/lodash": "^4.14.138" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/map/package.json b/packages/map/package.json index 5279232e14..f5ea27bd62 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -44,5 +44,5 @@ "eventemitter3": "^4.0.4", "lodash": "^4.17.15" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c" + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1" } diff --git a/packages/maps/package.json b/packages/maps/package.json index 8560853a28..6089c4d500 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -43,7 +43,7 @@ "@types/gl-matrix": "^2.4.5", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 00cc35ca21..90989ac88f 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -33,7 +33,7 @@ "reflect-metadata": "^0.1.13", "regl": "^1.6.1" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/scene/package.json b/packages/scene/package.json index e8bc1dc413..057b0b68a0 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -34,7 +34,7 @@ "mapbox-gl": "^1.2.1", "reflect-metadata": "^0.1.13" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/source/package.json b/packages/source/package.json index 59c1c2eff0..aa78e6e15a 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -45,7 +45,7 @@ "@types/d3-hexbin": "^0.2.3", "@types/lodash": "^4.14.138" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/three/package.json b/packages/three/package.json index b542db9026..e3f9acd016 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -53,7 +53,7 @@ "devDependencies": { "three": "^0.115.0" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } diff --git a/packages/utils/package.json b/packages/utils/package.json index e5f6808827..17a3f77fc7 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/d3-color": "^1.2.2" }, - "gitHead": "1ac42067b1da2ee3d919410a05f9b1fab81b594c", + "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", "publishConfig": { "access": "public" } From 8eb6056d7fb4c8fef495840994fe7cfc5566744d Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 1 Jun 2021 21:24:39 +0800 Subject: [PATCH 06/12] feat: change githead --- packages/component/package.json | 2 +- packages/core/package.json | 2 +- packages/l7/package.json | 2 +- packages/layers/package.json | 2 +- packages/map/package.json | 2 +- packages/maps/package.json | 2 +- packages/renderer/package.json | 2 +- packages/scene/package.json | 2 +- packages/source/package.json | 2 +- packages/three/package.json | 2 +- packages/utils/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index 89e695b13e..bc25004584 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -32,7 +32,7 @@ "inversify": "^5.0.1", "load-styles": "^2.0.0" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/core/package.json b/packages/core/package.json index 1bf538264a..11535b156b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "@types/lodash": "^4.14.138", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/l7/package.json b/packages/l7/package.json index 38594ce0aa..9175cfab14 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -33,7 +33,7 @@ "@antv/l7-utils": "^2.4.1", "@babel/runtime": "^7.7.7" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/layers/package.json b/packages/layers/package.json index 56afc0fbe9..88188c5103 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -53,7 +53,7 @@ "@types/gl-matrix": "^2.4.5", "@types/lodash": "^4.14.138" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/map/package.json b/packages/map/package.json index f5ea27bd62..c8cb19dd1d 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -44,5 +44,5 @@ "eventemitter3": "^4.0.4", "lodash": "^4.17.15" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1" + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b" } diff --git a/packages/maps/package.json b/packages/maps/package.json index 6089c4d500..1b1e547306 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -43,7 +43,7 @@ "@types/gl-matrix": "^2.4.5", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 90989ac88f..c524438b9e 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -33,7 +33,7 @@ "reflect-metadata": "^0.1.13", "regl": "^1.6.1" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/scene/package.json b/packages/scene/package.json index 057b0b68a0..40bfce1f43 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -34,7 +34,7 @@ "mapbox-gl": "^1.2.1", "reflect-metadata": "^0.1.13" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/source/package.json b/packages/source/package.json index aa78e6e15a..edff3376d2 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -45,7 +45,7 @@ "@types/d3-hexbin": "^0.2.3", "@types/lodash": "^4.14.138" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/three/package.json b/packages/three/package.json index e3f9acd016..ed3d74ca4e 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -53,7 +53,7 @@ "devDependencies": { "three": "^0.115.0" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 17a3f77fc7..145e54c0c4 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/d3-color": "^1.2.2" }, - "gitHead": "460f74bc6b0341c781d9dba1bf1bac4f8bfbfae1", + "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", "publishConfig": { "access": "public" } From 719d3b75bdfbb7a98767858333b90be92179fed0 Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 1 Jun 2021 21:39:08 +0800 Subject: [PATCH 07/12] feat: githead change --- packages/component/package.json | 2 +- packages/core/package.json | 2 +- packages/l7/package.json | 2 +- packages/layers/package.json | 2 +- packages/map/package.json | 2 +- packages/maps/package.json | 2 +- packages/renderer/package.json | 2 +- packages/scene/package.json | 2 +- packages/source/package.json | 2 +- packages/three/package.json | 2 +- packages/utils/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index bc25004584..9fe5963e82 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -32,7 +32,7 @@ "inversify": "^5.0.1", "load-styles": "^2.0.0" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/core/package.json b/packages/core/package.json index 11535b156b..01bda664d8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "@types/lodash": "^4.14.138", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/l7/package.json b/packages/l7/package.json index 9175cfab14..360fef26d5 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -33,7 +33,7 @@ "@antv/l7-utils": "^2.4.1", "@babel/runtime": "^7.7.7" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/layers/package.json b/packages/layers/package.json index 88188c5103..355b01c0d4 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -53,7 +53,7 @@ "@types/gl-matrix": "^2.4.5", "@types/lodash": "^4.14.138" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/map/package.json b/packages/map/package.json index c8cb19dd1d..d62d29266e 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -44,5 +44,5 @@ "eventemitter3": "^4.0.4", "lodash": "^4.17.15" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b" + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d" } diff --git a/packages/maps/package.json b/packages/maps/package.json index 1b1e547306..0932078cdb 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -43,7 +43,7 @@ "@types/gl-matrix": "^2.4.5", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index c524438b9e..f82890e42f 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -33,7 +33,7 @@ "reflect-metadata": "^0.1.13", "regl": "^1.6.1" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/scene/package.json b/packages/scene/package.json index 40bfce1f43..8696d59398 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -34,7 +34,7 @@ "mapbox-gl": "^1.2.1", "reflect-metadata": "^0.1.13" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/source/package.json b/packages/source/package.json index edff3376d2..7b27e7b5d4 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -45,7 +45,7 @@ "@types/d3-hexbin": "^0.2.3", "@types/lodash": "^4.14.138" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/three/package.json b/packages/three/package.json index ed3d74ca4e..c1a0859187 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -53,7 +53,7 @@ "devDependencies": { "three": "^0.115.0" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 145e54c0c4..26d5273476 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/d3-color": "^1.2.2" }, - "gitHead": "2247382ae4aedaa4e5ee6424ac3881ef89dbff1b", + "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", "publishConfig": { "access": "public" } From efe6d913c3343e8155f168c4bd52c07cb17a1a6a Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 1 Jun 2021 21:50:40 +0800 Subject: [PATCH 08/12] feat: change git heads --- packages/component/package.json | 2 +- packages/core/package.json | 2 +- packages/l7/package.json | 2 +- packages/layers/package.json | 2 +- packages/map/package.json | 2 +- packages/maps/package.json | 2 +- packages/renderer/package.json | 2 +- packages/scene/package.json | 2 +- packages/source/package.json | 2 +- packages/three/package.json | 2 +- packages/utils/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/component/package.json b/packages/component/package.json index 9fe5963e82..2d56339944 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -32,7 +32,7 @@ "inversify": "^5.0.1", "load-styles": "^2.0.0" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/core/package.json b/packages/core/package.json index 01bda664d8..e0018b86a7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -47,7 +47,7 @@ "@types/lodash": "^4.14.138", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/l7/package.json b/packages/l7/package.json index 360fef26d5..6d83256221 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -33,7 +33,7 @@ "@antv/l7-utils": "^2.4.1", "@babel/runtime": "^7.7.7" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/layers/package.json b/packages/layers/package.json index 355b01c0d4..0c6a07f1ef 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -53,7 +53,7 @@ "@types/gl-matrix": "^2.4.5", "@types/lodash": "^4.14.138" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/map/package.json b/packages/map/package.json index d62d29266e..abb0b87ea2 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -44,5 +44,5 @@ "eventemitter3": "^4.0.4", "lodash": "^4.17.15" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d" + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0" } diff --git a/packages/maps/package.json b/packages/maps/package.json index 0932078cdb..74ef4af5a6 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -43,7 +43,7 @@ "@types/gl-matrix": "^2.4.5", "@types/viewport-mercator-project": "^6.1.0" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/renderer/package.json b/packages/renderer/package.json index f82890e42f..581d81eff0 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -33,7 +33,7 @@ "reflect-metadata": "^0.1.13", "regl": "^1.6.1" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/scene/package.json b/packages/scene/package.json index 8696d59398..6367871678 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -34,7 +34,7 @@ "mapbox-gl": "^1.2.1", "reflect-metadata": "^0.1.13" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/source/package.json b/packages/source/package.json index 7b27e7b5d4..489010af28 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -45,7 +45,7 @@ "@types/d3-hexbin": "^0.2.3", "@types/lodash": "^4.14.138" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/three/package.json b/packages/three/package.json index c1a0859187..654e6b0927 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -53,7 +53,7 @@ "devDependencies": { "three": "^0.115.0" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } diff --git a/packages/utils/package.json b/packages/utils/package.json index 26d5273476..1d18d877ab 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/d3-color": "^1.2.2" }, - "gitHead": "8eb6056d7fb4c8fef495840994fe7cfc5566744d", + "gitHead": "719d3b75bdfbb7a98767858333b90be92179fed0", "publishConfig": { "access": "public" } From 2474707c29583b958cd0d3ed1f2999c99f500f2f Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 8 Jun 2021 14:32:49 +0800 Subject: [PATCH 09/12] =?UTF-8?q?feat:=20=E8=A1=A5=E5=AE=8C=E6=89=80?= =?UTF-8?q?=E6=9C=89=E7=BA=BF=E5=9B=BE=E5=B1=82=E7=BA=B9=E7=90=86=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=EF=BC=8C=E4=BF=AE=E5=A4=8Darc/arc3d/great=5Fline?= =?UTF-8?q?=E8=99=9A=E7=BA=BFbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/src/services/layer/ILayerService.ts | 2 +- .../services/layer/StyleAttributeService.ts | 2 +- packages/layers/src/core/interface.ts | 1 + packages/layers/src/line/models/arc.ts | 4 +- packages/layers/src/line/models/arc_3d.ts | 75 ++++++++++++- .../layers/src/line/models/great_circle.ts | 77 ++++++++++++- packages/layers/src/line/models/line.ts | 4 +- .../src/line/shaders/line_arc_3d_frag.glsl | 64 ++++++++--- .../src/line/shaders/line_arc_3d_vert.glsl | 34 +++++- .../src/line/shaders/line_arc_frag.glsl | 31 ++++-- .../shaders/line_arc_great_circle_frag.glsl | 91 ++++++++++++++++ .../shaders/line_arc_great_circle_vert.glsl | 34 +++++- .../src/line/shaders/line_arc_vert.glsl | 12 ++- .../layers/src/line/shaders/line_frag.glsl | 17 ++- .../layers/src/plugins/DataMappingPlugin.ts | 3 +- stories/Map/components/amap2demo_arcLine.tsx | 2 + .../Map/components/amap2demo_arcLine3DTex.tsx | 21 ++-- .../Map/components/amap2demo_arcLineTex.tsx | 14 ++- .../amap2demo_arcLine_greatCircleTex.tsx | 102 ++++++++++++++++++ .../Map/components/amap2demo_lineStreet.tsx | 21 ++-- stories/Map/components/amap2demo_road.tsx | 2 +- stories/Map/components/amap2demo_road2.tsx | 2 +- stories/Map/map.stories.tsx | 4 +- 23 files changed, 563 insertions(+), 56 deletions(-) create mode 100644 packages/layers/src/line/shaders/line_arc_great_circle_frag.glsl create mode 100644 stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx diff --git a/packages/core/src/services/layer/ILayerService.ts b/packages/core/src/services/layer/ILayerService.ts index 88c50e9213..d418a671a3 100644 --- a/packages/core/src/services/layer/ILayerService.ts +++ b/packages/core/src/services/layer/ILayerService.ts @@ -130,7 +130,7 @@ export interface ILayer { scale(field: string | number | IScaleOptions, cfg?: IScale): ILayer; size(field: StyleAttrField, value?: StyleAttributeOption): ILayer; color(field: StyleAttrField, value?: StyleAttributeOption): ILayer; - texture?(field: StyleAttrField, value?: StyleAttributeOption): ILayer; + texture(field: StyleAttrField, value?: StyleAttributeOption): ILayer; shape(field: StyleAttrField, value?: StyleAttributeOption): ILayer; label(field: StyleAttrField, value?: StyleAttributeOption): ILayer; animate(option: Partial | boolean): ILayer; diff --git a/packages/core/src/services/layer/StyleAttributeService.ts b/packages/core/src/services/layer/StyleAttributeService.ts index e533b19a61..b3faabd4bf 100644 --- a/packages/core/src/services/layer/StyleAttributeService.ts +++ b/packages/core/src/services/layer/StyleAttributeService.ts @@ -1,4 +1,4 @@ -import { inject, injectable } from 'inversify'; +import { inject, injectable, optional } from 'inversify'; import { TYPES } from '../../types'; import { gl } from '../renderer/gl'; import { IAttribute } from '../renderer/IAttribute'; diff --git a/packages/layers/src/core/interface.ts b/packages/layers/src/core/interface.ts index 1cf2426810..fe157e442d 100644 --- a/packages/layers/src/core/interface.ts +++ b/packages/layers/src/core/interface.ts @@ -11,4 +11,5 @@ export interface ILineLayerStyleOptions { forward?: boolean; lineTexture?: boolean; iconStep?: number; + textureBlend?: string; // 可选参数、供给纹理贴图使用 } diff --git a/packages/layers/src/line/models/arc.ts b/packages/layers/src/line/models/arc.ts index ad3534c58b..7bb35280e9 100644 --- a/packages/layers/src/line/models/arc.ts +++ b/packages/layers/src/line/models/arc.ts @@ -23,6 +23,7 @@ export default class ArcModel extends BaseModel { public getUninforms(): IModelUniform { const { opacity, + textureBlend = 'normal', lineType = 'solid', dashArray = [10, 5], forward = true, @@ -39,7 +40,8 @@ export default class ArcModel extends BaseModel { } return { - u_opacity: opacity || 1, + u_opacity: opacity === undefined ? 1 : opacity, + u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, segmentNumber: 30, u_line_type: lineStyleObj[lineType || 'solid'], u_dash_array: dashArray, diff --git a/packages/layers/src/line/models/arc_3d.ts b/packages/layers/src/line/models/arc_3d.ts index 02da32a2e6..a8348d91e5 100644 --- a/packages/layers/src/line/models/arc_3d.ts +++ b/packages/layers/src/line/models/arc_3d.ts @@ -6,6 +6,7 @@ import { ILayerConfig, IModel, IModelUniform, + ITexture2D, } from '@antv/l7-core'; import BaseModel from '../../core/BaseModel'; import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; @@ -17,22 +18,39 @@ const lineStyleObj: { [key: string]: number } = { dash: 1.0, }; export default class Arc3DModel extends BaseModel { + protected texture: ITexture2D; public getUninforms(): IModelUniform { const { opacity, + textureBlend = 'normal', lineType = 'solid', dashArray = [10, 5], + lineTexture = false, + iconStep = 100, } = this.layer.getLayerConfig() as ILineLayerStyleOptions; + if (dashArray.length === 2) { dashArray.push(0, 0); } + + if (this.rendererService.getDirty()) { + this.texture.bind(); + } + return { - u_opacity: opacity || 1, + u_opacity: opacity === undefined ? 1 : opacity, + u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, segmentNumber: 30, u_line_type: lineStyleObj[lineType as string] || 0.0, u_dash_array: dashArray, + + u_texture: this.texture, // 贴图 + u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识 + u_icon_step: iconStep, + u_textSize: [1024, this.iconService.canvasHeight || 128], }; } + public getAnimateUniforms(): IModelUniform { const { animateOption } = this.layer.getLayerConfig() as ILayerConfig; return { @@ -42,9 +60,19 @@ export default class Arc3DModel extends BaseModel { } public initModels(): IModel[] { + this.updateTexture(); + this.iconService.on('imageUpdate', this.updateTexture); + return this.buildModels(); } + public clearModels() { + if (this.texture) { + this.texture.destroy(); + } + this.iconService.off('imageUpdate', this.updateTexture); + } + public buildModels(): IModel[] { return [ this.layer.buildLayerModel({ @@ -103,5 +131,50 @@ export default class Arc3DModel extends BaseModel { }, }, }); + + this.styleAttributeService.registerStyleAttribute({ + name: 'uv', + type: AttributeType.Attribute, + descriptor: { + name: 'a_iconMapUV', + buffer: { + // give the WebGL driver a hint that this buffer may change + usage: gl.DYNAMIC_DRAW, + data: [], + type: gl.FLOAT, + }, + size: 2, + update: ( + feature: IEncodeFeature, + featureIdx: number, + vertex: number[], + attributeIdx: number, + ) => { + const iconMap = this.iconService.getIconMap(); + const { texture } = feature; + const { x, y } = iconMap[texture as string] || { x: 0, y: 0 }; + return [x, y]; + }, + }, + }); } + + private updateTexture = () => { + const { createTexture2D } = this.rendererService; + if (this.texture) { + this.texture.update({ + data: this.iconService.getCanvas(), + }); + this.layer.render(); + return; + } + this.texture = createTexture2D({ + data: this.iconService.getCanvas(), + mag: gl.NEAREST, + min: gl.NEAREST, + premultiplyAlpha: false, + width: 1024, + height: this.iconService.canvasHeight || 128, + }); + }; } diff --git a/packages/layers/src/line/models/great_circle.ts b/packages/layers/src/line/models/great_circle.ts index 81143bbc84..1a93e8beed 100644 --- a/packages/layers/src/line/models/great_circle.ts +++ b/packages/layers/src/line/models/great_circle.ts @@ -6,12 +6,14 @@ import { ILayerConfig, IModel, IModelUniform, + ITexture2D, } from '@antv/l7-core'; import BaseModel from '../../core/BaseModel'; import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; import { LineArcTriangulation } from '../../core/triangulation'; -import line_arc_frag from '../shaders/line_arc_frag.glsl'; +// import line_arc_frag from '../shaders/line_arc_frag.glsl'; +import line_arc_frag from '../shaders/line_arc_great_circle_frag.glsl'; import line_arc2d_vert from '../shaders/line_arc_great_circle_vert.glsl'; const lineStyleObj: { [key: string]: number } = { solid: 0.0, @@ -19,20 +21,35 @@ const lineStyleObj: { [key: string]: number } = { }; export default class GreatCircleModel extends BaseModel { + protected texture: ITexture2D; public getUninforms(): IModelUniform { const { opacity, + textureBlend = 'normal', lineType = 'solid', dashArray = [10, 5], + lineTexture = false, + iconStep = 100, } = this.layer.getLayerConfig() as Partial; + // console.log('opacity', opacity) if (dashArray.length === 2) { dashArray.push(0, 0); } + + if (this.rendererService.getDirty()) { + this.texture.bind(); + } return { - u_opacity: opacity || 1, + u_opacity: opacity === undefined ? 1 : opacity, + u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, segmentNumber: 30, u_line_type: lineStyleObj[lineType as string] || 0.0, u_dash_array: dashArray, + + u_texture: this.texture, // 贴图 + u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识 + u_icon_step: iconStep, + u_textSize: [1024, this.iconService.canvasHeight || 128], }; } public getAnimateUniforms(): IModelUniform { @@ -44,9 +61,19 @@ export default class GreatCircleModel extends BaseModel { } public initModels(): IModel[] { + this.updateTexture(); + this.iconService.on('imageUpdate', this.updateTexture); + return this.buildModels(); } + public clearModels() { + if (this.texture) { + this.texture.destroy(); + } + this.iconService.off('imageUpdate', this.updateTexture); + } + public buildModels(): IModel[] { return [ this.layer.buildLayerModel({ @@ -105,5 +132,51 @@ export default class GreatCircleModel extends BaseModel { }, }, }); + + this.styleAttributeService.registerStyleAttribute({ + name: 'uv', + type: AttributeType.Attribute, + descriptor: { + name: 'a_iconMapUV', + buffer: { + // give the WebGL driver a hint that this buffer may change + usage: gl.DYNAMIC_DRAW, + data: [], + type: gl.FLOAT, + }, + size: 2, + update: ( + feature: IEncodeFeature, + featureIdx: number, + vertex: number[], + attributeIdx: number, + ) => { + const iconMap = this.iconService.getIconMap(); + const { texture } = feature; + // console.log('icon feature', feature) + const { x, y } = iconMap[texture as string] || { x: 0, y: 0 }; + return [x, y]; + }, + }, + }); } + + private updateTexture = () => { + const { createTexture2D } = this.rendererService; + if (this.texture) { + this.texture.update({ + data: this.iconService.getCanvas(), + }); + this.layer.render(); + return; + } + this.texture = createTexture2D({ + data: this.iconService.getCanvas(), + mag: gl.NEAREST, + min: gl.NEAREST, + premultiplyAlpha: false, + width: 1024, + height: this.iconService.canvasHeight || 128, + }); + }; } diff --git a/packages/layers/src/line/models/line.ts b/packages/layers/src/line/models/line.ts index 7a21a84bb3..0ae74c6b75 100644 --- a/packages/layers/src/line/models/line.ts +++ b/packages/layers/src/line/models/line.ts @@ -24,6 +24,7 @@ export default class LineModel extends BaseModel { public getUninforms(): IModelUniform { const { opacity, + textureBlend = 'normal', lineType = 'solid', dashArray = [10, 5, 0, 0], lineTexture = false, @@ -38,7 +39,8 @@ export default class LineModel extends BaseModel { } return { - u_opacity: opacity || 1.0, + u_opacity: opacity === undefined ? 1 : opacity, + u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, u_line_type: lineStyleObj[lineType], u_dash_array: dashArray, diff --git a/packages/layers/src/line/shaders/line_arc_3d_frag.glsl b/packages/layers/src/line/shaders/line_arc_3d_frag.glsl index 6751c2e880..0135d04dcb 100644 --- a/packages/layers/src/line/shaders/line_arc_3d_frag.glsl +++ b/packages/layers/src/line/shaders/line_arc_3d_frag.glsl @@ -1,8 +1,10 @@ #define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 +#define LineTexture 1.0 uniform float u_opacity; +uniform float u_textureBlend; uniform float u_blur : 0.9; uniform float u_line_type: 0.0; varying vec2 v_normal; @@ -10,12 +12,24 @@ varying vec4 v_dash_array; varying float v_distance_ratio; varying vec4 v_color; +uniform float u_line_texture: 0.0; +uniform sampler2D u_texture; +uniform vec2 u_textSize; +varying float v_segmentIndex; +uniform float segmentNumber; +varying float v_arcDistrance; +varying float v_pixelLen; +varying float v_a; +varying vec2 v_offset; +varying vec2 v_iconMapUV; + uniform float u_time; uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ]; #pragma include "picking" void main() { + float animateSpeed = 0.0; // 运动速度 gl_FragColor = v_color; // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy)); // float blur = smoothstep(1.0, u_blur, length(v_normal.xy)); @@ -30,21 +44,47 @@ void main() { } if(u_aimate.x == Animate) { + animateSpeed = u_time / u_aimate.y; float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y); + alpha = (alpha + u_aimate.w -1.0) / u_aimate.w; - alpha = smoothstep(0., 1., alpha); + // alpha = smoothstep(0., 1., alpha); + alpha = clamp(alpha, 0.0, 1.0); gl_FragColor.a *= alpha; } - // if(u_line_texture == LineTexture) { // while load texture - // //v_u; // 水平 - // float v = length(v_offset)/(v_a); // 横向 - // vec2 uv= v_iconMapUV / u_textSize + vec2(v_u, v) / u_textSize * 64.; - // // gl_FragColor = vec4(v_u, v, 0.0, 1.0); - // // gl_FragColor = vec4(1.0, 0.0, 0.0, v_u); - // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv)); - // } else { - // gl_FragColor = filterColor(gl_FragColor); - // } - gl_FragColor = filterColor(gl_FragColor); + if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture + // float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber)); + float arcRadio = v_segmentIndex / (segmentNumber - 1.0); + float count = floor(v_arcDistrance/v_pixelLen); + + float u = fract(arcRadio * count - animateSpeed * count); + + if(u_aimate.x == Animate) { + u = gl_FragColor.a/u_opacity; + } + float v = length(v_offset)/(v_a); // 横向 + + vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; + vec4 pattern = texture2D(u_texture, uv); + + if(u_textureBlend == 0.0) { // normal + pattern.a = 0.0; + gl_FragColor = filterColor(gl_FragColor + pattern); + } else { // replace + pattern.a *= u_opacity; + if(gl_FragColor.a <= 0.0) { + pattern.a = 0.0; + } + gl_FragColor = filterColor(pattern); + } + + + // gl_FragColor = filterColor(gl_FragColor + pattern); + + } else { + gl_FragColor = filterColor(gl_FragColor); + } + + // gl_FragColor = filterColor(gl_FragColor); } diff --git a/packages/layers/src/line/shaders/line_arc_3d_vert.glsl b/packages/layers/src/line/shaders/line_arc_3d_vert.glsl index d62f8689e0..a6152a411f 100644 --- a/packages/layers/src/line/shaders/line_arc_3d_vert.glsl +++ b/packages/layers/src/line/shaders/line_arc_3d_vert.glsl @@ -1,6 +1,7 @@ #define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 +#define LineTexture 1.0 attribute vec3 a_Position; attribute vec4 a_Instance; attribute vec4 a_Color; @@ -17,6 +18,16 @@ uniform float u_line_type: 0.0; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; varying vec4 v_dash_array; +uniform float u_icon_step: 100; +uniform float u_line_texture: 0.0; +varying float v_segmentIndex; +varying float v_arcDistrance; +varying float v_pixelLen; +varying float v_a; +varying vec2 v_offset; +attribute vec2 a_iconMapUV; +varying vec2 v_iconMapUV; + #pragma include "projection" #pragma include "project" #pragma include "picking" @@ -73,7 +84,15 @@ void main() { if(u_line_type == LineTypeDash) { v_distance_ratio = segmentIndex / segmentNumber; - float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI; + // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI; + vec2 s = source; + vec2 t = target; + + if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x + s = unProjCustomCoord(source); + t = unProjCustomCoord(target); + } + float total_Distance = pixelDistance(s, t) / 2.0 * PI; v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex); } if(u_aimate.x == Animate) { @@ -86,6 +105,19 @@ void main() { vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y); v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y); + + if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // 开启贴图模式 + v_segmentIndex = a_Position.x; + v_arcDistrance = length(source - target); + v_pixelLen = project_pixel(u_icon_step); + + vec2 projectOffset = project_pixel(offset); + v_offset = projectOffset + projectOffset * sign(a_Position.y); + v_a = project_pixel(a_Size); + v_iconMapUV = a_iconMapUV; + } + + // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0)); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * (vec4(curr.xy + project_pixel(offset), curr.z, 1.0)); diff --git a/packages/layers/src/line/shaders/line_arc_frag.glsl b/packages/layers/src/line/shaders/line_arc_frag.glsl index 7037661de4..1ceff01e27 100644 --- a/packages/layers/src/line/shaders/line_arc_frag.glsl +++ b/packages/layers/src/line/shaders/line_arc_frag.glsl @@ -4,6 +4,7 @@ #define LineTexture 1.0 uniform float u_opacity; +uniform float u_textureBlend; uniform float u_blur : 0.9; uniform float u_line_type: 0.0; varying vec2 v_normal; @@ -48,25 +49,39 @@ void main() { animateSpeed = u_time / u_aimate.y; float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y); alpha = (alpha + u_aimate.w -1.0) / u_aimate.w; - alpha = smoothstep(0., 1., alpha); + // alpha = smoothstep(0., 1., alpha); + alpha = clamp(alpha, 0.0, 1.0); gl_FragColor.a *= alpha; } - if(u_line_texture == LineTexture) { // while load texture - float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / (segmentNumber - 1.0))); + if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture + float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber)); + // float arcRadio = v_segmentIndex / (segmentNumber - 1.0); float count = floor(v_arcDistrance/v_pixelLen); float u = 1.0 - fract(arcRadio * count + animateSpeed); - float alpha = 1.0; + if(u_aimate.x == Animate) { - u = gl_FragColor.a; - alpha = gl_FragColor.a; + u = gl_FragColor.a/u_opacity; } float v = length(v_offset)/(v_a); // 横向 vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; + + vec4 pattern = texture2D(u_texture, uv); + + if(u_textureBlend == 0.0) { // normal + pattern.a = 0.0; + gl_FragColor = filterColor(gl_FragColor + pattern); + } else { // replace + pattern.a *= u_opacity; + if(gl_FragColor.a <= 0.0) { + pattern.a = 0.0; + } + gl_FragColor = filterColor(pattern); + } - gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv)); - gl_FragColor.a *= alpha; + // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv)); + // gl_FragColor = filterColor(texture2D(u_texture, uv)); } else { gl_FragColor = filterColor(gl_FragColor); diff --git a/packages/layers/src/line/shaders/line_arc_great_circle_frag.glsl b/packages/layers/src/line/shaders/line_arc_great_circle_frag.glsl new file mode 100644 index 0000000000..20caf1ddc7 --- /dev/null +++ b/packages/layers/src/line/shaders/line_arc_great_circle_frag.glsl @@ -0,0 +1,91 @@ +#define LineTypeSolid 0.0 +#define LineTypeDash 1.0 +#define Animate 0.0 +#define LineTexture 1.0 + +uniform float u_opacity; +uniform float u_textureBlend; +uniform float u_blur : 0.9; +uniform float u_line_type: 0.0; +varying vec2 v_normal; +varying vec4 v_dash_array; +varying float v_distance_ratio; +varying vec4 v_color; + +uniform float u_time; +uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ]; + +uniform float u_line_texture: 0.0; +uniform sampler2D u_texture; +uniform vec2 u_textSize; +uniform float segmentNumber; +varying float v_segmentIndex; +varying float v_arcDistrance; +varying float v_pixelLen; +varying vec2 v_offset; +varying float v_a; +varying vec2 v_iconMapUV; + +#pragma include "picking" + +void main() { + float animateSpeed = 0.0; + gl_FragColor = v_color; + // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy)); + // float blur = smoothstep(1.0, u_blur, length(v_normal.xy)); + gl_FragColor.a *= u_opacity; + if(u_line_type == LineTypeDash) { + float flag = 0.; + float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w); + if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) { + flag = 1.; + } + gl_FragColor.a *=flag; + } + + if(u_aimate.x == Animate) { + animateSpeed = u_time / u_aimate.y; + // float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / (segmentNumber - 1.0))); + // float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y); + float alpha =1.0 - fract( mod(1.0- smoothstep(0.0, 1.0, v_distance_ratio), u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y); + alpha = (alpha + u_aimate.w -1.0) / u_aimate.w; + alpha = smoothstep(0., 1., alpha); + // alpha = clamp(alpha, 0.1, 1.0); + // if(alpha < 0.01) alpha = 0.0; + gl_FragColor.a *= alpha; + } + + if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // 开启贴图模式 + float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / (segmentNumber - 1.0))); + // float arcRadio = v_segmentIndex / (segmentNumber - 1.0); + float count = floor(v_arcDistrance/v_pixelLen); + // float u = fract(arcRadio * count); + float u = fract(arcRadio * count - animateSpeed * count); + // float u = fract(arcRadio * count - animateSpeed); + if(u_aimate.x == Animate) { + u = gl_FragColor.a; + } + + float v = length(v_offset)/(v_a); // 横向 + + vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; + vec4 pattern = texture2D(u_texture, uv); + + + if(u_textureBlend == 0.0) { // normal + pattern.a = 0.0; + gl_FragColor = filterColor(gl_FragColor + pattern); + } else { // replace + pattern.a *= u_opacity; + if(gl_FragColor.a <= 0.0) { + pattern.a = 0.0; + } + gl_FragColor = filterColor(pattern); + } + // gl_FragColor = filterColor(gl_FragColor + pattern); + } else { + gl_FragColor = filterColor(gl_FragColor); + } + + // gl_FragColor = filterColor(gl_FragColor); +} \ No newline at end of file diff --git a/packages/layers/src/line/shaders/line_arc_great_circle_vert.glsl b/packages/layers/src/line/shaders/line_arc_great_circle_vert.glsl index 3779caff93..5b966f093c 100644 --- a/packages/layers/src/line/shaders/line_arc_great_circle_vert.glsl +++ b/packages/layers/src/line/shaders/line_arc_great_circle_vert.glsl @@ -1,6 +1,8 @@ #define LineTypeSolid 0.0 #define LineTypeDash 1.0 #define Animate 0.0 +#define LineTexture 1.0 + attribute vec4 a_Color; attribute vec3 a_Position; attribute vec4 a_Instance; @@ -17,6 +19,17 @@ uniform float u_line_type: 0.0; uniform vec4 u_dash_array: [10.0, 5., 0, 0]; varying vec4 v_dash_array; +uniform float u_icon_step: 100; +uniform float u_line_texture: 0.0; +varying float v_segmentIndex; +varying float v_arcDistrance; +varying float v_pixelLen; +varying vec2 v_offset; +varying float v_a; + +attribute vec2 a_iconMapUV; +varying vec2 v_iconMapUV; + #pragma include "projection" #pragma include "project" #pragma include "picking" @@ -119,7 +132,16 @@ void main() { float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0)); if(u_line_type == LineTypeDash) { v_distance_ratio = segmentIndex / segmentNumber; - float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba); + vec2 s = source; + vec2 t = target; + + if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x + s = unProjCustomCoord(source); + t = unProjCustomCoord(target); + } + float total_Distance = pixelDistance(s, t) / 2.0 * PI; + total_Distance = total_Distance*8.0; + // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba); v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex); } if(u_aimate.x == Animate) { @@ -134,6 +156,16 @@ void main() { // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0)); // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0)); + if(LineTexture == u_line_texture) { // 开启贴图模式 + v_segmentIndex = a_Position.x; + v_arcDistrance = length(source - target); + v_pixelLen = project_pixel(u_icon_step)/8.0; + + v_a = project_pixel(a_Size); + v_offset = offset + offset * sign(a_Position.y); + v_iconMapUV = a_iconMapUV; + } + if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * (vec4(curr.xy + offset, curr.z, 1.0)); } else { diff --git a/packages/layers/src/line/shaders/line_arc_vert.glsl b/packages/layers/src/line/shaders/line_arc_vert.glsl index 5b4e234e1b..9abc20cd6a 100644 --- a/packages/layers/src/line/shaders/line_arc_vert.glsl +++ b/packages/layers/src/line/shaders/line_arc_vert.glsl @@ -94,7 +94,15 @@ void main() { float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir); if(u_line_type == LineTypeDash) { v_distance_ratio = segmentIndex / segmentNumber; - float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI; + vec2 s = source; + vec2 t = target; + + if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x + s = unProjCustomCoord(source); + t = unProjCustomCoord(target); + } + float total_Distance = pixelDistance(s, t) / 2.0 * PI; + // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI; v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex); } if(u_aimate.x == Animate) { @@ -106,6 +114,7 @@ void main() { vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio), 0.0, 1.0)); vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio), 0.0, 1.0)); v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y); + //unProjCustomCoord vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y)); @@ -122,6 +131,7 @@ void main() { // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0)); if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x + // gl_Position = u_Mvp * (vec4(curr.xy + offset, 0, 1.0)); gl_Position = u_Mvp * (vec4(curr.xy + offset, 0, 1.0)); } else { gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0)); diff --git a/packages/layers/src/line/shaders/line_frag.glsl b/packages/layers/src/line/shaders/line_frag.glsl index dbdd47a11b..e053cd7725 100644 --- a/packages/layers/src/line/shaders/line_frag.glsl +++ b/packages/layers/src/line/shaders/line_frag.glsl @@ -5,6 +5,7 @@ uniform float u_blur : 0.99; uniform float u_line_type: 0.0; uniform float u_opacity : 1.0; +uniform float u_textureBlend; varying vec4 v_color; varying vec2 v_normal; @@ -56,13 +57,25 @@ void main() { // gl_FragColor.a *=(1.0- step(v_dash_array.x, mod(v_distance_ratio, dashLength))); } - if(u_line_texture == LineTexture) { // while load texture + if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture float u = fract(mod(v_distance, v_pixelLen)/v_pixelLen - animateSpeed); float v = length(v_offset)/(v_a*2.0); v = max(smoothstep(0.95, 1.0, v), v); vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.; // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, vec2(u, v))); - gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv)); + // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv)); + vec4 pattern = texture2D(u_texture, uv); + + if(u_textureBlend == 0.0) { // normal + pattern.a = 0.0; + gl_FragColor = filterColor(gl_FragColor + pattern); + } else { // replace + pattern.a *= u_opacity; + if(gl_FragColor.a <= 0.0) { + pattern.a = 0.0; + } + gl_FragColor = filterColor(pattern); + } } else { gl_FragColor = filterColor(gl_FragColor); } diff --git a/packages/layers/src/plugins/DataMappingPlugin.ts b/packages/layers/src/plugins/DataMappingPlugin.ts index 931443adf7..3eef2fb7ba 100644 --- a/packages/layers/src/plugins/DataMappingPlugin.ts +++ b/packages/layers/src/plugins/DataMappingPlugin.ts @@ -117,7 +117,8 @@ export default class DataMappingPlugin implements ILayerPlugin { coordinates: record.coordinates, ...preRecord, }; - + // console.log('encodeRecord', encodeRecord) + // console.log('attributes', attributes) attributes .filter((attribute) => attribute.scale !== undefined) .forEach((attribute: IStyleAttribute) => { diff --git a/stories/Map/components/amap2demo_arcLine.tsx b/stories/Map/components/amap2demo_arcLine.tsx index b47ca96905..8998feedf4 100644 --- a/stories/Map/components/amap2demo_arcLine.tsx +++ b/stories/Map/components/amap2demo_arcLine.tsx @@ -45,6 +45,8 @@ export default class Amap2demo_arcLine extends React.Component { .style({ opacity: 0.8, blur: 0.99, + lineType: 'dash', + dashArray: [5, 5], }); // .forward(false) scene.addLayer(layer); diff --git a/stories/Map/components/amap2demo_arcLine3DTex.tsx b/stories/Map/components/amap2demo_arcLine3DTex.tsx index 2bd9c9b1eb..1931d60051 100644 --- a/stories/Map/components/amap2demo_arcLine3DTex.tsx +++ b/stories/Map/components/amap2demo_arcLine3DTex.tsx @@ -38,7 +38,7 @@ export default class Amap2demo_arcLine3DTex extends React.Component { lat2: 52.802761415419674, }, ]; - + //// @ts-ignore const layer = new LineLayer({ blend: 'normal', }) @@ -53,18 +53,23 @@ export default class Amap2demo_arcLine3DTex extends React.Component { }) .size(10) .shape('arc3d') - // .texture('02') + .texture('02') .color('#8C1EB2') .style({ - // forward: false, - // lineTexture: true, // 开启线的贴图功能 - // iconStep: 100, // 设置贴图纹理的间距 - // // opacity: 0 + lineTexture: true, // 开启线的贴图功能 + iconStep: 10, // 设置贴图纹理的间距 + // opacity: 0, + opacity: 0.8, + // opacity: 0.2, + lineType: 'dash', + dashArray: [5, 5], + textureBlend: 'replace', + // textureBlend: 'normal', }); // .animate({ // duration: 50, - // interval: 0.3, - // trailLength: 0.1, + // interval: 0.2, + // trailLength: 0.02, // }); scene.addLayer(layer); }); diff --git a/stories/Map/components/amap2demo_arcLineTex.tsx b/stories/Map/components/amap2demo_arcLineTex.tsx index 63255830fb..cfafcac2b7 100644 --- a/stories/Map/components/amap2demo_arcLineTex.tsx +++ b/stories/Map/components/amap2demo_arcLineTex.tsx @@ -1,6 +1,6 @@ // @ts-ignore import { LineLayer, Scene } from '@antv/l7'; -import { GaodeMap } from '@antv/l7-maps'; +import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; import * as React from 'react'; export default class Amap2demo_arcLineTex extends React.Component { @@ -14,6 +14,7 @@ export default class Amap2demo_arcLineTex extends React.Component { public async componentDidMount() { const scene = new Scene({ id: 'map', + // map: new GaodeMapV1({ map: new GaodeMap({ pitch: 40, center: [107.77791556935472, 35.443286920228644], @@ -38,7 +39,7 @@ export default class Amap2demo_arcLineTex extends React.Component { lat2: 52.802761415419674, }, ]; - + // @ts-ignore const layer = new LineLayer({ blend: 'normal', }) @@ -58,8 +59,13 @@ export default class Amap2demo_arcLineTex extends React.Component { .style({ forward: false, lineTexture: true, // 开启线的贴图功能 - iconStep: 100, // 设置贴图纹理的间距 - opacity: 0, + iconStep: 30, // 设置贴图纹理的间距 + // opacity: 0.5, + // opacity: 0.2, + // lineType: 'dash', + // dashArray: [5, 5], + // textureBlend: 'replace', + // textureBlend: 'normal', }) .animate({ duration: 50, diff --git a/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx b/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx new file mode 100644 index 0000000000..b02c25d47a --- /dev/null +++ b/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx @@ -0,0 +1,102 @@ +// @ts-ignore +import { LineLayer, Scene } from '@antv/l7'; +import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import * as React from 'react'; + +export default class Amap2demo_arcLine_greatCircle extends React.Component { + // @ts-ignore + private scene: Scene; + + public componentWillUnmount() { + this.scene.destroy(); + } + + public async componentDidMount() { + const scene = new Scene({ + id: 'map', + map: new GaodeMap({ + pitch: 0, + center: [107.77791556935472, 35.443286920228644], + zoom: 2.9142882493605033, + viewMode: '3D', + }), + }); + this.scene = scene; + + scene.on('loaded', () => { + scene.addImage( + '00', + 'https://gw.alipayobjects.com/zos/basement_prod/604b5e7f-309e-40db-b95b-4fac746c5153.svg', + // "https://gw-office.alipayobjects.com/bmw-prod/ae2a8580-da3d-43ff-add4-ae9c1bfc75bb.svg" + ); + scene.addImage( + '01', + 'https://gw.alipayobjects.com/zos/basement_prod/30580bc9-506f-4438-8c1a-744e082054ec.svg', + ); + scene.addImage( + '02', + 'https://gw.alipayobjects.com/zos/bmw-prod/0ca1668e-38c2-4010-8568-b57cb33839b9.svg', + ); + + const layer = new LineLayer({ blend: 'normal' }) + .source( + [ + { + lng1: 75.9375, + lat1: 37.71859032558816, + lng2: 123.3984375, + lat2: 39.639537564366684, + }, + ], + { + parser: { + type: 'json', + x: 'lng1', + y: 'lat1', + x1: 'lng2', + y1: 'lat2', + }, + }, + ) + .size(20) + .shape('greatcircle') + .color('#ff0000') + .texture('02') + .style({ + // opacity: 0.0, + // textureBlend: 'replace', + // textureBlend: 'normal', + blur: 0.99, + // lineTexture: true, // 开启线的贴图功能 + iconStep: 5, // 设置贴图纹理的间距 + + // lineType: 'dash', + // dashArray: [5, 5], + }); + // .animate({ + // duration: 5, + // interval: 0.2, + // trailLength: 0.4, + // }); + // .animate(true); + scene.addLayer(layer); + }); + } + + public render() { + return ( + <> +
+ + ); + } +} diff --git a/stories/Map/components/amap2demo_lineStreet.tsx b/stories/Map/components/amap2demo_lineStreet.tsx index ff0f493939..84fc22fd8d 100644 --- a/stories/Map/components/amap2demo_lineStreet.tsx +++ b/stories/Map/components/amap2demo_lineStreet.tsx @@ -41,22 +41,27 @@ export default class Amap2demo_lineStreet extends React.Component { '02', 'https://gw.alipayobjects.com/zos/bmw-prod/ce83fc30-701f-415b-9750-4b146f4b3dd6.svg', ); - + // @ts-ignore const layer = new LineLayer({}) .source(data) .size(5) .shape('line') - .texture('02') + .texture('01') .color('#25d8b7') - .animate({ - interval: 1, // 间隔 - duration: 1, // 持续时间,延时 - trailLength: 2, // 流线长度 - }) + // .animate({ + // interval: 1, // 间隔 + // duration: 1, // 持续时间,延时 + // trailLength: 2, // 流线长度 + // }) .style({ - // opacity: 0.5, + opacity: 0.5, + // opacity: 0, lineTexture: true, // 开启线的贴图功能 iconStep: 50, // 设置贴图纹理的间距 + // lineType: 'dash', + // dashArray: [5, 5], + textureBlend: 'replace', + // textureBlend: 'normal', }); scene.addLayer(layer); }); diff --git a/stories/Map/components/amap2demo_road.tsx b/stories/Map/components/amap2demo_road.tsx index ca7f5894d0..efdcbbb6ed 100644 --- a/stories/Map/components/amap2demo_road.tsx +++ b/stories/Map/components/amap2demo_road.tsx @@ -33,7 +33,7 @@ export default class Amap2demo_road extends React.Component { 'road', 'https://gw.alipayobjects.com/mdn/rms_23a451/afts/img/A*haGlTpW2BQgAAAAAAAAAAAAAARQnAQ', ); - + // @ts-ignore const layer = new LineLayer() .source(data) .size(10) diff --git a/stories/Map/components/amap2demo_road2.tsx b/stories/Map/components/amap2demo_road2.tsx index 30c7a2ee88..78c8636ff0 100644 --- a/stories/Map/components/amap2demo_road2.tsx +++ b/stories/Map/components/amap2demo_road2.tsx @@ -33,7 +33,7 @@ export default class Amap2demo_road2 extends React.Component { '02', 'https://gw.alipayobjects.com/zos/bmw-prod/ce83fc30-701f-415b-9750-4b146f4b3dd6.svg', ); - + // @ts-ignore const layer = new LineLayer({}) .source(data) .size(5) diff --git a/stories/Map/map.stories.tsx b/stories/Map/map.stories.tsx index 118acaad82..e4e34b1780 100644 --- a/stories/Map/map.stories.tsx +++ b/stories/Map/map.stories.tsx @@ -17,6 +17,7 @@ import Amap2demo_polygon_extrude from './components/amap2demo_polygon_extrude' import Amap2demo_arcLine from "./components/amap2demo_arcLine" import Amap2demo_arcLine3d from "./components/amap2demo_arcLine3d" import Amap2demo_arcLine_greatCircle from "./components/amap2demo_arcLine_greatCircle" +import Amap2demo_arcLine_greatCircleTex from "./components/amap2demo_arcLine_greatCircleTex" import Amap2demo_lineHeight from "./components/amap2demo_lineHeight" import Amap2demo_lineDash from "./components/amap2demo_lineDash" import Amap2demo_arcLineDir from "./components/amap2demo_arcLineDir" @@ -65,7 +66,8 @@ storiesOf('地图方法', module) .add('高德地图2.0 line_arc', () => ) .add('高德地图2.0 line_arc3d', () => ) - .add('高德地图2.0 line_arc3d_greatCircle', () => ) + .add('高德地图2.0 line_arc_greatCircle', () => ) + .add('高德地图2.0 line_arc_greatCircleTex', () => ) .add('高德地图2.0 lineHeight', () => ) .add('高德地图2.0 lineDash', () => ) From 17a9b06470dea501f124c36c228d84d0eedbb6ca Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 8 Jun 2021 17:39:01 +0800 Subject: [PATCH 10/12] =?UTF-8?q?feat:=20markers=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E3=80=81=E4=BF=AE=E5=A4=8D=E8=81=9A=E5=90=88?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E3=80=81=E4=BA=8B=E4=BB=B6=E9=80=8F=E4=BC=A0?= =?UTF-8?q?=E3=80=81markerlayer=20=E5=A2=9E=E5=8A=A0=20hide/show=20?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/component/src/markerlayer.ts | 21 +++++- .../services/interaction/PickingService.ts | 24 ++++++- packages/maps/src/amap2/map.ts | 7 +- .../components/amap2demo_clustermarker.tsx | 65 +++++++++++++++++++ .../Map/components/amap2demo_markerlayer.tsx | 13 ++++ stories/Map/map.stories.tsx | 2 + stories/React/components/Scene.tsx | 25 +++++-- 7 files changed, 149 insertions(+), 8 deletions(-) create mode 100644 stories/Map/components/amap2demo_clustermarker.tsx diff --git a/packages/component/src/markerlayer.ts b/packages/component/src/markerlayer.ts index 1740f4c1e3..2d4dae08cf 100644 --- a/packages/component/src/markerlayer.ts +++ b/packages/component/src/markerlayer.ts @@ -77,7 +77,8 @@ export default class MarkerLayer extends EventEmitter { this.initCluster(); this.update(); // 地图视野变化时,重新计算视野内的聚合点。 - this.mapsService.on('camerachange', this.update); + this.mapsService.on('camerachange', this.update); // amap1.x 更新事件 + this.mapsService.on('viewchange', this.update); // amap2.0 更新事件 } this.addMarkers(); return this; @@ -98,6 +99,24 @@ export default class MarkerLayer extends EventEmitter { } } + /** + * 隐藏 marker 在每个 marker 上单独修改属性而不是在 markerContainer 上修改(在 markerContainer 修改会有用户在场景加载完之前调用失败的问题) + */ + public hide() { + this.markers.map((m) => { + m.getElement().style.opacity = '0'; + }); + } + + /** + * 显示 marker + */ + public show() { + this.markers.map((m) => { + m.getElement().style.opacity = '1'; + }); + } + public getMarkers() { const cluster = this.markerLayerOption.cluster; return cluster ? this.clusterMarkers : this.markers; diff --git a/packages/core/src/services/interaction/PickingService.ts b/packages/core/src/services/interaction/PickingService.ts index 784bdbed66..a9eff49243 100644 --- a/packages/core/src/services/interaction/PickingService.ts +++ b/packages/core/src/services/interaction/PickingService.ts @@ -321,7 +321,29 @@ export default class PickingService implements IPickingService { featureId: number | null; }, ) { - layer.emit(target.type, target); + // 判断是否发生事件冲突 + if (this.isEventCrash(target)) { + layer.emit(target.type, target); + } + } + + /** + * 检测触发事件是否是在 marker/popup 上发生,若是则会发生冲突(发生冲突时 marker/popup 事件优先) + * @param obj + * @returns + */ + private isEventCrash(obj: any) { + let notCrash = true; + obj.target.path.map((p: HTMLElement) => { + if(p.classList) { + p.classList.forEach((n: any) => { + if (n === 'l7-marker' || n === 'l7-popup') { + notCrash = false; + } + }); + } + }); + return notCrash; } /** diff --git a/packages/maps/src/amap2/map.ts b/packages/maps/src/amap2/map.ts index ea854169c7..6d170c1e52 100644 --- a/packages/maps/src/amap2/map.ts +++ b/packages/maps/src/amap2/map.ts @@ -152,7 +152,12 @@ export default class AMapService // 'amap-maps', // )[0] as HTMLElement; // this.markerContainer = DOM.create('div', 'l7-marker-container2', amap); - this.markerContainer = mapContainer; + this.markerContainer = DOM.create( + 'div', + 'l7-marker-container2', + mapContainer, + ); + // this.markerContainer = mapContainer; } } public getMarkerContainer(): HTMLElement { diff --git a/stories/Map/components/amap2demo_clustermarker.tsx b/stories/Map/components/amap2demo_clustermarker.tsx new file mode 100644 index 0000000000..ecfd412c98 --- /dev/null +++ b/stories/Map/components/amap2demo_clustermarker.tsx @@ -0,0 +1,65 @@ +//@ts-ignore +import { MarkerLayer, Marker, Scene } from '@antv/l7'; +import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import * as React from 'react'; +export default class Amap2demo_clustermarker extends React.Component { + // @ts-ignore + private scene: Scene; + + public componentWillUnmount() { + // this.scene.destroy(); + } + + public async componentDidMount() { + const scene = new Scene({ + id: 'map', + map: new GaodeMap({ + center: [110.19382669582967, 30.258134], + pitch: 0, + zoom: 3, + }), + }); + + scene.on('loaded', () => { + addMarkers(); + scene.render(); + }); + function addMarkers() { + fetch( + 'https://gw.alipayobjects.com/os/basement_prod/d3564b06-670f-46ea-8edb-842f7010a7c6.json', + ) + .then((res) => res.json()) + .then((nodes) => { + const markerLayer = new MarkerLayer({ + cluster: true, + }); + for (let i = 0; i < nodes.features.length; i++) { + const { coordinates } = nodes.features[i].geometry; + const marker = new Marker().setLnglat({ + lng: coordinates[0], + lat: coordinates[1], + }); + markerLayer.addMarker(marker); + } + scene.addMarkerLayer(markerLayer); + }); + } + } + + public render() { + return ( + <> +
+ + ); + } +} diff --git a/stories/Map/components/amap2demo_markerlayer.tsx b/stories/Map/components/amap2demo_markerlayer.tsx index efac07e85b..4dcb9f2b41 100644 --- a/stories/Map/components/amap2demo_markerlayer.tsx +++ b/stories/Map/components/amap2demo_markerlayer.tsx @@ -58,7 +58,20 @@ export default class Amap2demo_markerlayer extends React.Component { markerLayer.addMarker(marker); } scene.addMarkerLayer(markerLayer); + // scene.on('loaded', () => { + // markerLayer.hide() + // }) + let f = 0; + setInterval(() => { + if (f === 0) { + markerLayer.hide(); + f = 1; + } else { + markerLayer.show(); + f = 0; + } + }, 800); this.scene = scene; } diff --git a/stories/Map/map.stories.tsx b/stories/Map/map.stories.tsx index e4e34b1780..cd6ab411a0 100644 --- a/stories/Map/map.stories.tsx +++ b/stories/Map/map.stories.tsx @@ -42,6 +42,7 @@ import Amap2demo_citybuilding from "./components/amap2demo_citybuilding" import Amap2demo_drilldown from "./components/amap2demo_drilldown" import Amap2demo_markerlayer from "./components/amap2demo_markerlayer" +import Amap2demo_clustermarker from './components/amap2demo_clustermarker'; import Amap2demo_instance from "./components/amap2demo_instance" @@ -92,6 +93,7 @@ storiesOf('地图方法', module) .add('高德地图2.0 点击下钻', () => ) .add('高德地图2.0 Marker图层', () => ) + .add('高德地图2.0 clusterMarker图层', () => ) .add('高德地图2.0 instance实例', () => ) diff --git a/stories/React/components/Scene.tsx b/stories/React/components/Scene.tsx index 67886b0fa1..9ab625cffd 100644 --- a/stories/React/components/Scene.tsx +++ b/stories/React/components/Scene.tsx @@ -25,9 +25,16 @@ export default React.memo(function Map() { fetchData(); }, []); const popupClick = (e: any) => { - e.stopPropagation(); + console.log(e); + // e.stopPropagation(); alert('11333'); }; + + const markerClick = (e: any) => { + console.log(e); + // e.stopPropagation(); + alert('marker'); + }; return ( <>

122224

- -

tes

+ +
+

tes

+
{ - console.log(e); + console.log('LayerEvent', e); }} /> From 3d3724059691a4b7f391b6246d3140d2281824dc Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Tue, 8 Jun 2021 20:31:59 +0800 Subject: [PATCH 11/12] =?UTF-8?q?feat:=20=E7=BA=BF=E5=9B=BE=E5=B1=82?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=B8=90=E5=8F=98=E9=A2=9C=E8=89=B2=EF=BC=88?= =?UTF-8?q?line/arc/arc3d/great=5Fcircle=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/interaction/PickingService.ts | 4 +- packages/layers/src/core/interface.ts | 14 +-- packages/layers/src/line/models/arc.ts | 19 ++++ packages/layers/src/line/models/arc_3d.ts | 19 ++++ .../layers/src/line/models/great_circle.ts | 20 ++++ packages/layers/src/line/models/line.ts | 19 ++++ .../src/line/shaders/line_arc_3d_frag.glsl | 13 ++- .../src/line/shaders/line_arc_3d_vert.glsl | 4 +- .../src/line/shaders/line_arc_frag.glsl | 13 ++- .../shaders/line_arc_great_circle_frag.glsl | 13 ++- .../shaders/line_arc_great_circle_vert.glsl | 4 +- .../src/line/shaders/line_arc_vert.glsl | 2 +- .../layers/src/line/shaders/line_frag.glsl | 13 ++- .../layers/src/line/shaders/line_vert.glsl | 3 +- .../layers/src/plugins/DataMappingPlugin.ts | 1 + .../Map/components/amap2demo_arcLine3DTex.tsx | 8 +- .../components/amap2demo_arcLineLinear.tsx | 96 +++++++++++++++++++ .../Map/components/amap2demo_arcLineTex.tsx | 10 +- .../amap2demo_arcLine_greatCircleTex.tsx | 6 +- .../Map/components/amap2demo_lineLinear.tsx | 89 +++++++++++++++++ stories/Map/map.stories.tsx | 4 + 21 files changed, 346 insertions(+), 28 deletions(-) create mode 100644 stories/Map/components/amap2demo_arcLineLinear.tsx create mode 100644 stories/Map/components/amap2demo_lineLinear.tsx diff --git a/packages/core/src/services/interaction/PickingService.ts b/packages/core/src/services/interaction/PickingService.ts index a9eff49243..393ff61200 100644 --- a/packages/core/src/services/interaction/PickingService.ts +++ b/packages/core/src/services/interaction/PickingService.ts @@ -335,13 +335,13 @@ export default class PickingService implements IPickingService { private isEventCrash(obj: any) { let notCrash = true; obj.target.path.map((p: HTMLElement) => { - if(p.classList) { + if (p.classList) { p.classList.forEach((n: any) => { if (n === 'l7-marker' || n === 'l7-popup') { notCrash = false; } }); - } + } }); return notCrash; } diff --git a/packages/layers/src/core/interface.ts b/packages/layers/src/core/interface.ts index fe157e442d..8a1963451a 100644 --- a/packages/layers/src/core/interface.ts +++ b/packages/layers/src/core/interface.ts @@ -5,11 +5,13 @@ export enum lineStyleType { export interface ILineLayerStyleOptions { opacity: number; - lineType?: keyof typeof lineStyleType; - dashArray?: [number, number]; + lineType?: keyof typeof lineStyleType; // 可选参数、线类型(all - dash/solid) + dashArray?: [number, number]; // 可选参数、虚线间隔 segmentNumber: number; - forward?: boolean; - lineTexture?: boolean; - iconStep?: number; - textureBlend?: string; // 可选参数、供给纹理贴图使用 + forward?: boolean; // 可选参数、是否反向(arcLine) + lineTexture?: boolean; // 可选参数、是否开启纹理贴图功能(all) + iconStep?: number; // 可选参数、纹理贴图步长(all) + textureBlend?: string; // 可选参数、供给纹理贴图使用(all) + sourceColor?: string; // 可选参数、设置渐变色的起始颜色(all) + targetColor?: string; // 可选参数、设置渐变色的终点颜色(all) } diff --git a/packages/layers/src/line/models/arc.ts b/packages/layers/src/line/models/arc.ts index 7bb35280e9..317c1fd3f1 100644 --- a/packages/layers/src/line/models/arc.ts +++ b/packages/layers/src/line/models/arc.ts @@ -14,6 +14,7 @@ import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; import { LineArcTriangulation } from '../../core/triangulation'; import line_arc_frag from '../shaders/line_arc_frag.glsl'; import line_arc2d_vert from '../shaders/line_arc_vert.glsl'; +import { rgb2arr } from '@antv/l7-utils' const lineStyleObj: { [key: string]: number } = { solid: 0.0, dash: 1.0, @@ -23,6 +24,8 @@ export default class ArcModel extends BaseModel { public getUninforms(): IModelUniform { const { opacity, + sourceColor, + targetColor, textureBlend = 'normal', lineType = 'solid', dashArray = [10, 5], @@ -35,6 +38,16 @@ export default class ArcModel extends BaseModel { dashArray.push(0, 0); } + // 转化渐变色 + let useLinearColor = 0 // 默认不生效 + let sourceColorArr = [0, 0, 0, 0] + let targetColorArr = [0, 0, 0, 0] + if(sourceColor && targetColor) { + sourceColorArr = rgb2arr(sourceColor) + targetColorArr = rgb2arr(targetColor) + useLinearColor = 1 + } + if (this.rendererService.getDirty()) { this.texture.bind(); } @@ -48,10 +61,16 @@ export default class ArcModel extends BaseModel { u_blur: 0.9, u_lineDir: forward ? 1 : -1, + // 纹理支持参数 u_texture: this.texture, // 贴图 u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识 u_icon_step: iconStep, u_textSize: [1024, this.iconService.canvasHeight || 128], + + // 渐变色支持参数 + u_linearColor: useLinearColor, + u_sourceColor: sourceColorArr, + u_targetColor: targetColorArr }; } diff --git a/packages/layers/src/line/models/arc_3d.ts b/packages/layers/src/line/models/arc_3d.ts index a8348d91e5..3f8ae72ee0 100644 --- a/packages/layers/src/line/models/arc_3d.ts +++ b/packages/layers/src/line/models/arc_3d.ts @@ -13,6 +13,7 @@ import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; import { LineArcTriangulation } from '../../core/triangulation'; import line_arc_frag from '../shaders/line_arc_3d_frag.glsl'; import line_arc_vert from '../shaders/line_arc_3d_vert.glsl'; +import { rgb2arr } from '@antv/l7-utils' const lineStyleObj: { [key: string]: number } = { solid: 0.0, dash: 1.0, @@ -22,6 +23,8 @@ export default class Arc3DModel extends BaseModel { public getUninforms(): IModelUniform { const { opacity, + sourceColor, + targetColor, textureBlend = 'normal', lineType = 'solid', dashArray = [10, 5], @@ -33,6 +36,16 @@ export default class Arc3DModel extends BaseModel { dashArray.push(0, 0); } + // 转化渐变色 + let useLinearColor = 0 // 默认不生效 + let sourceColorArr = [0, 0, 0, 0] + let targetColorArr = [0, 0, 0, 0] + if(sourceColor && targetColor) { + sourceColorArr = rgb2arr(sourceColor) + targetColorArr = rgb2arr(targetColor) + useLinearColor = 1 + } + if (this.rendererService.getDirty()) { this.texture.bind(); } @@ -44,10 +57,16 @@ export default class Arc3DModel extends BaseModel { u_line_type: lineStyleObj[lineType as string] || 0.0, u_dash_array: dashArray, + // 纹理支持参数 u_texture: this.texture, // 贴图 u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识 u_icon_step: iconStep, u_textSize: [1024, this.iconService.canvasHeight || 128], + + // 渐变色支持参数 + u_linearColor: useLinearColor, + u_sourceColor: sourceColorArr, + u_targetColor: targetColorArr }; } diff --git a/packages/layers/src/line/models/great_circle.ts b/packages/layers/src/line/models/great_circle.ts index 1a93e8beed..c525c1698b 100644 --- a/packages/layers/src/line/models/great_circle.ts +++ b/packages/layers/src/line/models/great_circle.ts @@ -15,6 +15,7 @@ import { LineArcTriangulation } from '../../core/triangulation'; // import line_arc_frag from '../shaders/line_arc_frag.glsl'; import line_arc_frag from '../shaders/line_arc_great_circle_frag.glsl'; import line_arc2d_vert from '../shaders/line_arc_great_circle_vert.glsl'; +import { rgb2arr } from '@antv/l7-utils' const lineStyleObj: { [key: string]: number } = { solid: 0.0, dash: 1.0, @@ -25,6 +26,8 @@ export default class GreatCircleModel extends BaseModel { public getUninforms(): IModelUniform { const { opacity, + sourceColor, + targetColor, textureBlend = 'normal', lineType = 'solid', dashArray = [10, 5], @@ -39,6 +42,17 @@ export default class GreatCircleModel extends BaseModel { if (this.rendererService.getDirty()) { this.texture.bind(); } + + // 转化渐变色 + let useLinearColor = 0 // 默认不生效 + let sourceColorArr = [0, 0, 0, 0] + let targetColorArr = [0, 0, 0, 0] + if(sourceColor && targetColor) { + sourceColorArr = rgb2arr(sourceColor) + targetColorArr = rgb2arr(targetColor) + useLinearColor = 1 + } + return { u_opacity: opacity === undefined ? 1 : opacity, u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, @@ -46,10 +60,16 @@ export default class GreatCircleModel extends BaseModel { u_line_type: lineStyleObj[lineType as string] || 0.0, u_dash_array: dashArray, + // 纹理支持参数 u_texture: this.texture, // 贴图 u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识 u_icon_step: iconStep, u_textSize: [1024, this.iconService.canvasHeight || 128], + + // 渐变色支持参数 + u_linearColor: useLinearColor, + u_sourceColor: sourceColorArr, + u_targetColor: targetColorArr }; } public getAnimateUniforms(): IModelUniform { diff --git a/packages/layers/src/line/models/line.ts b/packages/layers/src/line/models/line.ts index 0ae74c6b75..3058613058 100644 --- a/packages/layers/src/line/models/line.ts +++ b/packages/layers/src/line/models/line.ts @@ -15,6 +15,7 @@ import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; import { LineTriangulation } from '../../core/triangulation'; import line_frag from '../shaders/line_frag.glsl'; import line_vert from '../shaders/line_vert.glsl'; +import { rgb2arr } from '@antv/l7-utils' const lineStyleObj: { [key: string]: number } = { solid: 0.0, dash: 1.0, @@ -24,6 +25,8 @@ export default class LineModel extends BaseModel { public getUninforms(): IModelUniform { const { opacity, + sourceColor, + targetColor, textureBlend = 'normal', lineType = 'solid', dashArray = [10, 5, 0, 0], @@ -38,16 +41,32 @@ export default class LineModel extends BaseModel { this.texture.bind(); } + // 转化渐变色 + let useLinearColor = 0 // 默认不生效 + let sourceColorArr = [0, 0, 0, 0] + let targetColorArr = [0, 0, 0, 0] + if(sourceColor && targetColor) { + sourceColorArr = rgb2arr(sourceColor) + targetColorArr = rgb2arr(targetColor) + useLinearColor = 1 + } + return { u_opacity: opacity === undefined ? 1 : opacity, u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, u_line_type: lineStyleObj[lineType], u_dash_array: dashArray, + // 纹理支持参数 u_texture: this.texture, // 贴图 u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识 u_icon_step: iconStep, u_textSize: [1024, this.iconService.canvasHeight || 128], + + // 渐变色支持参数 + u_linearColor: useLinearColor, + u_sourceColor: sourceColorArr, + u_targetColor: targetColorArr }; } public getAnimateUniforms(): IModelUniform { diff --git a/packages/layers/src/line/shaders/line_arc_3d_frag.glsl b/packages/layers/src/line/shaders/line_arc_3d_frag.glsl index 0135d04dcb..d434b30f25 100644 --- a/packages/layers/src/line/shaders/line_arc_3d_frag.glsl +++ b/packages/layers/src/line/shaders/line_arc_3d_frag.glsl @@ -26,11 +26,22 @@ varying vec2 v_iconMapUV; uniform float u_time; uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ]; +uniform float u_linearColor: 0; +uniform vec4 u_sourceColor; +uniform vec4 u_targetColor; + #pragma include "picking" void main() { float animateSpeed = 0.0; // 运动速度 - gl_FragColor = v_color; + // gl_FragColor = v_color; + + if(u_linearColor == 1.0) { // 使用渐变颜色 + gl_FragColor = mix(u_sourceColor, u_targetColor, v_segmentIndex/segmentNumber); + } else { // 使用 color 方法传入的颜色 + gl_FragColor = v_color; + } + // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy)); // float blur = smoothstep(1.0, u_blur, length(v_normal.xy)); gl_FragColor.a *= u_opacity; diff --git a/packages/layers/src/line/shaders/line_arc_3d_vert.glsl b/packages/layers/src/line/shaders/line_arc_3d_vert.glsl index a6152a411f..a2809a8989 100644 --- a/packages/layers/src/line/shaders/line_arc_3d_vert.glsl +++ b/packages/layers/src/line/shaders/line_arc_3d_vert.glsl @@ -106,8 +106,8 @@ void main() { v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y); - if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // 开启贴图模式 - v_segmentIndex = a_Position.x; + v_segmentIndex = a_Position.x; + if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { // 开启贴图模式 v_arcDistrance = length(source - target); v_pixelLen = project_pixel(u_icon_step); diff --git a/packages/layers/src/line/shaders/line_arc_frag.glsl b/packages/layers/src/line/shaders/line_arc_frag.glsl index 1ceff01e27..1923bc5c03 100644 --- a/packages/layers/src/line/shaders/line_arc_frag.glsl +++ b/packages/layers/src/line/shaders/line_arc_frag.glsl @@ -27,12 +27,23 @@ varying float v_a; varying vec2 v_offset; varying vec2 v_iconMapUV; +uniform float u_linearColor: 0; +uniform vec4 u_sourceColor; +uniform vec4 u_targetColor; + #pragma include "picking" void main() { float animateSpeed = 0.0; // 运动速度 - gl_FragColor = v_color; + if(u_linearColor == 1.0) { // 使用渐变颜色 + gl_FragColor = mix(u_sourceColor, u_targetColor, v_segmentIndex/segmentNumber); + } else { // 使用 color 方法传入的颜色 + gl_FragColor = v_color; + } + + // gl_FragColor = v_color; + // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy)); // float blur = smoothstep(1.0, u_blur, length(v_normal.xy)); gl_FragColor.a *= u_opacity; diff --git a/packages/layers/src/line/shaders/line_arc_great_circle_frag.glsl b/packages/layers/src/line/shaders/line_arc_great_circle_frag.glsl index 20caf1ddc7..a67b05cd3f 100644 --- a/packages/layers/src/line/shaders/line_arc_great_circle_frag.glsl +++ b/packages/layers/src/line/shaders/line_arc_great_circle_frag.glsl @@ -26,11 +26,22 @@ varying vec2 v_offset; varying float v_a; varying vec2 v_iconMapUV; +uniform float u_linearColor: 0; +uniform vec4 u_sourceColor; +uniform vec4 u_targetColor; + #pragma include "picking" void main() { float animateSpeed = 0.0; - gl_FragColor = v_color; + // gl_FragColor = v_color; + + if(u_linearColor == 1.0) { // 使用渐变颜色 + gl_FragColor = mix(u_sourceColor, u_targetColor, v_segmentIndex/segmentNumber); + } else { // 使用 color 方法传入的颜色 + gl_FragColor = v_color; + } + // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy)); // float blur = smoothstep(1.0, u_blur, length(v_normal.xy)); gl_FragColor.a *= u_opacity; diff --git a/packages/layers/src/line/shaders/line_arc_great_circle_vert.glsl b/packages/layers/src/line/shaders/line_arc_great_circle_vert.glsl index 5b966f093c..2c1f845ba5 100644 --- a/packages/layers/src/line/shaders/line_arc_great_circle_vert.glsl +++ b/packages/layers/src/line/shaders/line_arc_great_circle_vert.glsl @@ -156,8 +156,8 @@ void main() { // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0)); // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0)); - if(LineTexture == u_line_texture) { // 开启贴图模式 - v_segmentIndex = a_Position.x; + v_segmentIndex = a_Position.x; + if(LineTexture == u_line_texture) { // 开启贴图模式 v_arcDistrance = length(source - target); v_pixelLen = project_pixel(u_icon_step)/8.0; diff --git a/packages/layers/src/line/shaders/line_arc_vert.glsl b/packages/layers/src/line/shaders/line_arc_vert.glsl index 9abc20cd6a..59b6b37a0a 100644 --- a/packages/layers/src/line/shaders/line_arc_vert.glsl +++ b/packages/layers/src/line/shaders/line_arc_vert.glsl @@ -118,9 +118,9 @@ void main() { vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y)); + v_segmentIndex = a_Position.x + 1.0; if(LineTexture == u_line_texture) { // 开启贴图模式 - v_segmentIndex = a_Position.x + 1.0; v_arcDistrance = length(source - target); v_iconMapUV = a_iconMapUV; v_pixelLen = project_pixel(u_icon_step); diff --git a/packages/layers/src/line/shaders/line_frag.glsl b/packages/layers/src/line/shaders/line_frag.glsl index e053cd7725..68707ffb3b 100644 --- a/packages/layers/src/line/shaders/line_frag.glsl +++ b/packages/layers/src/line/shaders/line_frag.glsl @@ -28,6 +28,10 @@ varying float v_pixelLen; varying vec2 v_iconMapUV; varying float v_strokeWidth; +uniform float u_linearColor: 0; +uniform vec4 u_sourceColor; +uniform vec4 u_targetColor; + #pragma include "picking" uniform float u_time; @@ -35,7 +39,14 @@ uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ]; // 控制运动 // [animate, duration, interval, trailLength], void main() { float animateSpeed = 0.0; // 运动速度 - gl_FragColor = v_color; + // gl_FragColor = v_color; + + if(u_linearColor == 1.0) { // 使用渐变颜色 + gl_FragColor = mix(u_sourceColor, u_targetColor, v_distance_ratio); + } else { // 使用 color 方法传入的颜色 + gl_FragColor = v_color; + } + // anti-alias // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy)); gl_FragColor.a *= u_opacity; // 全局透明度 diff --git a/packages/layers/src/line/shaders/line_vert.glsl b/packages/layers/src/line/shaders/line_vert.glsl index ebb0552656..7b3ea09f71 100644 --- a/packages/layers/src/line/shaders/line_vert.glsl +++ b/packages/layers/src/line/shaders/line_vert.glsl @@ -36,6 +36,7 @@ varying float v_size; varying float v_a; varying float v_pixelLen; varying vec2 v_iconMapUV; +uniform float u_linearColor: 0; // varying float v_strokeWidth; void main() { @@ -49,7 +50,7 @@ void main() { // v_distance_ratio = 0.01; v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance; } - if(u_aimate.x == Animate) { + if(u_aimate.x == Animate || u_linearColor == 1.0) { v_distance_ratio = a_Distance / a_Total_Distance; } v_normal = vec2(reverse_offset_normal(a_Normal) * sign(a_Miter)); diff --git a/packages/layers/src/plugins/DataMappingPlugin.ts b/packages/layers/src/plugins/DataMappingPlugin.ts index 3eef2fb7ba..ee4cd4ad37 100644 --- a/packages/layers/src/plugins/DataMappingPlugin.ts +++ b/packages/layers/src/plugins/DataMappingPlugin.ts @@ -127,6 +127,7 @@ export default class DataMappingPlugin implements ILayerPlugin { // TODO: 支持每个属性配置 postprocess if (attribute.name === 'color') { + // console.log('attribute', attribute) values = values.map((c: unknown) => { return rgb2arr(c as string); }); diff --git a/stories/Map/components/amap2demo_arcLine3DTex.tsx b/stories/Map/components/amap2demo_arcLine3DTex.tsx index 1931d60051..dab9ed1e92 100644 --- a/stories/Map/components/amap2demo_arcLine3DTex.tsx +++ b/stories/Map/components/amap2demo_arcLine3DTex.tsx @@ -61,10 +61,12 @@ export default class Amap2demo_arcLine3DTex extends React.Component { // opacity: 0, opacity: 0.8, // opacity: 0.2, - lineType: 'dash', - dashArray: [5, 5], - textureBlend: 'replace', + // lineType: 'dash', + // dashArray: [5, 5], + // textureBlend: 'replace', // textureBlend: 'normal', + sourceColor: "#f00", + targetColor: "#0f0" }); // .animate({ // duration: 50, diff --git a/stories/Map/components/amap2demo_arcLineLinear.tsx b/stories/Map/components/amap2demo_arcLineLinear.tsx new file mode 100644 index 0000000000..82a9fec9c7 --- /dev/null +++ b/stories/Map/components/amap2demo_arcLineLinear.tsx @@ -0,0 +1,96 @@ +// @ts-ignore +import { LineLayer, Scene } from '@antv/l7'; +import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import * as React from 'react'; + +export default class Amap2demo_arcLineLinear extends React.Component { + // @ts-ignore + private scene: Scene; + + public componentWillUnmount() { + this.scene.destroy(); + } + + public async componentDidMount() { + const scene = new Scene({ + id: 'map', + // map: new GaodeMapV1({ + map: new GaodeMap({ + pitch: 40, + center: [107.77791556935472, 35.443286920228644], + zoom: 2.9142882493605033, + viewMode: '3D', + style: 'dark', + }), + }); + this.scene = scene; + + scene.on('loaded', () => { + scene.addImage( + '02', + 'https://gw.alipayobjects.com/zos/bmw-prod/0ca1668e-38c2-4010-8568-b57cb33839b9.svg', + ); + + let data = [ + { + lng1: 75.76171875, + lat1: 36.31512514748051, + lng2: 46.23046874999999, + lat2: 52.802761415419674, + }, + ]; + // @ts-ignore + const layer = new LineLayer({ + blend: 'normal', + }) + .source(data, { + parser: { + type: 'json', + x: 'lng1', + y: 'lat1', + x1: 'lng2', + y1: 'lat2', + }, + }) + .size(20) + .shape('arc') + .color('#f00') + .style({ + // forward: false, + lineTexture: true, // 开启线的贴图功能 + iconStep: 30, // 设置贴图纹理的间距 + // opacity: 0.5, + // opacity: 0.2, + // lineType: 'dash', + // dashArray: [5, 5], + // textureBlend: 'replace', + // textureBlend: 'normal', + sourceColor: "#f00", + targetColor: "#0f0" + }) + // .animate({ + // duration: 50, + // interval: 0.3, + // trailLength: 0.1, + // }); + scene.addLayer(layer); + }); + } + + public render() { + return ( + <> +
+ + ); + } +} diff --git a/stories/Map/components/amap2demo_arcLineTex.tsx b/stories/Map/components/amap2demo_arcLineTex.tsx index cfafcac2b7..1fd04ea33f 100644 --- a/stories/Map/components/amap2demo_arcLineTex.tsx +++ b/stories/Map/components/amap2demo_arcLineTex.tsx @@ -67,11 +67,11 @@ export default class Amap2demo_arcLineTex extends React.Component { // textureBlend: 'replace', // textureBlend: 'normal', }) - .animate({ - duration: 50, - interval: 0.3, - trailLength: 0.1, - }); + // .animate({ + // duration: 50, + // interval: 0.3, + // trailLength: 0.1, + // }); scene.addLayer(layer); }); } diff --git a/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx b/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx index b02c25d47a..9484af8e46 100644 --- a/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx +++ b/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx @@ -63,15 +63,17 @@ export default class Amap2demo_arcLine_greatCircle extends React.Component { .color('#ff0000') .texture('02') .style({ - // opacity: 0.0, + opacity: 0.6, // textureBlend: 'replace', // textureBlend: 'normal', blur: 0.99, - // lineTexture: true, // 开启线的贴图功能 + lineTexture: true, // 开启线的贴图功能 iconStep: 5, // 设置贴图纹理的间距 // lineType: 'dash', // dashArray: [5, 5], + sourceColor: "#f00", + targetColor: "#0f0" }); // .animate({ // duration: 5, diff --git a/stories/Map/components/amap2demo_lineLinear.tsx b/stories/Map/components/amap2demo_lineLinear.tsx new file mode 100644 index 0000000000..064e73d6ea --- /dev/null +++ b/stories/Map/components/amap2demo_lineLinear.tsx @@ -0,0 +1,89 @@ +// @ts-ignore +import { LineLayer, Scene } from '@antv/l7'; +import { GaodeMap } from '@antv/l7-maps'; +import * as React from 'react'; + +export default class Amap2demo_lineLinear extends React.Component { + // @ts-ignore + private scene: Scene; + + public componentWillUnmount() { + this.scene.destroy(); + } + + public async componentDidMount() { + const scene = new Scene({ + id: 'map', + map: new GaodeMap({ + center: [120.19382669582967, 30.258134], + pitch: 0, + zoom: 16, + viewMode: '3D', + }), + }); + this.scene = scene; + + scene.on('loaded', () => { + fetch( + 'https://gw.alipayobjects.com/os/basement_prod/40ef2173-df66-4154-a8c0-785e93a5f18e.json', + ) + .then((res) => res.json()) + .then((data) => { + scene.addImage( + '00', + 'https://gw.alipayobjects.com/zos/basement_prod/604b5e7f-309e-40db-b95b-4fac746c5153.svg', + ); + scene.addImage( + '01', + 'https://gw.alipayobjects.com/zos/basement_prod/30580bc9-506f-4438-8c1a-744e082054ec.svg', + ); + scene.addImage( + '02', + 'https://gw.alipayobjects.com/zos/bmw-prod/ce83fc30-701f-415b-9750-4b146f4b3dd6.svg', + ); + // @ts-ignore + const layer = new LineLayer({}) + .source(data) + .size(5) + .shape('line') + .texture('01') + .color('#25d8b7') + // .animate({ + // interval: 1, // 间隔 + // duration: 1, // 持续时间,延时 + // trailLength: 2, // 流线长度 + // }) + .style({ + opacity: 0.5, + // opacity: 0, + // lineTexture: true, // 开启线的贴图功能 + // iconStep: 50, // 设置贴图纹理的间距 + // lineType: 'dash', + // dashArray: [5, 5], + // textureBlend: 'replace', + // textureBlend: 'normal', + sourceColor: "#f00", + targetColor: "#0f0" + }); + scene.addLayer(layer); + }); + }); + } + + public render() { + return ( + <> +
+ + ); + } +} diff --git a/stories/Map/map.stories.tsx b/stories/Map/map.stories.tsx index cd6ab411a0..c7c2a20eea 100644 --- a/stories/Map/map.stories.tsx +++ b/stories/Map/map.stories.tsx @@ -22,8 +22,10 @@ import Amap2demo_lineHeight from "./components/amap2demo_lineHeight" import Amap2demo_lineDash from "./components/amap2demo_lineDash" import Amap2demo_arcLineDir from "./components/amap2demo_arcLineDir" import Amap2demo_arcLineTex from './components/amap2demo_arcLineTex'; +import Amap2demo_arcLineLinear from './components/amap2demo_arcLineLinear'; import Amap2demo_arcLine3DTex from './components/amap2demo_arcLine3DTex'; import Amap2demo_lineStreet from './components/amap2demo_lineStreet'; +import Amap2demo_lineLinear from './components/amap2demo_lineLinear'; import Amap2demo_road from './components/amap2demo_road'; import Amap2demo_road2 from './components/amap2demo_road2'; @@ -74,10 +76,12 @@ storiesOf('地图方法', module) .add('高德地图2.0 line_arcDir', () => ) .add('高德地图2.0 line_arcTex', () => ) + .add('高德地图2.0 line_arcLinear', () => ) .add('高德地图2.0 line_arc3DTex', () => ) .add('高德地图2.0 line_winds', () => ) .add('高德地图2.0 line_Street', () => ) + .add('高德地图2.0 line_Linear', () => ) .add('高德地图2.0 road', () => ) .add('高德地图2.0 road2', () => ) From 04202c7595de198ae1a5b2f963e8a958777e596f Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Wed, 9 Jun 2021 13:23:48 +0800 Subject: [PATCH 12/12] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E9=AB=98?= =?UTF-8?q?=E5=BE=B7=E5=BA=95=E5=9B=BE=E9=BB=98=E8=AE=A4=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E7=89=88=E6=9C=AC,=20=E4=BF=AE=E5=A4=8DpointLayer/normal=20?= =?UTF-8?q?=E7=9A=84=E5=81=8F=E7=A7=BB=E5=A4=B1=E6=95=88:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/map.zh.md | 4 +-- packages/layers/src/core/interface.ts | 12 ++++---- packages/layers/src/line/models/arc.ts | 18 ++++++------ packages/layers/src/line/models/arc_3d.ts | 28 +++++++++---------- .../layers/src/line/models/great_circle.ts | 18 ++++++------ packages/layers/src/line/models/line.ts | 28 +++++++++---------- .../src/line/shaders/line_arc_frag.glsl | 3 +- .../src/line/shaders/line_arc_vert.glsl | 4 ++- .../layers/src/point/shaders/normal_vert.glsl | 4 ++- packages/maps/src/index.ts | 7 +++-- stories/3D_Model/Components/amap_three.tsx | 5 ++-- stories/Map/components/amap2demo.tsx | 10 ++++--- .../Map/components/amap2demo_arcLine3DTex.tsx | 7 +++-- .../components/amap2demo_arcLineLinear.tsx | 19 ++++++------- .../Map/components/amap2demo_arcLineTex.tsx | 18 ++++++------ .../amap2demo_arcLine_greatCircleTex.tsx | 6 ++-- .../components/amap2demo_clustermarker.tsx | 2 +- .../Map/components/amap2demo_drawControl.tsx | 4 +-- .../components/amap2demo_heatmap_hexagon.tsx | 4 +-- stories/Map/components/amap2demo_instance.tsx | 10 +++---- .../Map/components/amap2demo_lineLinear.tsx | 4 +-- .../Map/components/amap2demo_markerlayer.tsx | 2 +- stories/Map/components/mapCenter.tsx | 5 ++-- 23 files changed, 116 insertions(+), 106 deletions(-) diff --git a/docs/api/map.zh.md b/docs/api/map.zh.md index 3c9e2b6b16..69713b5855 100644 --- a/docs/api/map.zh.md +++ b/docs/api/map.zh.md @@ -15,8 +15,8 @@ L7 在内部解决了不同地图底图之间差异,同时 L7 层面统一管 ### 引入 Map ```javascript -import { GaodeMap } from '@antv/l7-maps'; // 默认引入高德2.0 -import { GaodeMapV1 } from '@antv/l7-maps'; // 默认引入高德1.x 版本 +import { GaodeMap } from '@antv/l7-maps'; // 默认引入高德1.x +import { GaodeMapV2 } from '@antv/l7-maps'; // 默认引入高德2.0 版本 import { Mapbox } from '@antv/l7-maps'; ``` diff --git a/packages/layers/src/core/interface.ts b/packages/layers/src/core/interface.ts index 8a1963451a..813f7e933c 100644 --- a/packages/layers/src/core/interface.ts +++ b/packages/layers/src/core/interface.ts @@ -8,10 +8,10 @@ export interface ILineLayerStyleOptions { lineType?: keyof typeof lineStyleType; // 可选参数、线类型(all - dash/solid) dashArray?: [number, number]; // 可选参数、虚线间隔 segmentNumber: number; - forward?: boolean; // 可选参数、是否反向(arcLine) - lineTexture?: boolean; // 可选参数、是否开启纹理贴图功能(all) - iconStep?: number; // 可选参数、纹理贴图步长(all) - textureBlend?: string; // 可选参数、供给纹理贴图使用(all) - sourceColor?: string; // 可选参数、设置渐变色的起始颜色(all) - targetColor?: string; // 可选参数、设置渐变色的终点颜色(all) + forward?: boolean; // 可选参数、是否反向(arcLine) + lineTexture?: boolean; // 可选参数、是否开启纹理贴图功能(all) + iconStep?: number; // 可选参数、纹理贴图步长(all) + textureBlend?: string; // 可选参数、供给纹理贴图使用(all) + sourceColor?: string; // 可选参数、设置渐变色的起始颜色(all) + targetColor?: string; // 可选参数、设置渐变色的终点颜色(all) } diff --git a/packages/layers/src/line/models/arc.ts b/packages/layers/src/line/models/arc.ts index 317c1fd3f1..0be036189d 100644 --- a/packages/layers/src/line/models/arc.ts +++ b/packages/layers/src/line/models/arc.ts @@ -9,12 +9,12 @@ import { ITexture2D, } from '@antv/l7-core'; +import { rgb2arr } from '@antv/l7-utils'; import BaseModel from '../../core/BaseModel'; import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; import { LineArcTriangulation } from '../../core/triangulation'; import line_arc_frag from '../shaders/line_arc_frag.glsl'; import line_arc2d_vert from '../shaders/line_arc_vert.glsl'; -import { rgb2arr } from '@antv/l7-utils' const lineStyleObj: { [key: string]: number } = { solid: 0.0, dash: 1.0, @@ -39,13 +39,13 @@ export default class ArcModel extends BaseModel { } // 转化渐变色 - let useLinearColor = 0 // 默认不生效 - let sourceColorArr = [0, 0, 0, 0] - let targetColorArr = [0, 0, 0, 0] - if(sourceColor && targetColor) { - sourceColorArr = rgb2arr(sourceColor) - targetColorArr = rgb2arr(targetColor) - useLinearColor = 1 + let useLinearColor = 0; // 默认不生效 + let sourceColorArr = [0, 0, 0, 0]; + let targetColorArr = [0, 0, 0, 0]; + if (sourceColor && targetColor) { + sourceColorArr = rgb2arr(sourceColor); + targetColorArr = rgb2arr(targetColor); + useLinearColor = 1; } if (this.rendererService.getDirty()) { @@ -70,7 +70,7 @@ export default class ArcModel extends BaseModel { // 渐变色支持参数 u_linearColor: useLinearColor, u_sourceColor: sourceColorArr, - u_targetColor: targetColorArr + u_targetColor: targetColorArr, }; } diff --git a/packages/layers/src/line/models/arc_3d.ts b/packages/layers/src/line/models/arc_3d.ts index 3f8ae72ee0..9972b19e18 100644 --- a/packages/layers/src/line/models/arc_3d.ts +++ b/packages/layers/src/line/models/arc_3d.ts @@ -8,12 +8,12 @@ import { IModelUniform, ITexture2D, } from '@antv/l7-core'; +import { rgb2arr } from '@antv/l7-utils'; import BaseModel from '../../core/BaseModel'; import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; import { LineArcTriangulation } from '../../core/triangulation'; import line_arc_frag from '../shaders/line_arc_3d_frag.glsl'; import line_arc_vert from '../shaders/line_arc_3d_vert.glsl'; -import { rgb2arr } from '@antv/l7-utils' const lineStyleObj: { [key: string]: number } = { solid: 0.0, dash: 1.0, @@ -36,15 +36,15 @@ export default class Arc3DModel extends BaseModel { dashArray.push(0, 0); } - // 转化渐变色 - let useLinearColor = 0 // 默认不生效 - let sourceColorArr = [0, 0, 0, 0] - let targetColorArr = [0, 0, 0, 0] - if(sourceColor && targetColor) { - sourceColorArr = rgb2arr(sourceColor) - targetColorArr = rgb2arr(targetColor) - useLinearColor = 1 - } + // 转化渐变色 + let useLinearColor = 0; // 默认不生效 + let sourceColorArr = [0, 0, 0, 0]; + let targetColorArr = [0, 0, 0, 0]; + if (sourceColor && targetColor) { + sourceColorArr = rgb2arr(sourceColor); + targetColorArr = rgb2arr(targetColor); + useLinearColor = 1; + } if (this.rendererService.getDirty()) { this.texture.bind(); @@ -63,10 +63,10 @@ export default class Arc3DModel extends BaseModel { u_icon_step: iconStep, u_textSize: [1024, this.iconService.canvasHeight || 128], - // 渐变色支持参数 - u_linearColor: useLinearColor, - u_sourceColor: sourceColorArr, - u_targetColor: targetColorArr + // 渐变色支持参数 + u_linearColor: useLinearColor, + u_sourceColor: sourceColorArr, + u_targetColor: targetColorArr, }; } diff --git a/packages/layers/src/line/models/great_circle.ts b/packages/layers/src/line/models/great_circle.ts index c525c1698b..5ba5004732 100644 --- a/packages/layers/src/line/models/great_circle.ts +++ b/packages/layers/src/line/models/great_circle.ts @@ -9,13 +9,13 @@ import { ITexture2D, } from '@antv/l7-core'; +import { rgb2arr } from '@antv/l7-utils'; import BaseModel from '../../core/BaseModel'; import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; import { LineArcTriangulation } from '../../core/triangulation'; // import line_arc_frag from '../shaders/line_arc_frag.glsl'; import line_arc_frag from '../shaders/line_arc_great_circle_frag.glsl'; import line_arc2d_vert from '../shaders/line_arc_great_circle_vert.glsl'; -import { rgb2arr } from '@antv/l7-utils' const lineStyleObj: { [key: string]: number } = { solid: 0.0, dash: 1.0, @@ -44,13 +44,13 @@ export default class GreatCircleModel extends BaseModel { } // 转化渐变色 - let useLinearColor = 0 // 默认不生效 - let sourceColorArr = [0, 0, 0, 0] - let targetColorArr = [0, 0, 0, 0] - if(sourceColor && targetColor) { - sourceColorArr = rgb2arr(sourceColor) - targetColorArr = rgb2arr(targetColor) - useLinearColor = 1 + let useLinearColor = 0; // 默认不生效 + let sourceColorArr = [0, 0, 0, 0]; + let targetColorArr = [0, 0, 0, 0]; + if (sourceColor && targetColor) { + sourceColorArr = rgb2arr(sourceColor); + targetColorArr = rgb2arr(targetColor); + useLinearColor = 1; } return { @@ -69,7 +69,7 @@ export default class GreatCircleModel extends BaseModel { // 渐变色支持参数 u_linearColor: useLinearColor, u_sourceColor: sourceColorArr, - u_targetColor: targetColorArr + u_targetColor: targetColorArr, }; } public getAnimateUniforms(): IModelUniform { diff --git a/packages/layers/src/line/models/line.ts b/packages/layers/src/line/models/line.ts index 3058613058..3135541ccd 100644 --- a/packages/layers/src/line/models/line.ts +++ b/packages/layers/src/line/models/line.ts @@ -10,12 +10,12 @@ import { ITexture2D, } from '@antv/l7-core'; +import { rgb2arr } from '@antv/l7-utils'; import BaseModel from '../../core/BaseModel'; import { ILineLayerStyleOptions, lineStyleType } from '../../core/interface'; import { LineTriangulation } from '../../core/triangulation'; import line_frag from '../shaders/line_frag.glsl'; import line_vert from '../shaders/line_vert.glsl'; -import { rgb2arr } from '@antv/l7-utils' const lineStyleObj: { [key: string]: number } = { solid: 0.0, dash: 1.0, @@ -41,15 +41,15 @@ export default class LineModel extends BaseModel { this.texture.bind(); } - // 转化渐变色 - let useLinearColor = 0 // 默认不生效 - let sourceColorArr = [0, 0, 0, 0] - let targetColorArr = [0, 0, 0, 0] - if(sourceColor && targetColor) { - sourceColorArr = rgb2arr(sourceColor) - targetColorArr = rgb2arr(targetColor) - useLinearColor = 1 - } + // 转化渐变色 + let useLinearColor = 0; // 默认不生效 + let sourceColorArr = [0, 0, 0, 0]; + let targetColorArr = [0, 0, 0, 0]; + if (sourceColor && targetColor) { + sourceColorArr = rgb2arr(sourceColor); + targetColorArr = rgb2arr(targetColor); + useLinearColor = 1; + } return { u_opacity: opacity === undefined ? 1 : opacity, @@ -63,10 +63,10 @@ export default class LineModel extends BaseModel { u_icon_step: iconStep, u_textSize: [1024, this.iconService.canvasHeight || 128], - // 渐变色支持参数 - u_linearColor: useLinearColor, - u_sourceColor: sourceColorArr, - u_targetColor: targetColorArr + // 渐变色支持参数 + u_linearColor: useLinearColor, + u_sourceColor: sourceColorArr, + u_targetColor: targetColorArr, }; } public getAnimateUniforms(): IModelUniform { diff --git a/packages/layers/src/line/shaders/line_arc_frag.glsl b/packages/layers/src/line/shaders/line_arc_frag.glsl index 1923bc5c03..b446d58271 100644 --- a/packages/layers/src/line/shaders/line_arc_frag.glsl +++ b/packages/layers/src/line/shaders/line_arc_frag.glsl @@ -67,6 +67,7 @@ void main() { if(u_line_texture == LineTexture && u_line_type != LineTypeDash) { // while load texture float arcRadio = smoothstep( 0.0, 1.0, (v_segmentIndex / segmentNumber)); + // float arcRadio = smoothstep( 0.0, 1.0, v_distance_ratio); // float arcRadio = v_segmentIndex / (segmentNumber - 1.0); float count = floor(v_arcDistrance/v_pixelLen); @@ -90,7 +91,7 @@ void main() { } gl_FragColor = filterColor(pattern); } - + // gl_FragColor = vec4(arcRadio, 0.0, 0.0, 1.0); // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv)); // gl_FragColor = filterColor(texture2D(u_texture, uv)); diff --git a/packages/layers/src/line/shaders/line_arc_vert.glsl b/packages/layers/src/line/shaders/line_arc_vert.glsl index 59b6b37a0a..750a839c64 100644 --- a/packages/layers/src/line/shaders/line_arc_vert.glsl +++ b/packages/layers/src/line/shaders/line_arc_vert.glsl @@ -104,13 +104,15 @@ void main() { float total_Distance = pixelDistance(s, t) / 2.0 * PI; // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI; v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex); - } + } + if(u_aimate.x == Animate) { v_distance_ratio = segmentIndex / segmentNumber; if(u_lineDir != 1.0) { v_distance_ratio = 1.0 - v_distance_ratio; } } + vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio), 0.0, 1.0)); vec4 next = project_position(vec4(interpolate(source, target, nextSegmentRatio), 0.0, 1.0)); v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y); diff --git a/packages/layers/src/point/shaders/normal_vert.glsl b/packages/layers/src/point/shaders/normal_vert.glsl index 000895e6d1..4921c4f46a 100644 --- a/packages/layers/src/point/shaders/normal_vert.glsl +++ b/packages/layers/src/point/shaders/normal_vert.glsl @@ -10,6 +10,7 @@ uniform vec2 u_offsets; #pragma include "projection" #pragma include "picking" +#pragma include "project" void main() { v_color = a_Color; // vec2 offset = project_pixel(u_offsets); @@ -17,7 +18,8 @@ void main() { // gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\ // if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x - gl_Position = u_Mvp * vec4(a_Position, 1.0); + vec2 offset = project_pixel((u_offsets)); + gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0); } else { // else vec2 offset = project_pixel(u_offsets); vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.); diff --git a/packages/maps/src/index.ts b/packages/maps/src/index.ts index 00def5f58f..c3dc18c41a 100644 --- a/packages/maps/src/index.ts +++ b/packages/maps/src/index.ts @@ -1,7 +1,8 @@ // import GaodeMap from './amap/'; -import GaodeMapV1 from './amap/'; -import GaodeMap from './amap2/'; +import GaodeMap from './amap/'; +// import GaodeMapV1 from './amap/'; +import GaodeMapV2 from './amap2/'; import Map from './map/'; import Mapbox from './mapbox/'; -export { GaodeMap, GaodeMapV1, Mapbox, Map }; +export { GaodeMap, GaodeMapV2, Mapbox, Map }; diff --git a/stories/3D_Model/Components/amap_three.tsx b/stories/3D_Model/Components/amap_three.tsx index 8288ebc056..c63957acd3 100644 --- a/stories/3D_Model/Components/amap_three.tsx +++ b/stories/3D_Model/Components/amap_three.tsx @@ -1,5 +1,5 @@ import { Scene } from '@antv/l7'; -import { GaodeMap, Mapbox, GaodeMapV1 } from '@antv/l7-maps'; +import { GaodeMap, Mapbox } from '@antv/l7-maps'; import { ThreeLayer, ThreeRender } from '@antv/l7-three'; import * as React from 'react'; // import { DirectionalLight, Scene as ThreeScene } from 'three'; @@ -23,8 +23,7 @@ export default class GlTFThreeJSDemo extends React.Component { const scene = new Scene({ id: 'map', - // map: new GaodeMap({ - map: new GaodeMapV1({ + map: new GaodeMap({ center: [111.4453125, 32.84267363195431], pitch: 45, rotation: 30, diff --git a/stories/Map/components/amap2demo.tsx b/stories/Map/components/amap2demo.tsx index 60f4e47e80..6801cd3e9a 100644 --- a/stories/Map/components/amap2demo.tsx +++ b/stories/Map/components/amap2demo.tsx @@ -42,11 +42,11 @@ export default class Amap2demo extends React.Component { this.scene = scene; scene.on('loaded', () => { - console.log('event test'); + // console.log('event test'); // @ts-ignore - console.log(scene.map.getProjection().project); + // console.log(scene.map.getProjection().project); // @ts-ignore - console.log(scene.map.customCoords.lngLatToCoord); + // console.log(scene.map.customCoords.lngLatToCoord); const layer = new PointLayer() .source(originData, { parser: { @@ -55,13 +55,15 @@ export default class Amap2demo extends React.Component { y: 'lat', }, }) - .shape('circle') + // .shape('circle') // .shape('normal') + .shape('fill') .color('rgba(255, 0, 0, 0.9)') .size(10) .style({ stroke: '#fff', storkeWidth: 2, + offsets: [100, 100], }) .active(true); scene.addLayer(layer); diff --git a/stories/Map/components/amap2demo_arcLine3DTex.tsx b/stories/Map/components/amap2demo_arcLine3DTex.tsx index dab9ed1e92..4b77673884 100644 --- a/stories/Map/components/amap2demo_arcLine3DTex.tsx +++ b/stories/Map/components/amap2demo_arcLine3DTex.tsx @@ -25,6 +25,9 @@ export default class Amap2demo_arcLine3DTex extends React.Component { this.scene = scene; scene.on('loaded', () => { + setTimeout(() => { + scene.setPitch(0); + }, 4000); scene.addImage( '02', 'https://gw.alipayobjects.com/zos/bmw-prod/0ca1668e-38c2-4010-8568-b57cb33839b9.svg', @@ -65,8 +68,8 @@ export default class Amap2demo_arcLine3DTex extends React.Component { // dashArray: [5, 5], // textureBlend: 'replace', // textureBlend: 'normal', - sourceColor: "#f00", - targetColor: "#0f0" + sourceColor: '#f00', + targetColor: '#0f0', }); // .animate({ // duration: 50, diff --git a/stories/Map/components/amap2demo_arcLineLinear.tsx b/stories/Map/components/amap2demo_arcLineLinear.tsx index 82a9fec9c7..a6fb7bbcdb 100644 --- a/stories/Map/components/amap2demo_arcLineLinear.tsx +++ b/stories/Map/components/amap2demo_arcLineLinear.tsx @@ -1,6 +1,6 @@ // @ts-ignore import { LineLayer, Scene } from '@antv/l7'; -import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import { GaodeMap } from '@antv/l7-maps'; import * as React from 'react'; export default class Amap2demo_arcLineLinear extends React.Component { @@ -14,7 +14,6 @@ export default class Amap2demo_arcLineLinear extends React.Component { public async componentDidMount() { const scene = new Scene({ id: 'map', - // map: new GaodeMapV1({ map: new GaodeMap({ pitch: 40, center: [107.77791556935472, 35.443286920228644], @@ -65,14 +64,14 @@ export default class Amap2demo_arcLineLinear extends React.Component { // dashArray: [5, 5], // textureBlend: 'replace', // textureBlend: 'normal', - sourceColor: "#f00", - targetColor: "#0f0" - }) - // .animate({ - // duration: 50, - // interval: 0.3, - // trailLength: 0.1, - // }); + sourceColor: '#f00', + targetColor: '#0f0', + }); + // .animate({ + // duration: 50, + // interval: 0.3, + // trailLength: 0.1, + // }); scene.addLayer(layer); }); } diff --git a/stories/Map/components/amap2demo_arcLineTex.tsx b/stories/Map/components/amap2demo_arcLineTex.tsx index 1fd04ea33f..95e49bcfb2 100644 --- a/stories/Map/components/amap2demo_arcLineTex.tsx +++ b/stories/Map/components/amap2demo_arcLineTex.tsx @@ -1,6 +1,6 @@ // @ts-ignore import { LineLayer, Scene } from '@antv/l7'; -import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import { GaodeMap, GaodeMapV2 } from '@antv/l7-maps'; import * as React from 'react'; export default class Amap2demo_arcLineTex extends React.Component { @@ -14,7 +14,7 @@ export default class Amap2demo_arcLineTex extends React.Component { public async componentDidMount() { const scene = new Scene({ id: 'map', - // map: new GaodeMapV1({ + // map: new GaodeMapV2({ map: new GaodeMap({ pitch: 40, center: [107.77791556935472, 35.443286920228644], @@ -52,7 +52,7 @@ export default class Amap2demo_arcLineTex extends React.Component { y1: 'lat2', }, }) - .size(20) + .size(25) .shape('arc') .texture('02') .color('#8C1EB2') @@ -66,12 +66,12 @@ export default class Amap2demo_arcLineTex extends React.Component { // dashArray: [5, 5], // textureBlend: 'replace', // textureBlend: 'normal', - }) - // .animate({ - // duration: 50, - // interval: 0.3, - // trailLength: 0.1, - // }); + }); + // .animate({ + // duration: 50, + // interval: 0.3, + // trailLength: 0.1, + // }) scene.addLayer(layer); }); } diff --git a/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx b/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx index 9484af8e46..46c8af7916 100644 --- a/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx +++ b/stories/Map/components/amap2demo_arcLine_greatCircleTex.tsx @@ -1,6 +1,6 @@ // @ts-ignore import { LineLayer, Scene } from '@antv/l7'; -import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import { GaodeMap } from '@antv/l7-maps'; import * as React from 'react'; export default class Amap2demo_arcLine_greatCircle extends React.Component { @@ -72,8 +72,8 @@ export default class Amap2demo_arcLine_greatCircle extends React.Component { // lineType: 'dash', // dashArray: [5, 5], - sourceColor: "#f00", - targetColor: "#0f0" + sourceColor: '#f00', + targetColor: '#0f0', }); // .animate({ // duration: 5, diff --git a/stories/Map/components/amap2demo_clustermarker.tsx b/stories/Map/components/amap2demo_clustermarker.tsx index ecfd412c98..9f7f4d3e30 100644 --- a/stories/Map/components/amap2demo_clustermarker.tsx +++ b/stories/Map/components/amap2demo_clustermarker.tsx @@ -1,6 +1,6 @@ //@ts-ignore import { MarkerLayer, Marker, Scene } from '@antv/l7'; -import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import { GaodeMap } from '@antv/l7-maps'; import * as React from 'react'; export default class Amap2demo_clustermarker extends React.Component { // @ts-ignore diff --git a/stories/Map/components/amap2demo_drawControl.tsx b/stories/Map/components/amap2demo_drawControl.tsx index 9b94c8ab74..c45e8a7e1c 100644 --- a/stories/Map/components/amap2demo_drawControl.tsx +++ b/stories/Map/components/amap2demo_drawControl.tsx @@ -1,6 +1,6 @@ //@ts-ignore import { PointLayer, Scene } from '@antv/l7'; -import { GaodeMapV1 } from '@antv/l7-maps'; +import { GaodeMap } from '@antv/l7-maps'; import { DrawControl } from '@antv/l7-draw'; import * as React from 'react'; export default class Amap2demo_drawControl extends React.Component { @@ -14,7 +14,7 @@ export default class Amap2demo_drawControl extends React.Component { public async componentDidMount() { const scene = new Scene({ id: 'map', - map: new GaodeMapV1({ + map: new GaodeMap({ pitch: 0, style: 'light', layers: [], diff --git a/stories/Map/components/amap2demo_heatmap_hexagon.tsx b/stories/Map/components/amap2demo_heatmap_hexagon.tsx index 2f51d3b23b..79c584158d 100644 --- a/stories/Map/components/amap2demo_heatmap_hexagon.tsx +++ b/stories/Map/components/amap2demo_heatmap_hexagon.tsx @@ -1,6 +1,6 @@ // @ts-ignore import { Scene, HeatmapLayer } from '@antv/l7'; -import { GaodeMap } from '@antv/l7-maps'; +import { GaodeMap, GaodeMapV2 } from '@antv/l7-maps'; import * as React from 'react'; export default class Amap2demo_heatmap_hexagon extends React.Component { @@ -47,7 +47,7 @@ export default class Amap2demo_heatmap_hexagon extends React.Component { ], }) .size('sum', (sum) => { - return sum * 200; + return sum * 20000; }) .shape('hexagonColumn') .style({ diff --git a/stories/Map/components/amap2demo_instance.tsx b/stories/Map/components/amap2demo_instance.tsx index 787244aba6..380b27077a 100644 --- a/stories/Map/components/amap2demo_instance.tsx +++ b/stories/Map/components/amap2demo_instance.tsx @@ -1,6 +1,6 @@ //@ts-ignore import { PointLayer, Scene } from '@antv/l7'; -import { GaodeMap } from '@antv/l7-maps'; +import { GaodeMap, GaodeMapV2 } from '@antv/l7-maps'; import AMapLoader from '@amap/amap-jsapi-loader'; import * as React from 'react'; export default class Amap2demo_instance extends React.Component { @@ -12,10 +12,10 @@ export default class Amap2demo_instance extends React.Component { } public async componentDidMount() { - // const AMAP_API_KEY: string = '15cd8a57710d40c9b7c0e3cc120f1200'; - // const AMAP_VERSION: string = '1.4.15'; - const AMAP_API_KEY: string = 'ff533602d57df6f8ab3b0fea226ae52f'; - const AMAP_VERSION: string = '2.0'; + const AMAP_API_KEY: string = '15cd8a57710d40c9b7c0e3cc120f1200'; + const AMAP_VERSION: string = '1.4.15'; + // const AMAP_API_KEY: string = 'ff533602d57df6f8ab3b0fea226ae52f'; + // const AMAP_VERSION: string = '2.0'; AMapLoader.load({ key: AMAP_API_KEY, // 申请好的Web端开发者Key,首次调用 load 时必填 diff --git a/stories/Map/components/amap2demo_lineLinear.tsx b/stories/Map/components/amap2demo_lineLinear.tsx index 064e73d6ea..3a3d3a26e3 100644 --- a/stories/Map/components/amap2demo_lineLinear.tsx +++ b/stories/Map/components/amap2demo_lineLinear.tsx @@ -62,8 +62,8 @@ export default class Amap2demo_lineLinear extends React.Component { // dashArray: [5, 5], // textureBlend: 'replace', // textureBlend: 'normal', - sourceColor: "#f00", - targetColor: "#0f0" + sourceColor: '#f00', + targetColor: '#0f0', }); scene.addLayer(layer); }); diff --git a/stories/Map/components/amap2demo_markerlayer.tsx b/stories/Map/components/amap2demo_markerlayer.tsx index 4dcb9f2b41..55c83240ce 100644 --- a/stories/Map/components/amap2demo_markerlayer.tsx +++ b/stories/Map/components/amap2demo_markerlayer.tsx @@ -1,6 +1,6 @@ //@ts-ignore import { MarkerLayer, Marker, Scene } from '@antv/l7'; -import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import { GaodeMap } from '@antv/l7-maps'; import * as React from 'react'; export default class Amap2demo_markerlayer extends React.Component { // @ts-ignore diff --git a/stories/Map/components/mapCenter.tsx b/stories/Map/components/mapCenter.tsx index 001637cee0..abd67ca056 100644 --- a/stories/Map/components/mapCenter.tsx +++ b/stories/Map/components/mapCenter.tsx @@ -1,6 +1,6 @@ // @ts-ignore import { ILngLat, PointLayer, PolygonLayer, Scene } from '@antv/l7'; -import { GaodeMap, GaodeMapV1 } from '@antv/l7-maps'; +import { GaodeMap } from '@antv/l7-maps'; import * as React from 'react'; export default class GaodeMapComponent extends React.Component { @@ -14,7 +14,7 @@ export default class GaodeMapComponent extends React.Component { public async componentDidMount() { const scene = new Scene({ id: 'map', - map: new GaodeMapV1({ + map: new GaodeMap({ center: [121.107846, 30.267069], pitch: 0, style: 'normal', @@ -58,6 +58,7 @@ export default class GaodeMapComponent extends React.Component { .style({ stroke: '#fff', storkeWidth: 2, + offsets: [100, 100], }); scene.addLayer(layer); scene.render();