Merge branch 'master' into District

This commit is contained in:
thinkinggis 2020-05-18 19:36:41 +08:00
commit 64ad549633
19 changed files with 749 additions and 489 deletions

View File

@ -0,0 +1,123 @@
---
title: API
---
地图行政区划组件,支持世界地图,中国地图省市县三级,支持中国地图省市县上钻下取。
## 使用
**using modules**
```javascript
import { WorldLayer } from '@antv/l7-district';
```
**CDN 版本引用**
```html
<head>
<! --引入最新版的L7-District -->
<script src="https://unpkg.com/@antv/l7-district"></script>
</head>
```
⚠️⚠️⚠️ District 相关配置和接口还在完善中,你可以适用体验,某些配置和接口可能会进行调整
## 简介
District 支持下面几种图
- WorldLayer 世界地图
- CountryLayer 国家地图,目前只支持中国
- ProvinceLayer 省级地图
- CityLayer 市级地图
- CountyLayer 县级地图
- DrillDownLayer 上钻下取地图
## 构造函数
参数:
- scene L7 scene 对象
- option 行政区划配置项
- zIndex 图层绘制顺序
- data `Array` 属性数据用于可视化渲染
- joinBy 数据关联,属性数据如何内部空间数据关联绑定 目前支持 NAME_CHN,adcode 字段连接
对照表 `Array [string, string]` 第一个值为空间数据字段,第二个为传入数据字段名
- depth 数据显示层级 0国家级1:省级2: 市级3线级
- label 标注配置项 支持常量,不支持数据映射
- enable `boolean` 是否显示标注
- color 标注字体颜色 常量
- field 标注字段 常量
- size 标注大小 常量
- stroke 文字描边颜色
- strokeWidth 文字描边宽度
- textAllowOverlap 是否允许文字压盖
- opacity 标注透明度
- fill 填充配置项 支持数据映射
- color 图层填充颜色,支持常量和数据映射
常量:统一设置成一样的颜色
数据映射
- field 填充映射字段
- values 映射值同color方法第二个参数数组回调函数
- style 同 polygonLayer的style方法
- activeColor 鼠标滑过高亮颜色
- bubble 气泡图
- enable `boolean` 是否显示气泡 default false
- color 气泡颜色 支持常量、数据映射
- size 气泡大小 支持常量、数据映射
- shape 气泡形状 支持常量、数据映射
- style 气泡图样式 同 PointLayer
- stroke 填充描边颜色
- strokeWidth 填充描边宽度
- autoFit 是否自动缩放到图层范围 `boolean`
- popup 信息窗口
- enable 是否开启 `boolean`
- triggerEvent 触发事件 例如 'mousemove' | 'click';
- Html popup html字符串支持回调函数 (properties: any) => string;
- chinaNationalStroke 中国国界线颜色
- chinaNationalWidth 中国国界线宽度
- coastlineStroke 海岸线颜色
- coastlineWidth 海岸线宽度 `WorldLayer` `CountryLayer`
- nationalWidth 国界线 `WorldLayer` `CountryLayer`
- nationalStroke 国界线 `WorldLayer` `CountryLayer`
- provinceStroke 省界颜色 `CountryLayer`
- provinceStrokeWidth 省界宽度 `CountryLayer`
- cityStroke 市级边界颜色 `CountryLayer`
- cityStrokeWidth 市级边界宽度 `CountryLayer`
- countyStroke 县级边界颜色 `CountryLayer`
- countyStrokeWidth 县级边界宽度 `CountryLayer`
### 数据
District 提供polygon数据需要跟用户的属性数据通过关系字段进行连接
- [国家名称对照表](https://gw.alipayobjects.com/os/bmw-prod/b6fcd072-72a7-4875-8e05-9652ffc977d9.csv)
- [省级行政名称_adcode_对照表.csv](https://gw.alipayobjects.com/os/bmw-prod/2aa6fb7b-3694-4df3-b601-6f6f9adac496.csv)
- [市级行政区划及编码](https://gw.alipayobjects.com/os/bmw-prod/d2aefd78-f5df-486f-9310-7449cc7f5569.csv)
- [县级行政区名称级编码](https://gw.alipayobjects.com/os/bmw-prod/fafd299e-0e1e-4fa2-a8ac-10a984c6e983.csv)
### 属性
行政区划组件每个图层有多个子图层组成,如标注层,国界线、省界线等等,
#### fillLayer
### 方法
#### updateData(data, joinBy)
更新显示数据,
参数:
- data 需要更新的数据
- joinBy 关联字段 可选,如果不设置保持和初始化一致。
#### show
显示图层
#### hide
图层隐藏不显示
#### destroy
移除并销毁图层

View File

@ -0,0 +1,117 @@
---
title: API
---
地图行政区划组件,支持世界地图,中国地图省市县三级,支持中国地图省市县上钻下取。
## 使用
**using modules**
```javascript
import { WorldLayer } from '@antv/l7-district';
```
**CDN 版本引用**
```html
<head>
<! --引入最新版的L7-District -->
<script src="https://unpkg.com/@antv/l7-district"></script>
</head>
```
⚠️⚠️⚠️ District 相关配置和接口还在完善中,你可以适用体验,某些配置和接口可能会进行调整
## 简介
District 支持下面几种图
- WorldLayer 世界地图
- CountryLayer 国家地图,目前只支持中国
- ProvinceLayer 省级地图
- CityLayer 市级地图
- CountyLayer 县级地图
- DrillDownLayer 上钻下取地图
## 构造函数
参数:
- scene L7 scene 对象
- option 行政区划配置项
- zIndex 图层绘制顺序
- data `Array` 属性数据用于可视化渲染
- joinBy 数据关联,属性数据如何内部空间数据关联绑定 目前支持 NAME_CHN,adcode 字段连接
对照表
- depth 数据显示层级 0国家级1:省级2: 市级3线级
- label 标注配置项 支持常量,不支持数据映射
- enable `boolean` 是否显示标注
- color 标注字体颜色 常量
- field 标注字段 常量
- size 标注大小 常量
- stroke 文字描边颜色
- strokeWidth 文字描边宽度
- textAllowOverlap 是否允许文字压盖
- opacity 标注透明度
- fill 填充配置项 支持数据映射
- color 图层填充颜色,支持常量和数据映射
常量:统一设置成一样的颜色
数据映射
- field 填充映射字段
- values 映射值同color方法第二个参数数组回调函数
- style 同 polygonLayer的style方法
- activeColor 鼠标滑过高亮颜色
- stroke 填充描边颜色
- strokeWidth 填充描边宽度
- autoFit 是否自动缩放到图层范围 `boolean`
- popup 信息窗口
- enable 是否开启 `boolean`
- triggerEvent 触发事件 例如 'mousemove' | 'click';
- Html popup html字符串支持回调函数 (properties: any) => string;
- chinaNationalStroke 中国国界线颜色
- chinaNationalWidth 中国国界线宽度
- coastlineStroke 海岸线颜色
- coastlineWidth 海岸线宽度 `WorldLayer` `CountryLayer`
- nationalWidth 国界线 `WorldLayer` `CountryLayer`
- nationalStroke 国界线 `WorldLayer` `CountryLayer`
- provinceStroke 省界颜色 `CountryLayer`
- provinceStrokeWidth 省界宽度 `CountryLayer`
- cityStroke 市级边界颜色 `CountryLayer`
- cityStrokeWidth 市级边界宽度 `CountryLayer`
- countyStroke 县级边界颜色 `CountryLayer`
- countyStrokeWidth 县级边界宽度 `CountryLayer`
### 数据
District 提供polygon数据需要跟用户的属性数据通过关系字段进行连接
- [国家名称对照表](https://gw.alipayobjects.com/os/bmw-prod/b6fcd072-72a7-4875-8e05-9652ffc977d9.csv)
- [省级行政名称_adcode_对照表.csv](https://gw.alipayobjects.com/os/bmw-prod/2aa6fb7b-3694-4df3-b601-6f6f9adac496.csv)
- [市级行政区划及编码](https://gw.alipayobjects.com/os/bmw-prod/d2aefd78-f5df-486f-9310-7449cc7f5569.csv)
- [县级行政区名称级编码](https://gw.alipayobjects.com/os/bmw-prod/fafd299e-0e1e-4fa2-a8ac-10a984c6e983.csv)
### 属性
行政区划组件每个图层有多个子图层组成,如标注层,国界线、省界线等等,
#### fillLayer
### 方法
#### updateData(data, joinBy)
更新显示数据,
参数:
- data 需要更新的数据
- joinBy 关联字段 可选,如果不设置保持和初始化一致。
#### show
显示图层
#### hide
图层隐藏不显示
#### destroy
移除并销毁图层

View File

@ -14,7 +14,7 @@
"message": "chore: publish" "message": "chore: publish"
} }
}, },
"version": "2.2.4", "version": "2.2.6",
"npmClient": "yarn", "npmClient": "yarn",
"useWorkspaces": true, "useWorkspaces": true,
"publishConfig": { "publishConfig": {

View File

@ -55,7 +55,7 @@
"copy-webpack-plugin": "^5.1.1", "copy-webpack-plugin": "^5.1.1",
"core-js": "3", "core-js": "3",
"coveralls": "^3.0.7", "coveralls": "^3.0.7",
"cross-env": "^6.0.3", "cross-env": "^7.0.2",
"css-loader": "^3.2.0", "css-loader": "^3.2.0",
"cz-conventional-changelog": "^3.0.2", "cz-conventional-changelog": "^3.0.2",
"dat.gui": "^0.7.2", "dat.gui": "^0.7.2",
@ -116,7 +116,7 @@
"tslint": "^5.11.0", "tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0", "tslint-config-prettier": "^1.15.0",
"tslint-plugin-prettier": "^1.3.0", "tslint-plugin-prettier": "^1.3.0",
"tslint-react": "^4.1.0", "tslint-react": "^5.0.0",
"typescript": "^3.7.0-beta", "typescript": "^3.7.0-beta",
"webpack": "^4.17.1", "webpack": "^4.17.1",
"webpack-cli": "^3.1.0", "webpack-cli": "^3.1.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-component", "name": "@antv/l7-component",
"version": "2.2.4", "version": "2.2.6",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -24,8 +24,8 @@
"author": "lzxue", "author": "lzxue",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@antv/l7-core": "^2.2.4", "@antv/l7-core": "^2.2.6",
"@antv/l7-utils": "^2.2.4", "@antv/l7-utils": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"eventemitter3": "^4.0.0", "eventemitter3": "^4.0.0",
"inversify": "^5.0.1", "inversify": "^5.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-core", "name": "@antv/l7-core",
"version": "2.2.4", "version": "2.2.6",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -23,7 +23,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@antv/async-hook": "^2.1.0", "@antv/async-hook": "^2.1.0",
"@antv/l7-utils": "^2.2.4", "@antv/l7-utils": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"@mapbox/tiny-sdf": "^1.1.1", "@mapbox/tiny-sdf": "^1.1.1",
"ajv": "^6.10.2", "ajv": "^6.10.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-district", "name": "@antv/l7-district",
"version": "2.2.4", "version": "2.2.6",
"description": "L7 district moudules", "description": "L7 district moudules",
"keywords": [], "keywords": [],
"author": "thinkinggis <lzx199065@gmail.com>", "author": "thinkinggis <lzx199065@gmail.com>",
@ -34,7 +34,7 @@
"test": "jest" "test": "jest"
}, },
"dependencies": { "dependencies": {
"@antv/l7": "^2.2.4", "@antv/l7": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"@turf/circle": "^6.0.1", "@turf/circle": "^6.0.1",
"@turf/distance": "^6.0.1", "@turf/distance": "^6.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-draw", "name": "@antv/l7-draw",
"version": "2.2.4", "version": "2.2.6",
"description": "L7 Draw moudules", "description": "L7 Draw moudules",
"keywords": [], "keywords": [],
"author": "thinkinggis <lzx199065@gmail.com>", "author": "thinkinggis <lzx199065@gmail.com>",
@ -35,7 +35,7 @@
"test": "jest" "test": "jest"
}, },
"dependencies": { "dependencies": {
"@antv/l7": "^2.2.4", "@antv/l7": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"@turf/circle": "^6.0.1", "@turf/circle": "^6.0.1",
"@turf/distance": "^6.0.1", "@turf/distance": "^6.0.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7", "name": "@antv/l7",
"version": "2.2.4", "version": "2.2.6",
"description": "A Large-scale WebGL-powered Geospatial Data Visualization", "description": "A Large-scale WebGL-powered Geospatial Data Visualization",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -24,12 +24,12 @@
"author": "antv", "author": "antv",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@antv/l7-component": "^2.2.4", "@antv/l7-component": "^2.2.6",
"@antv/l7-core": "^2.2.4", "@antv/l7-core": "^2.2.6",
"@antv/l7-layers": "^2.2.4", "@antv/l7-layers": "^2.2.6",
"@antv/l7-maps": "^2.2.4", "@antv/l7-maps": "^2.2.6",
"@antv/l7-scene": "^2.2.4", "@antv/l7-scene": "^2.2.6",
"@antv/l7-utils": "^2.2.4", "@antv/l7-utils": "^2.2.6",
"@babel/runtime": "^7.7.7" "@babel/runtime": "^7.7.7"
}, },
"gitHead": "532ade40831b35b04a677b351d092e54c00613d8", "gitHead": "532ade40831b35b04a677b351d092e54c00613d8",

View File

@ -1,2 +1,2 @@
const version = '2.2.4'; const version = '2.2.6';
export { version }; export { version };

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-layers", "name": "@antv/l7-layers",
"version": "2.2.4", "version": "2.2.6",
"description": "L7's collection of built-in layers", "description": "L7's collection of built-in layers",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -23,9 +23,9 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@antv/async-hook": "^2.1.0", "@antv/async-hook": "^2.1.0",
"@antv/l7-core": "^2.2.4", "@antv/l7-core": "^2.2.6",
"@antv/l7-source": "^2.2.4", "@antv/l7-source": "^2.2.6",
"@antv/l7-utils": "^2.2.4", "@antv/l7-utils": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"@mapbox/martini": "^0.2.0", "@mapbox/martini": "^0.2.0",
"@turf/meta": "^6.0.2", "@turf/meta": "^6.0.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-maps", "name": "@antv/l7-maps",
"version": "2.2.4", "version": "2.2.6",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -25,8 +25,8 @@
"author": "xiaoiver", "author": "xiaoiver",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@antv/l7-core": "^2.2.4", "@antv/l7-core": "^2.2.6",
"@antv/l7-utils": "^2.2.4", "@antv/l7-utils": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"@types/amap-js-api": "^1.4.6", "@types/amap-js-api": "^1.4.6",
"gl-matrix": "^3.1.0", "gl-matrix": "^3.1.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-react", "name": "@antv/l7-react",
"version": "2.2.4", "version": "2.2.6",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -24,8 +24,8 @@
"author": "lzxue", "author": "lzxue",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@antv/l7": "^2.2.4", "@antv/l7": "^2.2.6",
"@antv/l7-maps": "^2.2.4", "@antv/l7-maps": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"load-styles": "^2.0.0" "load-styles": "^2.0.0"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-renderer", "name": "@antv/l7-renderer",
"version": "2.2.4", "version": "2.2.6",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -25,7 +25,7 @@
"gl": "^4.4.0" "gl": "^4.4.0"
}, },
"dependencies": { "dependencies": {
"@antv/l7-core": "^2.2.4", "@antv/l7-core": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"inversify": "^5.0.1", "inversify": "^5.0.1",
"lodash": "^4.17.15", "lodash": "^4.17.15",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-scene", "name": "@antv/l7-scene",
"version": "2.2.4", "version": "2.2.6",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -22,11 +22,11 @@
"author": "xiaoiver", "author": "xiaoiver",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@antv/l7-component": "^2.2.4", "@antv/l7-component": "^2.2.6",
"@antv/l7-core": "^2.2.4", "@antv/l7-core": "^2.2.6",
"@antv/l7-maps": "^2.2.4", "@antv/l7-maps": "^2.2.6",
"@antv/l7-renderer": "^2.2.4", "@antv/l7-renderer": "^2.2.6",
"@antv/l7-utils": "^2.2.4", "@antv/l7-utils": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"inversify": "^5.0.1", "inversify": "^5.0.1",
"mapbox-gl": "^1.2.1", "mapbox-gl": "^1.2.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-source", "name": "@antv/l7-source",
"version": "2.2.4", "version": "2.2.6",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",
@ -25,8 +25,8 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@antv/async-hook": "^2.1.0", "@antv/async-hook": "^2.1.0",
"@antv/l7-core": "^2.2.4", "@antv/l7-core": "^2.2.6",
"@antv/l7-utils": "^2.2.4", "@antv/l7-utils": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"@mapbox/geojson-rewind": "^0.4.0", "@mapbox/geojson-rewind": "^0.4.0",
"@turf/helpers": "^6.1.4", "@turf/helpers": "^6.1.4",
@ -37,7 +37,7 @@
"eventemitter3": "^4.0.0", "eventemitter3": "^4.0.0",
"inversify": "^5.0.1", "inversify": "^5.0.1",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"supercluster": "^6.0.2" "supercluster": "^7.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/d3-dsv": "^1.0.36", "@types/d3-dsv": "^1.0.36",

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-three", "name": "@antv/l7-three",
"version": "2.2.4", "version": "2.2.6",
"description": "three for L7 ", "description": "three for L7 ",
"keywords": [ "keywords": [
"3D", "3D",
@ -43,7 +43,7 @@
}, },
"homepage": "https://github.com/antvis/L7#readme", "homepage": "https://github.com/antvis/L7#readme",
"dependencies": { "dependencies": {
"@antv/l7": "^2.2.4", "@antv/l7": "^2.2.6",
"@babel/runtime": "^7.7.7", "@babel/runtime": "^7.7.7",
"rollup": "^2.3.3", "rollup": "^2.3.3",
"rollup-plugin-less": "^1.1.2" "rollup-plugin-less": "^1.1.2"

View File

@ -1,6 +1,6 @@
{ {
"name": "@antv/l7-utils", "name": "@antv/l7-utils",
"version": "2.2.4", "version": "2.2.6",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"module": "es/index.js", "module": "es/index.js",

908
yarn.lock

File diff suppressed because it is too large Load Diff