Merge pull request #391 from antvis/fix_storybook

Fix storybook
This commit is contained in:
@thinkinggis 2020-05-28 17:17:55 +08:00 committed by GitHub
commit 61c6e3e68d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 44 additions and 143 deletions

View File

@ -36,6 +36,9 @@ module.exports = ({ config }) => {
loader: 'svg-inline-loader'
}
);
config.resolve.alias = {
'@antv/l7-district': path.resolve(__dirname, '../packages/boundry/src'),
}
config.resolve.extensions.push('.ts', '.tsx', 'css', '.js', '.glsl');

View File

@ -21,6 +21,6 @@ exports.onCreateWebpackConfig = ({ getConfig }) => {
'@antv/l7-utils': path.resolve(__dirname, 'packages/utils/src'),
'@antv/l7-react': path.resolve(__dirname, 'packages/react/src'),
'@antv/l7-draw': path.resolve(__dirname, 'packages/draw/src'),
'@antv/l7-district': path.resolve(__dirname, 'packages/district/src')
'@antv/l7-district': path.resolve(__dirname, 'packages/boundry/src')
};
};

View File

@ -28,7 +28,7 @@ module.exports = {
moduleFileExtensions: [ 'ts', 'tsx', 'js' ],
modulePathIgnorePatterns: [ 'dist' ],
moduleNameMapper: {
'@antv/l7-(.+)$': '<rootDir>packages/$1/src',
'@antv/l7-(.+)$': '<rootDir>packages/$1/src'
},
notify: true,
notifyMode: 'always',

View File

@ -1,8 +1,8 @@
// tslint:disable-next-line:no-submodule-imports
import merge from 'lodash/merge';
let DataLevel = 1;
const dataLevel1: { [key: string]: any } = {
let DataLevel = 2;
const dataLevel2: { [key: string]: any } = {
world: {
fill: {
type: 'pbf',
@ -122,7 +122,7 @@ const dataLevel1: { [key: string]: any } = {
110000: '',
},
};
const dataLevel2: { [key: string]: any } = {
const dataLevel1: { [key: string]: any } = {
world: {
fill: {
type: 'pbf',
@ -181,12 +181,12 @@ const dataLevel2: { [key: string]: any } = {
line: {
type: 'pbf',
url:
'//gw.alipayobjects.com/os/bmw-prod/8bfbfe7e-bd0e-4bbe-84d8-629f4dc7abc4.bin',
'//gw.alipayobjects.com/os/bmw-prod/561e2cfe-9460-42d1-a2f8-3fd2e1274c52.bin',
},
cityLine: {
type: 'pbf',
url:
'//gw.alipayobjects.com/os/bmw-prod/8bfbfe7e-bd0e-4bbe-84d8-629f4dc7abc4.bin',
'//gw.alipayobjects.com/os/bmw-prod/561e2cfe-9460-42d1-a2f8-3fd2e1274c52.bin',
},
provinceLine: {
type: 'pbf',
@ -244,7 +244,7 @@ const dataLevel2: { [key: string]: any } = {
};
const DataLevelMap: { [key: string]: any } = {
1: dataLevel1,
1: dataLevel1, // 高精度数据
2: dataLevel2,
};

View File

@ -312,7 +312,9 @@ export default class BaseLayer extends EventEmitter {
});
popupLayer.on(popup.closeTriggerEvent as string, (e) => {
this.popup.remove();
if (this.popup) {
this.popup.remove();
}
});
}

View File

@ -16,10 +16,10 @@ export default class CountryLayer extends BaseLayer {
this.addProvinceLine(countryConfig.provinceLine);
if (depth === 2 * 1) {
this.addCityBorder(countryConfig.cityLine);
this.addCityBorder(countryConfig.fill);
}
if (depth === 3 * 1) {
this.addCountyBorder(countryConfig.countryLine);
this.addCountyBorder(countryConfig.fill);
}
}
protected async addProvinceFill() {

View File

@ -1,128 +0,0 @@
// tslint:disable-next-line:no-submodule-imports
import merge from 'lodash/merge';
let DataConfig: { [key: string]: any } = {
world: {
fill: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/d666a08d-fce1-48e2-913a-87d81772bcc9.bin',
},
line: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/62f61f5f-cca7-4137-845d-13c8f9969664.bin',
},
label: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/90c51eb3-04d7-402f-bd05-95e4bd27dd62.bin',
parser: {
type: 'geojson',
},
},
nationalBoundaries: {
type: 'json',
url:
'https://gw.alipayobjects.com/os/bmw-prod/ee493a41-0558-4c0e-bee6-520276c4f1a8.json',
},
},
country: {
CHN: {
1: {
fill: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/25228941-b2ac-4591-b07d-8261ac08d06f.bin',
},
line: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/70ec087e-c48a-4b76-8825-6452f17bae7a.bin',
},
provinceLine: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/0024caaf-86b2-4e75-a3d1-6d2146490b67.bin',
},
label: {
type: 'json',
url:
'https://gw.alipayobjects.com/os/bmw-prod/36832a45-68f8-4b51-b006-9dec71f92a23.json',
},
},
2: {
fill: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/522c6496-c711-4581-88db-c3741cd39abd.bin',
},
line: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/f6a4e2b1-359b-43a6-921c-39d2088d1dab.bin',
},
cityLine: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/f6a4e2b1-359b-43a6-921c-39d2088d1dab.bin',
},
provinceLine: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/0024caaf-86b2-4e75-a3d1-6d2146490b67.bin',
},
},
3: {
fill: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/516b2703-d692-44e6-80dd-b3f5df0186e7.bin',
},
line: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/bc97875a-90f2-42c0-a62c-43d2efd7460d.bin',
},
countryLine: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/bc97875a-90f2-42c0-a62c-43d2efd7460d.bin',
},
cityLine: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/8bfbfe7e-bd0e-4bbe-84d8-629f4dc7abc4.bin',
},
provinceLine: {
type: 'pbf',
url:
'https://gw.alipayobjects.com/os/bmw-prod/778ad7ba-5a3f-4ed6-a94a-b8ab8acae9d6.bin',
},
},
nationalBoundaries: {
type: 'json',
url:
'https://gw.alipayobjects.com/os/bmw-prod/ee493a41-0558-4c0e-bee6-520276c4f1a8.json',
},
nationalBoundaries2: {
type: 'json',
url:
'https://gw.alipayobjects.com/os/bmw-prod/f2189cc4-662b-4358-8573-36f0f918b7ca.json',
},
island: {
type: 'json',
url:
'https://gw.alipayobjects.com/os/bmw-prod/fe49b393-1147-4769-94ed-70471f4ff15d.json',
},
},
},
province: {
110000: '',
},
};
function setDataConfig(config: any) {
DataConfig = merge(DataConfig, config);
}
export { setDataConfig, DataConfig };

View File

@ -209,7 +209,7 @@ export default class Country extends React.Component {
},
popup: {
enable: true,
Html: (props) => {
Html: (props: any) => {
return `<span>${props.NAME_CHN}:</span><span>${props.value}</span>`;
},
},

View File

@ -45,7 +45,7 @@ export default class Country extends React.Component {
},
popup: {
enable: true,
Html: (props) => {
Html: (props: any) => {
return `<span>${props.NAME_CHN}</span>`;
},
},

View File

@ -46,7 +46,7 @@ export default class Country extends React.Component {
},
popup: {
enable: true,
Html: (props) => {
Html: (props: any) => {
return `<span>${props.NAME_CHN}</span>`;
},
},

View File

@ -48,7 +48,7 @@ export default class Country extends React.Component {
},
popup: {
enable: false,
Html: (props) => {
Html: (props: any) => {
return `<span>${props.NAME_CHN}</span>`;
},
},

View File

@ -21,6 +21,29 @@ export default class Circle extends React.Component {
}),
});
this.scene = scene;
const linneData = {
type: 'FeatureCollection',
features: [
{
type: 'Feature',
properties: {},
geometry: {
type: 'LineString',
coordinates: [
[79.8046875, 52.482780222078226],
[110.74218749999999, 36.87962060502676],
[111.4453125, 19.973348786110602],
[112.8515625, 9.795677582829743],
[95.2734375, -6.664607562172573],
[82.265625, -14.264383087562637],
[74.53125, -25.799891182088306],
[68.203125, -30.145127183376115],
[41.484375, -16.63619187839765],
],
},
},
],
};
const line = scene.on('loaded', () => {
const drawLine = new DrawLine(scene);
drawLine.enable();

View File

@ -17,6 +17,7 @@
"rootDir": "./",
"baseUrl": "./",
"paths": {
"@antv/l7-district": ["packages/boundry/src"],
"@antv/l7-*": ["packages/*/src"],
"@antv/l7": ["packages/l7/src"],
"*": ["node_modules", "packages", "typings/*"]