Merge branch 'master' of github.com:antvis/L7

This commit is contained in:
thinkinggis 2021-02-28 11:57:09 +08:00
commit 2ea622c512
22 changed files with 51116 additions and 55 deletions

View File

@ -57,7 +57,7 @@ import { MapboxScene } from '@antv/l7-react';
| option | Type | Default | Description |
| -------- | ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------- |
| style | `string` | `light` | 地图样式 `dark|light|normal|blank` L7 默认提供四种样式,同时也支持自定义样式 |
| style | `string` | `light` | 地图样式 `dark | light | normal | blank` L7 默认提供四种样式,同时也支持自定义样式 |
| token | `string` | `Required` | 地图密钥,需要平台申请 |
| plugin | `string[]` | `null` | 高德地图[API 插件](https://lbs.amap.com/api/javascript-api/guide/abc/plugins) `['AMap.ToolBar','AMap.Driving']` |
| center | `number` | null | 地图中心点 |
@ -76,12 +76,12 @@ Mapbox Map 地图配置项 [配置项](https://docs.mapbox.com/mapbox-gl-js/api/
### scene option
| option | Type | Default | Description |
| --------------------- | --------- | ------------ | --------------------------------------------------- |
| logoPosition | string | `bottomleft` | logo 位置 `bottomright|topright|bottomleft|topleft` |
| logoVisible | `boolean` | `true` | 是否显示 logo |
| antialias | `boolean` | `true` | 是否开启抗锯齿 |
| preserveDrawingBuffer | `boolean` | `false` | 是否保留缓冲区数据 |
| option | Type | Default | Description |
| --------------------- | --------- | ------------ | --------------------------------------------------------- |
| logoPosition | string | `bottomleft` | logo 位置 `bottomright | topright | bottomleft | topleft` |
| logoVisible | `boolean` | `true` | 是否显示 logo |
| antialias | `boolean` | `true` | 是否开启抗锯齿 |
| preserveDrawingBuffer | `boolean` | `false` | 是否保留缓冲区数据 |
### 获取 scene 对象

View File

@ -57,7 +57,7 @@ import { MapboxScene } from '@antv/l7-react';
| option | Type | Default | Description |
| -------- | ---------- | ------------------ | --------------------------------------------------------------------------------------------------------------- |
| style | `string` | `light` | 地图样式 `dark|light|normal|blank` L7 默认提供四种样式,同时也支持自定义样式 |
| style | `string` | `light` | 地图样式 `dark | light | normal | blank` L7 默认提供四种样式,同时也支持自定义样式 |
| token | `string` | `Required` | 地图密钥,需要平台申请 |
| plugin | `string[]` | `null` | 高德地图[API 插件](https://lbs.amap.com/api/javascript-api/guide/abc/plugins) `['AMap.ToolBar','AMap.Driving']` |
| center | `number` | null | 地图中心点 |
@ -76,12 +76,12 @@ Mapbox Map 地图配置项 [配置项](https://docs.mapbox.com/mapbox-gl-js/api/
### scene option
| option | Type | Default | Description |
| --------------------- | --------- | ------------ | --------------------------------------------------- |
| logoPosition | string | `bottomleft` | logo 位置 `bottomright|topright|bottomleft|topleft` |
| logoVisible | `boolean` | `true` | 是否显示 logo |
| antialias | `boolean` | `true` | 是否开启抗锯齿 |
| preserveDrawingBuffer | `boolean` | `false` | 是否保留缓冲区数据 |
| option | Type | Default | Description |
| --------------------- | --------- | ------------ | --------------------------------------------------------- |
| logoPosition | string | `bottomleft` | logo 位置 `bottomright | topright | bottomleft | topleft` |
| logoVisible | `boolean` | `true` | 是否显示 logo |
| antialias | `boolean` | `true` | 是否开启抗锯齿 |
| preserveDrawingBuffer | `boolean` | `false` | 是否保留缓冲区数据 |
### 获取 scene 对象

View File

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

View File

@ -39,7 +39,7 @@
"@types/node": "13.11.1",
"@types/storybook__react": "^4.0.2",
"@types/supercluster": "^5.0.1",
"antd": "^4.2.4",
"antd": "^4.12.3",
"awesome-typescript-loader": "^5.2.1",
"babel-eslint": "8.2.5",
"babel-jest": "^24.9.0",

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-core",
"version": "2.3.7",
"version": "2.3.8",
"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.3.7",
"@antv/l7-utils": "2.3.8",
"@babel/runtime": "^7.7.7",
"@mapbox/tiny-sdf": "^1.1.1",
"ajv": "^6.10.2",

View File

@ -150,6 +150,8 @@ export interface IMapConfig<RawMap = {}> {
offsetCoordinate?: boolean;
offsetZoom?: number;
[key: string]: any;
}

View File

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

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-map",
"version": "2.3.7",
"version": "2.3.8",
"description": "l7 map",
"keywords": [],
"author": "thinkinggis <lzx199065@gmail.com>",
@ -37,7 +37,7 @@
},
"homepage": "https://github.com/antvis/L7#readme",
"dependencies": {
"@antv/l7-utils": "2.3.7",
"@antv/l7-utils": "2.3.8",
"@babel/runtime": "^7.7.7",
"@mapbox/point-geometry": "^0.1.0",
"@mapbox/unitbezier": "^0.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-maps",
"version": "2.3.7",
"version": "2.3.8",
"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.3.7",
"@antv/l7-map": "2.3.7",
"@antv/l7-utils": "2.3.7",
"@antv/l7-core": "2.3.8",
"@antv/l7-map": "2.3.8",
"@antv/l7-utils": "2.3.8",
"@babel/runtime": "^7.7.7",
"@types/amap-js-api": "^1.4.6",
"@types/mapbox-gl": "^1.11.2",

View File

@ -425,9 +425,10 @@ export default class AMapService
center: [lng, lat],
offsetOrigin: [position.x, position.y],
});
const { offsetZoom = LNGLAT_OFFSET_ZOOM_THRESHOLD } = this.config;
// set coordinate system
if (this.viewport.getZoom() > LNGLAT_OFFSET_ZOOM_THRESHOLD) {
if (this.viewport.getZoom() > offsetZoom) {
this.coordinateSystemService.setCoordinateSystem(
CoordinateSystem.P20_OFFSET,
);

View File

@ -393,8 +393,10 @@ export default class MapboxService
cameraHeight: 0,
});
const { offsetZoom = LNGLAT_OFFSET_ZOOM_THRESHOLD } = this.config;
// set coordinate system
if (this.viewport.getZoom() > LNGLAT_OFFSET_ZOOM_THRESHOLD) {
if (this.viewport.getZoom() > offsetZoom) {
this.coordinateSystemService.setCoordinateSystem(
CoordinateSystem.LNGLAT_OFFSET,
);

View File

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

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-source",
"version": "2.3.7",
"version": "2.3.8",
"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.3.7",
"@antv/l7-utils": "2.3.7",
"@antv/l7-core": "2.3.8",
"@antv/l7-utils": "2.3.8",
"@babel/runtime": "^7.7.7",
"@mapbox/geojson-rewind": "^0.4.0",
"@turf/helpers": "^6.1.4",

View File

@ -1,6 +1,6 @@
{
"name": "@antv/l7-three",
"version": "2.3.7",
"version": "2.3.8",
"description": "three for L7 ",
"keywords": [
"3D",
@ -44,7 +44,7 @@
},
"homepage": "https://github.com/antvis/L7#readme",
"dependencies": {
"@antv/l7": "2.3.7",
"@antv/l7": "2.3.8",
"@babel/runtime": "^7.7.7",
"inversify": "^5.0.1",
"rollup": "^2.3.3",

View File

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

View File

@ -16,6 +16,7 @@ import HexagonLayerDemo from './components/hexagon';
import HighLight from './components/highlight';
import LineLayer from './components/Line';
import LineAnimate from './components/lineAnimate';
import OffsetTest from './components/offsetTest';
import PointDemo from './components/Point';
import Point3D from './components/Point3D';
import PointImage from './components/PointImage';
@ -51,6 +52,6 @@ storiesOf('图层', module)
.add('网格热力图2', () => <GridTest />)
.add('栅格', () => <RasterLayerDemo />)
.add('图片', () => <ImageLayerDemo />)
.add('网格测试', () => <GridTest />)
.add('网格测试', () => <OffsetTest />)
.add('图层高亮', () => <HighLight />)
.add('世界地图', () => <WorldDemo />);

View File

@ -0,0 +1,80 @@
// @ts-ignore
import {
Layers,
LineLayer,
PointLayer,
PolygonLayer,
Scale,
Scene,
Zoom,
} from '@antv/l7';
import { GaodeMap } from '@antv/l7-maps';
import * as React from 'react';
import data from '../data/hexagon';
export default class World extends React.Component {
private scene: Scene;
public componentWillUnmount() {
this.scene.destroy();
}
public async componentDidMount() {
const scene = new Scene({
id: 'map',
logoVisible: false,
map: new GaodeMap({
offsetZoom: 5,
style: 'normal',
center: [110.19382669582967, 30.258134],
pitch: 0,
zoom: 5,
}),
});
this.scene = scene;
const layer = new PolygonLayer({
name: '01',
autoFit: true,
});
const layer2 = new PolygonLayer({
name: '01',
autoFit: true,
});
layer
.source(data.geo_data)
.color('#CF1D49')
.shape('line')
.size(1)
.select(true)
.style({
opacity: 0.8,
});
layer2
.source(data.geo_data)
.color('#CF1')
.shape('fill')
.select(true)
.style({
opacity: 0.3,
});
scene.addLayer(layer);
scene.addLayer(layer2);
}
public render() {
return (
<div
id="map"
style={{
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
}}
/>
);
}
}

22378
stories/Layers/data/hexagon.ts Normal file

File diff suppressed because it is too large Load Diff

28597
yarn.lock Normal file

File diff suppressed because it is too large Load Diff