From 88aa585c2a8339f6eb7518a92e5544733ba356e3 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Thu, 12 Mar 2020 16:06:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20mapbox=20=E5=85=89=E7=85=A7=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/changelog.zh.md | 18 ++++++++++++++++++ docs/api/layer/point_layer/pointlayer.en.md | 8 ++++++++ docs/api/layer/point_layer/pointlayer.zh.md | 6 +++--- docs/api/react/scene.zh.md | 4 ++-- docs/api/scene.zh.md | 8 ++++++++ examples/react/covid/demo/covid_bubble.tsx | 2 ++ examples/react/covid/demo/covid_fill.tsx | 5 +++-- packages/component/src/css/l7.css | 1 + packages/component/src/marker.ts | 1 + packages/core/src/shaders/light2.glsl | 2 +- packages/maps/src/mapbox/theme.ts | 6 +++--- packages/scene/src/index.ts | 4 ++++ stories/Layers/components/dash.tsx | 2 +- 13 files changed, 55 insertions(+), 12 deletions(-) diff --git a/docs/api/changelog.zh.md b/docs/api/changelog.zh.md index d785d78319..6a448dbd5e 100644 --- a/docs/api/changelog.zh.md +++ b/docs/api/changelog.zh.md @@ -2,6 +2,24 @@ title: 发布日志 order: 10 --- +## 2020.03.12 2.1 正式版 + +###✨ Features + +• 新增 l7-react版本 +• 可自定义样式的聚合图 MakerLayer +• 新增 quantile、quantize度量 +• 地图导出功能 + + ### 🍏 Improvements + +• IE 11 支持 +• 更新拾取机制,拾取更高效 +• 优化依赖包减少包体积 + +### 🐞 Bug Fixes +• setData 更新机制 +• color,size,shape更新重绘问题 ## 2020.01.06 2.0 正式版 diff --git a/docs/api/layer/point_layer/pointlayer.en.md b/docs/api/layer/point_layer/pointlayer.en.md index 17322441cc..5f5ea3dd5c 100644 --- a/docs/api/layer/point_layer/pointlayer.en.md +++ b/docs/api/layer/point_layer/pointlayer.en.md @@ -25,6 +25,14 @@ shape 支持 ``` +## source + +点数据类型,根据经纬点绘制图形,目前支持三种数据结构 + +- [GeoJSON]('../../../../source/geojson/#point') +- [CSV](../../../../source/csv/#parser) +- [JSON](../../../../source/json/#点数据) + **图片标注** 通过 `Scene.addImage()` 可以添加图片资源, diff --git a/docs/api/layer/point_layer/pointlayer.zh.md b/docs/api/layer/point_layer/pointlayer.zh.md index e8006f6ade..5f5ea3dd5c 100644 --- a/docs/api/layer/point_layer/pointlayer.zh.md +++ b/docs/api/layer/point_layer/pointlayer.zh.md @@ -29,9 +29,9 @@ shape 支持 点数据类型,根据经纬点绘制图形,目前支持三种数据结构 -- [GeoJOSN]('../source/geojson/#point') -- [CSV]() -- [JSON](../source/json/#点数据) +- [GeoJSON]('../../../../source/geojson/#point') +- [CSV](../../../../source/csv/#parser) +- [JSON](../../../../source/json/#点数据) **图片标注** diff --git a/docs/api/react/scene.zh.md b/docs/api/react/scene.zh.md index 00604ea168..18a7b10e39 100644 --- a/docs/api/react/scene.zh.md +++ b/docs/api/react/scene.zh.md @@ -17,8 +17,8 @@ import { MapboxScene, AmapScene } from '@antv/l7-react'; | ------------- | ---------- | ---------- | -------------------------------------- | | style | `Object` | `null` | scene css 样式 | | className | `string` | `null` | 样式名称 | -| map | `Object` | `Required` | map option [地图配置项]() | -| option | `Object` | `void` | scene option 配置项 [详情](#map-props) | +| map | ` map option` | `Required` | map option [地图配置项]() | +| option | `scene option` | `void` | scene option 配置项 [详情](#map-props) | | onSceneLoaded | `Function` | `void` | scene 加载回调函数 | ### 高德地图场景 diff --git a/docs/api/scene.zh.md b/docs/api/scene.zh.md index 10d6bd2c6c..1fcee60ae8 100644 --- a/docs/api/scene.zh.md +++ b/docs/api/scene.zh.md @@ -347,6 +347,14 @@ scene.removeLayer(layer); - `layer` {Layer} +### exportMap + +导出地图,目前仅支持导出可视化层,不支持底图导出 + +- 参数 type `png|jpg` 默认png + +scene.exportMap('png') + ## 事件 ### on diff --git a/examples/react/covid/demo/covid_bubble.tsx b/examples/react/covid/demo/covid_bubble.tsx index d3f9ad667a..f816b68c8a 100644 --- a/examples/react/covid/demo/covid_bubble.tsx +++ b/examples/react/covid/demo/covid_bubble.tsx @@ -264,6 +264,8 @@ const World = React.memo(function Map() { }} style={{ opacity: 1, + strokeOpacity: 0, + strokeWidth: 0, }} > diff --git a/examples/react/covid/demo/covid_fill.tsx b/examples/react/covid/demo/covid_fill.tsx index 8c566466e2..a506dfe508 100644 --- a/examples/react/covid/demo/covid_fill.tsx +++ b/examples/react/covid/demo/covid_fill.tsx @@ -90,6 +90,7 @@ const World = React.memo(function Map() { }} style={{ position: 'absolute', + background:'#fff', // 地图背景色 top: 0, left: 0, right: 0, @@ -118,7 +119,7 @@ const World = React.memo(function Map() { }, }} color={{ - field: 'confirmedCount', + field: 'confirmedCount', // 填充颜色 values: [ '#732200', '#CC3D00', @@ -144,7 +145,7 @@ const World = React.memo(function Map() { values: 0.6, }} color={{ - values: '#f00', + values: '#f00', // 描边颜色 }} shape={{ values: 'line', diff --git a/packages/component/src/css/l7.css b/packages/component/src/css/l7.css index 027afef0a1..96524f373d 100644 --- a/packages/component/src/css/l7.css +++ b/packages/component/src/css/l7.css @@ -2,6 +2,7 @@ width: 100%; height: 100%; overflow: hidden; + position: absolute; } .l7-marker { diff --git a/packages/component/src/marker.ts b/packages/component/src/marker.ts index 81bbafed83..e721a852af 100644 --- a/packages/component/src/marker.ts +++ b/packages/component/src/marker.ts @@ -93,6 +93,7 @@ export default class Marker extends EventEmitter { if (this.popup) { this.popup.setLnglat(this.lngLat); } + this.update(); return this; } diff --git a/packages/core/src/shaders/light2.glsl b/packages/core/src/shaders/light2.glsl index a22101d161..4bd2c5a743 100644 --- a/packages/core/src/shaders/light2.glsl +++ b/packages/core/src/shaders/light2.glsl @@ -11,7 +11,7 @@ float calc_lighting(vec4 pos) { // //cal light weight vec3 viewDir = normalize(u_CameraPosition - worldPos); - vec3 lightDir = normalize(reverse_offset_normal(vec3(1, 10.5, 12))); + vec3 lightDir = normalize(vec3(1, -10.5, 12)); vec3 halfDir = normalize(viewDir+lightDir); // //lambert diff --git a/packages/maps/src/mapbox/theme.ts b/packages/maps/src/mapbox/theme.ts index 270d59507c..3b29aa499f 100644 --- a/packages/maps/src/mapbox/theme.ts +++ b/packages/maps/src/mapbox/theme.ts @@ -6,9 +6,9 @@ export const MapTheme: { normal: 'mapbox://styles/mapbox/streets-v11', blank: { version: 8, - sprite: 'https://lzxue.github.io/font-glyphs/sprite/sprite', - glyphs: - 'https://gw.alipayobjects.com/os/antvdemo/assets/mapbox/glyphs/{fontstack}/{range}.pbf', + // sprite: 'https://lzxue.github.io/font-glyphs/sprite/sprite', + // glyphs: + // 'https://gw.alipayobjects.com/os/antvdemo/assets/mapbox/glyphs/{fontstack}/{range}.pbf', sources: {}, layers: [ { diff --git a/packages/scene/src/index.ts b/packages/scene/src/index.ts index 7215b5747b..f17bc5989b 100644 --- a/packages/scene/src/index.ts +++ b/packages/scene/src/index.ts @@ -107,6 +107,10 @@ class Scene return this.sceneService.exportPng(type); } + public exportMap(type?: 'png' | 'jpg'): string { + return this.sceneService.exportPng(type); + } + public get map() { return this.mapService.map; } diff --git a/stories/Layers/components/dash.tsx b/stories/Layers/components/dash.tsx index 59eef3025e..2e8bfeb558 100644 --- a/stories/Layers/components/dash.tsx +++ b/stories/Layers/components/dash.tsx @@ -1,5 +1,5 @@ import { LineLayer, Scene } from '@antv/l7'; -import { Mapbox } from '@antv/l7-maps'; +import { Mapbox, GaodeMap } from '@antv/l7-maps'; import * as React from 'react'; export default class DashLineDemo extends React.Component {