Skip to content

Commit

Permalink
Merge branch 'master' into chore/l7plot-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei authored Aug 7, 2023
2 parents 5185782 + 434b87f commit 2a11761
Show file tree
Hide file tree
Showing 208 changed files with 2,841 additions and 3,955 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
- run: yarn
- run: yarn lint

Expand All @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16
- run: yarn
- run: yarn site:build
- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .umirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default defineConfig({
lodash: '_',
fetch: 'window.fetch',
},
links: ['https://gw.alipayobjects.com/os/lib/antd/4.16.13/dist/antd.css'],
styles: ['https://gw.alipayobjects.com/os/lib/antd/4.16.13/dist/antd.css'],
scripts: [
'https://gw.alipayobjects.com/os/lib/whatwg-fetch/3.6.2/dist/fetch.umd.js',
'https://gw.alipayobjects.com/os/lib/react/17.0.2/umd/react.profiling.min.js',
Expand Down
1 change: 1 addition & 0 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module.exports = [
'cloneDeep',
'isString',
'isNumber',
'isPlainObject',
'merge',
],
},
Expand Down
2 changes: 2 additions & 0 deletions dev-demos/bugs/line/arc_linear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### 弧线渐变
<code src="./demo/arc_linear.tsx"></code>
58 changes: 58 additions & 0 deletions dev-demos/bugs/line/demo/arc_linear.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// @ts-ignore
import { LineLayer, Scene } from '@antv/l7';
// @ts-ignore
import {GaodeMap } from '@antv/l7-maps';
import React, { useEffect } from 'react';

export default () => {
useEffect( () => {
const scene = new Scene({
id: "map",
map: new GaodeMap({
pitch: 57.999999999999964,
style: "dark",
center: [101.94365594271085, 40.46139674355291],
zoom: 2.7484264183323437,
rotation: -21.600099999999884
})
});

scene.on("loaded", () => {
fetch("https://gw.alipayobjects.com/os/rmsportal/UEXQMifxtkQlYfChpPwT.txt")
.then((res) => res.text())
.then((data) => {
const layer = new LineLayer({})
.source(data, {
parser: {
type: "csv",
x: "lng1",
y: "lat1",
x1: "lng2",
y1: "lat2"
}
})
.size(1)
.shape("arc")
.color("#FF7C6A")
.style({
opacity: 0.8,
sourceColor: "#f00",
targetColor: "#6F19FF"
});
scene.addLayer(layer);
});
});


}, []);
return (
<div
id="map"
style={{
height: '500px',
position: 'relative',
}}
/>
);
};

6 changes: 5 additions & 1 deletion dev-demos/bugs/point/demos/circle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export default () => {
})
.color('red')
.shape('circle')
.size('unit_price',[2,30]);
.size('unit_price',[2,30])
.style({
opacity: 0.1,
})
;
scene.addLayer(imageLayer);
});
});
Expand Down
6 changes: 3 additions & 3 deletions dev-demos/bugs/point/demos/cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const scene = new Scene({
map: new GaodeMap({
center: [110, 36],
style: "light",
zoom: 3
zoom: 5
})
});
scene.on("loaded", () => {
Expand Down Expand Up @@ -40,10 +40,10 @@ const scene = new Scene({
.color("black")
.style({
textAnchor: "center", // 文本相对锚点的位置 center|left|right|top|bottom|top-left
// textOffset: [0, 0], // 文本相对锚点的偏移量 [水平, 垂直]
textOffset: [0, 0], // 文本相对锚点的偏移量 [水平, 垂直]
spacing: 2, // 字符间距
padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近
stroke: "#ffffff", // 描边颜色
stroke: "#f00", // 描边颜色
strokeWidth: 0.3, // 描边宽度
strokeOpacity: 1.0,
// textAllowOverlap: true,
Expand Down
3 changes: 2 additions & 1 deletion dev-demos/bugs/point/demos/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export default () => {
return item;
});
const imageLayer = new PointLayer({
autoFit:false
autoFit:false,
// layerType: 'fillImage',
})
.source(newData.slice(0,4), {
parser: {
Expand Down
79 changes: 34 additions & 45 deletions dev-demos/bugs/point/demos/pointstroke.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const pointData = {
},
geometry: {
type: 'Point',
coordinates: [121.9375, 27.059125784374068],
coordinates: [125.9375, 24.059125784374068],
},
},
{
Expand All @@ -63,7 +63,7 @@ const pointData = {
},
geometry: {
type: 'Point',
coordinates: [107.22656249999999, 37.020098201368114],
coordinates: [110.22656249999999, 39.020098201368114],
},
},
],
Expand All @@ -81,56 +81,45 @@ export default () => {
scene.on('loaded', () => {
const pointLayer = new PointLayer({})
.source(pointData)
.scale('size', {
type: 'identity',
})
.shape('name', 'text')
.size('size')

.shape('circle')
.size(20)
.active({
color: 'red',
})
.select(true)
.color('color')
.color('#111')
.style({
strokeWidth: 1,
stroke: [
'name',
(name) => {
switch (name) {
case 'A':
return '#fc8d59';

case 'B':
return '#91cf60';
default:
return '#ffffbf';
}
},
], // 描边颜色
opacity: {
field: 'name',
value: [0.5,0.5,0.8,1]
},
// opacity:1,
strokeWidth: 3,
// stroke: '#f00',
stroke: {
field:'name',
value: ['red','yellow','blue','green']
}
});

const pointlable = new PointLayer({})
.shape('name', 'text')
.source(pointData)
.size(24)
.color('#f00')
.style({
opacity: 1,
fontFamily: 'fangsong',
stroke: '#fff',
strokeWidth: 1,
padding: [0, 0],
textOffset: [0, 20],
textAllowOverlap: false,
});
// const pointlable = new PointLayer({})
// .shape('name', 'text')
// .source(pointData)
// .size(24)
// .color('#f00')
// .style({
// opacity: 1,
// fontFamily: 'fangsong',
// stroke: '#fff',
// strokeWidth: 1,
// padding: [0, 0],

// textAllowOverlap: false,
// });

// scene.addLayer(pointLayer);
scene.addLayer(pointlable);
const drawer = new DrawLine(scene, {
distanceOptions: {},
// liveUpdate: true,
});
drawer.enable();
scene.addLayer(pointLayer);
// scene.addLayer(pointlable);

});
}, []);
return (
Expand Down
6 changes: 4 additions & 2 deletions dev-demos/bugs/scene/demos/exportimg.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Map, Scene, ExportImage, PointLayer } from "@antv/l7";
import { Map, Mapbox,Scene, ExportImage, PointLayer } from "@antv/l7";
import React, { useState } from "react";
// tslint:disable-next-line:no-duplicate-imports
import { FunctionComponent, useEffect } from "react";
Expand Down Expand Up @@ -30,7 +30,7 @@ const Demo: FunctionComponent = () => {
.then((res) => res.json())
.then((data) => {
const pointLayer = new PointLayer({
autoFit: true
autoFit: false
})
.source(data)
.shape("circle")
Expand All @@ -46,6 +46,8 @@ const Demo: FunctionComponent = () => {
newScene.addLayer(pointLayer);
setScene(newScene);
newScene.setPitch(30)
// newScene.panBy(100, 100)
// console.log(newScene.panBy(100, 100));


});
Expand Down
Loading

0 comments on commit 2a11761

Please sign in to comment.