From 4563c6d24a709c96c7d919823eca419a08a03c83 Mon Sep 17 00:00:00 2001 From: susiwen8 Date: Thu, 16 Dec 2021 14:29:44 +0800 Subject: [PATCH 1/2] docs: fix 404 links (#882) --- docs/api/layer/layer.zh.md | 2 +- docs/common/layer/layer_encode.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/layer/layer.zh.md b/docs/api/layer/layer.zh.md index 78ca4aa56d..3ea3ffe1f9 100644 --- a/docs/api/layer/layer.zh.md +++ b/docs/api/layer/layer.zh.md @@ -79,7 +79,7 @@ layer 初始化完成之后,是否自动缩放到图层范围 {bool } default - parser 数据解析,默认是解析层 geojson - transforms [transform,transform ]  数据处理转换 可设置多个 -parser 和  transforms [见 source 文档](../source/source) +parser 和  transforms [见 source 文档](../../source/source) ```javascript layer.source(data, { diff --git a/docs/common/layer/layer_encode.md b/docs/common/layer/layer_encode.md index 3d52dc56f4..bf46709607 100644 --- a/docs/common/layer/layer_encode.md +++ b/docs/common/layer/layer_encode.md @@ -10,7 +10,7 @@ - parser 数据解析,默认是解析层 geojson - transforms [transform,transform ]  数据处理转换 可设置多个 -parser 和  transforms [见 source 文档](../source/source) +parser 和  transforms [见 source 文档](../../api/source/source) ```javascript layer.source(data, { From 401b770679e4dc1271883c6f383869bab00cfd31 Mon Sep 17 00:00:00 2001 From: YiQianYao <42212176+2912401452@users.noreply.github.com> Date: Fri, 17 Dec 2021 10:54:06 +0800 Subject: [PATCH 2/2] Shihuidev (#883) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 增加着色器的拾取计算控制、完善 arcmini * feat: 完善 enableShaderPick/disableShaderPick 功能 * style: lint style * feat: 补充调用高德地图公交线路查询 demo * style: lint style * feat: 优化弧线的纹理动画 * style: lint style * feat: 去除greatCircle 的纹理动画优化 * feat: 扩展点图层圆柱效果 * feat: 增加几何体的径向渐变配置 * style: lint style * fix: 修复bug 图层触发的事件跟图层设置的zIndex无关,只跟插入图层先后顺序有关 * style: lint style * feat: 补全挤出几何体拾取颜色的光照配置 * style: lint style * fix: 修复圆柱 cull 问题 mapbox amap 不同 * feat: 图层销毁时的内存泄漏 * style: lint style * feat: 平面弧线新增弧线偏移量的数据映射能力 * style: lint style * fix: 修复重复销毁bug * style: lint style * feat: 修复 texture 重复销毁问题 * style: lint style * fix: 修复图层叠加模式下的拾取失效问题 * style: lint style * fix: 修复纹理贴图在 zoom 大于 12 时存在的问题 * fix: 修复水波点颜色偏暗 * feat: 优化点图层的渲染效果,叠加渲染效果 * style: lint style * fix: 修复 layer contextmenu 事件丢失 * fix: 修复 map 类型 resize 失效 * style: lint style * feat: 增加瓦片地图的请求节流 * style: lint style * feat: 优化热力图在 radius 数值比较大时热力点边缘发生裁剪的现象 * style: lint style * fix: 修复resize 后 picking shiqu 拾取失败的问题 * chore: update version 2.6.17 -> 2.6.18 bugfix * feat: 优化 marker/popup 在容器边缘的表现 * feat: 增加 setEnableRender 方法 * style: lint style * feat: 增加城市图层扫光特效 * style: lint style --- lerna.json | 2 +- packages/component/package.json | 6 +-- packages/component/src/marker.ts | 1 + packages/component/src/popup.ts | 2 + packages/core/package.json | 4 +- .../core/src/services/layer/ILayerService.ts | 1 + .../core/src/services/layer/LayerService.ts | 8 +++- packages/l7/package.json | 16 +++---- packages/l7/src/version.ts | 2 +- packages/layers/package.json | 8 ++-- .../layers/src/citybuliding/models/build.ts | 46 +++++++++++++++++++ .../src/citybuliding/shaders/build_frag.glsl | 14 ++++++ .../src/citybuliding/shaders/build_vert.glsl | 17 ++++++- packages/map/package.json | 4 +- packages/maps/package.json | 8 ++-- packages/mini/package.json | 12 ++--- packages/renderer/package.json | 4 +- packages/scene/package.json | 14 +++--- packages/scene/src/index.ts | 4 ++ packages/source/package.json | 6 +-- packages/three/package.json | 8 ++-- packages/utils/package.json | 2 +- stories/Components/components/Marker.tsx | 6 +-- stories/Components/components/Popup.tsx | 2 +- .../Map/components/amap2demo_citybuilding.tsx | 11 ++++- stories/Map/components/mapCenter.tsx | 7 ++- 26 files changed, 158 insertions(+), 57 deletions(-) diff --git a/lerna.json b/lerna.json index 5a67f4db0d..2ad6c3231e 100644 --- a/lerna.json +++ b/lerna.json @@ -14,7 +14,7 @@ "message": "chore: publish" } }, - "version": "2.6.17", + "version": "2.6.18", "npmClient": "yarn", "useWorkspaces": true, "publishConfig": { diff --git a/packages/component/package.json b/packages/component/package.json index bb3b253cd2..058f9ca18a 100644 --- a/packages/component/package.json +++ b/packages/component/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-component", - "version": "2.6.17", + "version": "2.6.18", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -25,8 +25,8 @@ "author": "lzxue", "license": "ISC", "dependencies": { - "@antv/l7-core": "^2.6.17", - "@antv/l7-utils": "^2.6.17", + "@antv/l7-core": "^2.6.18", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7", "eventemitter3": "^4.0.0", "inversify": "^5.0.1", diff --git a/packages/component/src/marker.ts b/packages/component/src/marker.ts index 9f04045e68..d5301e1a6d 100644 --- a/packages/component/src/marker.ts +++ b/packages/component/src/marker.ts @@ -230,6 +230,7 @@ export default class Marker extends EventEmitter { if (element) { element.style.display = 'block'; + element.style.whiteSpace = 'nowrap'; const container = this.mapsService.getContainer(); let containerWidth = 0; let containerHeight = 0; diff --git a/packages/component/src/popup.ts b/packages/component/src/popup.ts index 9209fe8127..db599fc64c 100644 --- a/packages/component/src/popup.ts +++ b/packages/component/src/popup.ts @@ -238,6 +238,8 @@ export default class Popup extends EventEmitter implements IPopup { }, ); } + + this.container.style.whiteSpace = 'nowrap'; } if (maxWidth && this.container.style.maxWidth !== maxWidth) { this.container.style.maxWidth = maxWidth; diff --git a/packages/core/package.json b/packages/core/package.json index 653a2d7403..b828725e4b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-core", - "version": "2.6.17", + "version": "2.6.18", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -24,7 +24,7 @@ "license": "ISC", "dependencies": { "@antv/async-hook": "^2.1.0", - "@antv/l7-utils": "^2.6.17", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7", "ajv": "^6.10.2", "element-resize-event": "^3.0.3", diff --git a/packages/core/src/services/layer/ILayerService.ts b/packages/core/src/services/layer/ILayerService.ts index 700c52d805..acdb9ad46b 100644 --- a/packages/core/src/services/layer/ILayerService.ts +++ b/packages/core/src/services/layer/ILayerService.ts @@ -393,6 +393,7 @@ export interface ILayerService { removeAllLayers(): void; updateLayerRenderList(): void; renderLayers(type?: string): void; + setEnableRender(flag: boolean): void; getOESTextureFloat(): boolean; isMapDragging(): boolean; diff --git a/packages/core/src/services/layer/LayerService.ts b/packages/core/src/services/layer/LayerService.ts index 7fdf418bc4..6e27203b6d 100644 --- a/packages/core/src/services/layer/LayerService.ts +++ b/packages/core/src/services/layer/LayerService.ts @@ -28,6 +28,8 @@ export default class LayerService implements ILayerService { // TODO: 是否开启 shader 中的颜色拾取计算 private shaderPicking: boolean = true; + private enableRender: boolean = true; + @inject(TYPES.IRendererService) private readonly renderService: IRendererService; @@ -93,8 +95,12 @@ export default class LayerService implements ILayerService { this.destroy(); } + public setEnableRender(flag: boolean) { + this.enableRender = flag; + } + public renderLayers() { - if (this.alreadyInRendering) { + if (this.alreadyInRendering || !this.enableRender) { return; } this.alreadyInRendering = true; diff --git a/packages/l7/package.json b/packages/l7/package.json index b14672708c..c6cd01cbd9 100644 --- a/packages/l7/package.json +++ b/packages/l7/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7", - "version": "2.6.17", + "version": "2.6.18", "description": "A Large-scale WebGL-powered Geospatial Data Visualization", "main": "lib/index.js", "module": "es/index.js", @@ -25,13 +25,13 @@ "author": "antv", "license": "MIT", "dependencies": { - "@antv/l7-component": "^2.6.17", - "@antv/l7-core": "^2.6.17", - "@antv/l7-layers": "^2.6.17", - "@antv/l7-maps": "^2.6.17", - "@antv/l7-scene": "^2.6.17", - "@antv/l7-source": "^2.6.17", - "@antv/l7-utils": "^2.6.17", + "@antv/l7-component": "^2.6.18", + "@antv/l7-core": "^2.6.18", + "@antv/l7-layers": "^2.6.18", + "@antv/l7-maps": "^2.6.18", + "@antv/l7-scene": "^2.6.18", + "@antv/l7-source": "^2.6.18", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7" }, "gitHead": "684ba4eb806a798713496d3fc0b4d1e17517dc31", diff --git a/packages/l7/src/version.ts b/packages/l7/src/version.ts index 633782c7fd..1ede505634 100644 --- a/packages/l7/src/version.ts +++ b/packages/l7/src/version.ts @@ -1,2 +1,2 @@ -const version = '2.6.17'; +const version = '2.6.18'; export { version }; diff --git a/packages/layers/package.json b/packages/layers/package.json index 32baaa9660..1920a805ef 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-layers", - "version": "2.6.17", + "version": "2.6.18", "description": "L7's collection of built-in layers", "main": "lib/index.js", "module": "es/index.js", @@ -24,9 +24,9 @@ "license": "ISC", "dependencies": { "@antv/geo-coord": "^1.0.8", - "@antv/l7-core": "^2.6.17", - "@antv/l7-source": "^2.6.17", - "@antv/l7-utils": "^2.6.17", + "@antv/l7-core": "^2.6.18", + "@antv/l7-source": "^2.6.18", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7", "@mapbox/martini": "^0.2.0", "@turf/meta": "^6.0.2", diff --git a/packages/layers/src/citybuliding/models/build.ts b/packages/layers/src/citybuliding/models/build.ts index 0f433dbcc2..d7c4861dc5 100644 --- a/packages/layers/src/citybuliding/models/build.ts +++ b/packages/layers/src/citybuliding/models/build.ts @@ -10,8 +10,17 @@ interface ICityBuildLayerStyleOptions { brightColor: string; windowColor: string; time: number; + sweep: { + enable: boolean; + sweepRadius: number; + sweepColor: string; + sweepSpeed: number; + }; } export default class CityBuildModel extends BaseModel { + private cityCenter: [number, number]; + private cityMinSize: number; + public getUninforms() { const { opacity = 1, @@ -19,8 +28,20 @@ export default class CityBuildModel extends BaseModel { brightColor = 'rgb(255,176,38)', windowColor = 'rgb(30,60,89)', time = 0, + sweep = { + enable: false, + sweepRadius: 1, + sweepColor: 'rgb(255, 255, 255)', + sweepSpeed: 0.4, + }, } = this.layer.getLayerConfig() as ICityBuildLayerStyleOptions; return { + u_cityCenter: this.cityCenter, + u_cityMinSize: this.cityMinSize * sweep.sweepRadius, + u_circleSweep: sweep.enable ? 1.0 : 0.0, + u_circleSweepColor: rgb2arr(sweep.sweepColor).slice(0, 3), + u_circleSweepSpeed: sweep.sweepSpeed, + u_opacity: opacity, u_baseColor: rgb2arr(baseColor), u_brightColor: rgb2arr(brightColor), @@ -29,7 +50,32 @@ export default class CityBuildModel extends BaseModel { }; } + public calCityGeo() { + // @ts-ignore + const [minLng, minLat, maxLng, maxLat] = this.layer.getSource().extent; + if (this.mapService.version === 'GAODE2.x') { + // @ts-ignore + this.cityCenter = this.mapService.lngLatToCoord([ + (maxLng + minLng) / 2, + (maxLat + minLat) / 2, + ]); + // @ts-ignore + const l1 = this.mapService.lngLatToCoord([maxLng, maxLat]); + // @ts-ignore + const l2 = this.mapService.lngLatToCoord([minLng, minLat]); + this.cityMinSize = + Math.sqrt(Math.pow(l1[0] - l2[0], 2) + Math.pow(l1[1] - l2[1], 2)) / 4; + } else { + const w = maxLng - minLng; + const h = maxLat - minLat; + this.cityCenter = [(maxLng + minLng) / 2, (maxLat + minLat) / 2]; + this.cityMinSize = Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)) / 4; + } + } + public initModels(): IModel[] { + this.calCityGeo(); + this.startModelAnimate(); return [ this.layer.buildLayerModel({ diff --git a/packages/layers/src/citybuliding/shaders/build_frag.glsl b/packages/layers/src/citybuliding/shaders/build_frag.glsl index 049c9b7c8f..f643a89019 100644 --- a/packages/layers/src/citybuliding/shaders/build_frag.glsl +++ b/packages/layers/src/citybuliding/shaders/build_frag.glsl @@ -9,6 +9,13 @@ varying vec2 v_texCoord; uniform float u_Zoom : 1; uniform float u_time; +uniform float u_circleSweep; +uniform float u_cityMinSize; +uniform vec3 u_circleSweepColor; +uniform float u_circleSweepSpeed; + +varying float v_worldDis; + #pragma include "picking" vec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) { @@ -98,6 +105,13 @@ void main() { gl_FragColor = vec4(foggedColor,1.0); } + + + if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) { + float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0); + gl_FragColor.rgb += r * r * u_circleSweepColor; + } + gl_FragColor.a *= u_opacity; gl_FragColor = filterColor(gl_FragColor); } diff --git a/packages/layers/src/citybuliding/shaders/build_vert.glsl b/packages/layers/src/citybuliding/shaders/build_vert.glsl index f561a14ca2..413abdd42b 100644 --- a/packages/layers/src/citybuliding/shaders/build_vert.glsl +++ b/packages/layers/src/citybuliding/shaders/build_vert.glsl @@ -16,15 +16,30 @@ varying vec2 v_texCoord; varying vec4 v_Color; uniform mat4 u_Mvp; +uniform float u_circleSweep; +uniform vec2 u_cityCenter; + +varying float v_worldDis; + #pragma include "projection" #pragma include "light" #pragma include "picking" + void main() { vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0); vec4 project_pos = project_position(pos); + v_texCoord = a_Uv; - // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0)); + + if(u_circleSweep > 0.0) { + vec2 lnglatscale = vec2(0.0); + if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) { + lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135); + } + v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter); + } + if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0)); } else { diff --git a/packages/map/package.json b/packages/map/package.json index 4ff3204e04..ba0e3b9fae 100644 --- a/packages/map/package.json +++ b/packages/map/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-map", - "version": "2.6.17", + "version": "2.6.18", "description": "l7 map", "keywords": [], "author": "thinkinggis ", @@ -37,7 +37,7 @@ }, "homepage": "https://github.com/antvis/L7#readme", "dependencies": { - "@antv/l7-utils": "^2.6.17", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7", "@mapbox/point-geometry": "^0.1.0", "@mapbox/unitbezier": "^0.0.0", diff --git a/packages/maps/package.json b/packages/maps/package.json index 3c3d0fa78b..5ab4dab60f 100644 --- a/packages/maps/package.json +++ b/packages/maps/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-maps", - "version": "2.6.17", + "version": "2.6.18", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -27,9 +27,9 @@ "license": "ISC", "dependencies": { "@amap/amap-jsapi-loader": "^0.0.3", - "@antv/l7-core": "^2.6.17", - "@antv/l7-map": "^2.6.17", - "@antv/l7-utils": "^2.6.17", + "@antv/l7-core": "^2.6.18", + "@antv/l7-map": "^2.6.18", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7", "@types/amap-js-api": "^1.4.6", "@types/mapbox-gl": "^1.11.2", diff --git a/packages/mini/package.json b/packages/mini/package.json index 34cb3747ad..14ed13a4f5 100644 --- a/packages/mini/package.json +++ b/packages/mini/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-mini", - "version": "2.6.17", + "version": "2.6.18", "description": "A Large-scale WebGL-powered Geospatial Data Visualization", "main": "lib/index.js", "module": "es/index.js", @@ -25,11 +25,11 @@ "author": "antv", "license": "MIT", "dependencies": { - "@antv/l7-core": "^2.6.17", - "@antv/l7-layers": "^2.6.17", - "@antv/l7-maps": "^2.6.17", - "@antv/l7-scene": "^2.6.17", - "@antv/l7-utils": "^2.6.17", + "@antv/l7-core": "^2.6.18", + "@antv/l7-layers": "^2.6.18", + "@antv/l7-maps": "^2.6.18", + "@antv/l7-scene": "^2.6.18", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7" }, "gitHead": "684ba4eb806a798713496d3fc0b4d1e17517dc31", diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 9b27643571..6b8101cc89 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-renderer", - "version": "2.6.17", + "version": "2.6.18", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -26,7 +26,7 @@ "gl": "^4.4.0" }, "dependencies": { - "@antv/l7-core": "^2.6.17", + "@antv/l7-core": "^2.6.18", "@babel/runtime": "^7.7.7", "inversify": "^5.0.1", "l7regl": "^0.0.16", diff --git a/packages/scene/package.json b/packages/scene/package.json index 4bd1ed30e1..59049b268b 100644 --- a/packages/scene/package.json +++ b/packages/scene/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-scene", - "version": "2.6.17", + "version": "2.6.18", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -23,12 +23,12 @@ "author": "xiaoiver", "license": "ISC", "dependencies": { - "@antv/l7-component": "^2.6.17", - "@antv/l7-core": "^2.6.17", - "@antv/l7-layers": "^2.6.17", - "@antv/l7-maps": "^2.6.17", - "@antv/l7-renderer": "^2.6.17", - "@antv/l7-utils": "^2.6.17", + "@antv/l7-component": "^2.6.18", + "@antv/l7-core": "^2.6.18", + "@antv/l7-layers": "^2.6.18", + "@antv/l7-maps": "^2.6.18", + "@antv/l7-renderer": "^2.6.18", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7", "inversify": "^5.0.1", "mapbox-gl": "^1.2.1", diff --git a/packages/scene/src/index.ts b/packages/scene/src/index.ts index 972c0433bb..d577f321d6 100644 --- a/packages/scene/src/index.ts +++ b/packages/scene/src/index.ts @@ -193,6 +193,10 @@ class Scene this.sceneService.render(); } + public setEnableRender(flag: boolean) { + this.layerService.setEnableRender(flag); + } + // asset method /** * 为 layer/point/text 支持 iconfont 模式支持 diff --git a/packages/source/package.json b/packages/source/package.json index 3006d3c8b6..f7d0874e8f 100644 --- a/packages/source/package.json +++ b/packages/source/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-source", - "version": "2.6.17", + "version": "2.6.18", "description": "", "main": "lib/index.js", "module": "es/index.js", @@ -26,8 +26,8 @@ "license": "ISC", "dependencies": { "@antv/async-hook": "^2.1.0", - "@antv/l7-core": "^2.6.17", - "@antv/l7-utils": "^2.6.17", + "@antv/l7-core": "^2.6.18", + "@antv/l7-utils": "^2.6.18", "@babel/runtime": "^7.7.7", "@mapbox/geojson-rewind": "^0.4.0", "@turf/helpers": "^6.1.4", diff --git a/packages/three/package.json b/packages/three/package.json index 966f9e35a3..00d0aab21e 100644 --- a/packages/three/package.json +++ b/packages/three/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-three", - "version": "2.6.17", + "version": "2.6.18", "description": "three for L7 ", "keywords": [ "3D", @@ -44,9 +44,9 @@ }, "homepage": "https://github.com/antvis/L7#readme", "dependencies": { - "@antv/l7-core": "^2.6.17", - "@antv/l7-layers": "^2.6.17", - "@antv/l7-scene": "^2.6.17", + "@antv/l7-core": "^2.6.18", + "@antv/l7-layers": "^2.6.18", + "@antv/l7-scene": "^2.6.18", "@babel/runtime": "^7.7.7", "inversify": "^5.0.1", "reflect-metadata": "^0.1.13", diff --git a/packages/utils/package.json b/packages/utils/package.json index 39b40700db..092cebe086 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@antv/l7-utils", - "version": "2.6.17", + "version": "2.6.18", "description": "", "main": "lib/index.js", "module": "es/index.js", diff --git a/stories/Components/components/Marker.tsx b/stories/Components/components/Marker.tsx index 0ae7a3a898..6c9fec6a55 100644 --- a/stories/Components/components/Marker.tsx +++ b/stories/Components/components/Marker.tsx @@ -18,7 +18,7 @@ export default class MarkerComponent extends React.Component { const scene = new Scene({ id: 'map', map: new GaodeMap({ - style: 'dark', + // style: 'dark', center: [120.184824, 30.248341], pitch: 0, zoom: 18, @@ -27,7 +27,7 @@ export default class MarkerComponent extends React.Component { const popup = new Popup({ offsets: [0, 20], - }).setHTML('

11111

'); + }).setHTML('

111111111111

'); const marker = new Marker({ offsets: [0, -20], @@ -41,7 +41,7 @@ export default class MarkerComponent extends React.Component { scene.addMarker(marker); const el = document.createElement('h1'); - el.innerHTML = 'Marker'; + el.innerHTML = '

111111111111

'; marker.setElement(el); const arr = [ diff --git a/stories/Components/components/Popup.tsx b/stories/Components/components/Popup.tsx index 0266cca851..aeb9b6d27c 100644 --- a/stories/Components/components/Popup.tsx +++ b/stories/Components/components/Popup.tsx @@ -50,7 +50,7 @@ export default class PopupComponent extends React.Component { lng: 120.19382669582967, lat: 30.258134, }) - .setText('hello'); + .setText('hello this is test text'); scene.addPopup(popup); } diff --git a/stories/Map/components/amap2demo_citybuilding.tsx b/stories/Map/components/amap2demo_citybuilding.tsx index dbac79a6a5..8690bf1b3c 100644 --- a/stories/Map/components/amap2demo_citybuilding.tsx +++ b/stories/Map/components/amap2demo_citybuilding.tsx @@ -1,5 +1,5 @@ import { CityBuildingLayer, Scene } from '@antv/l7'; -import { GaodeMap } from '@antv/l7-maps'; +import { GaodeMap, GaodeMapV2, Mapbox } from '@antv/l7-maps'; import * as React from 'react'; export default class Amap2demo_citybuilding extends React.Component { @@ -30,13 +30,20 @@ export default class Amap2demo_citybuilding extends React.Component { .size('floor', [0, 500]) .color('rgba(242,246,250,1.0)') .animate({ - enable: false, + enable: true, }) + .active(true) .style({ opacity: 0.7, baseColor: 'rgb(16,16,16)', windowColor: 'rgb(30,60,89)', brightColor: 'rgb(255,176,38)', + // sweep: { + // enable: true, + // sweepRadius: 4, + // sweepColor: 'rgb(0, 100, 100)', + // sweepSpeed: 0.5 + // } }); scene.addLayer(pointLayer); diff --git a/stories/Map/components/mapCenter.tsx b/stories/Map/components/mapCenter.tsx index e2930a4f92..4720872eab 100644 --- a/stories/Map/components/mapCenter.tsx +++ b/stories/Map/components/mapCenter.tsx @@ -66,7 +66,12 @@ export default class GaodeMapComponent extends React.Component { scene.on('loaded', () => { scene.addLayer(layer); }); - layer.on('click', () => console.log('point click')); + let c = 1; + layer.on('click', () => { + // @ts-ignore + c == 1 ? scene.setEnableRender(false) : scene.setEnableRender(true); + c = 0; + }); layer.on('contextmenu', () => console.log('contextmenu')); // layer.on('mousemove', (e) => { // console.log(e.feature);