Skip to content

Commit

Permalink
Merge branch 'master' into detection/layer
Browse files Browse the repository at this point in the history
  • Loading branch information
lvisei committed Oct 23, 2023
2 parents a2da5cd + aa957da commit 9805959
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 46 deletions.
2 changes: 2 additions & 0 deletions examples/builder/.umirc.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { defineConfig } from 'umi';

export default defineConfig({
mfsu: false,
history: {
type: 'hash',
},
codeSplitting: {jsStrategy: 'granularChunks'},
routes: [
{ path: '/', component: 'Project' },
{ path: '/builder/:id', component: 'Builder' },
Expand Down
10 changes: 5 additions & 5 deletions packages/li-analysis-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/li-analysis-assets",
"version": "1.1.3",
"version": "1.2.0",
"description": "analysis assets for location insight",
"keywords": [
"analysis assets",
Expand Down Expand Up @@ -40,8 +40,8 @@
"dependencies": {
"@antv/g2": "^5.0.14",
"@antv/l7-draw": "^3.0.20",
"@antv/li-p2": "^1.1.2",
"@antv/li-sdk": "^1.0.6",
"@antv/li-p2": "^1.2.0",
"@antv/li-sdk": "^1.1.0",
"@antv/s2": "^1.47.1",
"@antv/s2-react": "^1.40.0",
"@emotion/css": "^11.10.6",
Expand All @@ -55,8 +55,8 @@
"@ant-design/icons": "^5.0.1",
"@antv/l7": "^2.17.2",
"@antv/larkmap": "^1.4.1",
"@antv/li-core-assets": "^1.0.9",
"@antv/li-editor": "^1.1.2",
"@antv/li-core-assets": "^1.0.10",
"@antv/li-editor": "^1.1.3",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"antd": "^5.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const TimeLineChart = (props: TimeLineChartProps) => {
const commConfig = {
type: 'interval',
data: data,
axis: { x: { labelAutoHide: true, title: false }, y: false },
axis: { x: { labelAutoHide: true, title: false, labelTransform: 'rotate(0)' }, y: false },
state: { inactive: { fill: 'rgb(105 116 131)' } },
animate: false,
interaction: {
Expand Down
8 changes: 4 additions & 4 deletions packages/li-core-assets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/li-core-assets",
"version": "1.0.9",
"version": "1.0.10",
"description": "core assets for location insight",
"keywords": [
"core assets",
Expand Down Expand Up @@ -38,8 +38,8 @@
"start": "dumi dev"
},
"dependencies": {
"@antv/li-p2": "^1.1.2",
"@antv/li-sdk": "^1.0.6",
"@antv/li-p2": "^1.2.0",
"@antv/li-sdk": "^1.1.0",
"@emotion/css": "^11.10.6",
"classnames": "^2.3.1",
"gcoord": "^0.3.2",
Expand All @@ -50,7 +50,7 @@
"@ant-design/icons": "^5.0.1",
"@antv/l7": "^2.17.2",
"@antv/larkmap": "^1.4.1",
"@antv/li-editor": "^1.1.2",
"@antv/li-editor": "^1.1.3",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"antd": "^5.5.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/li-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/li-editor",
"version": "1.1.2",
"version": "1.1.3",
"description": "editor for location insight",
"keywords": [
"editor",
Expand Down Expand Up @@ -36,8 +36,8 @@
},
"dependencies": {
"@antv/event-emitter": "^0.1.3",
"@antv/li-p2": "^1.1.2",
"@antv/li-sdk": "^1.0.6",
"@antv/li-p2": "^1.2.0",
"@antv/li-sdk": "^1.1.0",
"@formily/antd-v5": "^1.1.2",
"@formily/core": "^2.2.24",
"@formily/react": "^2.2.24",
Expand Down
20 changes: 20 additions & 0 deletions packages/li-editor/src/constants/base-map.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* https://lbs.amap.com/api/javascript-api/guide/abc/prepare
*/
// @ts-ignore
window._AMapSecurityConfig = {
securityJsCode: '8803c38931b6fddc9bbfeee69df8824d',
};

export const AMAP_KEY = 'f0230f884bbd54e2913c890cdf45aa7e';

// 可用域名白名单
// locationinsight.antv.antgroup.com
// li.antv.antgroup.com
// *.antgroup-inc.cn
// *.antgroup-inc.com
// *.antfin-inc.com
// *.alipay.net
// localhost
export const MAPBOX_TOKEN =
'pk.eyJ1IjoibGl1dmlnb25nenVvc2hpIiwiYSI6ImNsYWx2dHlxOTA5NGYzeW9icGd6aDE2NnoifQ.T3wEAOe8HReAyoeu6d6HJw';
1 change: 1 addition & 0 deletions packages/li-editor/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './application';
export * from './base-map';
export * from './registry-default';
export * from './widget';
4 changes: 2 additions & 2 deletions packages/li-editor/src/utils/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Application } from '@antv/li-sdk';
import { parseVersion } from '@antv/li-sdk';
import { Empty_App_Schema } from '../constants';
import type { EditorContextState } from '../types';
import { validateDatasets, validateLayers, validateMetadata, validWidgets } from './validator';
import { validateDatasets, validateLayers, validateMap, validateMetadata, validWidgets } from './validator';

export const creatEmptyApplication = (applicationName: string) => {
const config: Application = {
Expand All @@ -29,7 +29,7 @@ export const validateApplicationSchema = (appSchema: Application) => {
metadata: appSchema.metadata,
datasets: validateDatasets(appSchema.datasets),
spec: {
...appSchema.spec,
map: validateMap(appSchema.spec.map),
layers: validateLayers(appSchema.spec.layers),
widgets: validWidgets(appSchema.spec.widgets),
},
Expand Down
26 changes: 24 additions & 2 deletions packages/li-editor/src/utils/validator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import type { Application, DatasetSchema, LayerSchema, LocalDatasetSchema, WidgetSchema } from '@antv/li-sdk';
import type {
Application,
DatasetSchema,
LayerSchema,
LocalDatasetSchema,
MapSchema,
WidgetSchema,
} from '@antv/li-sdk';
import { getDatasetColumns, isLocalDatasetSchema } from '@antv/li-sdk';
import { isEmpty, isUndefined, omit } from 'lodash-es';
import { AtomWidgetEmptyContainer } from '../constants';
import { AMAP_KEY, AtomWidgetEmptyContainer, MAPBOX_TOKEN } from '../constants';

export const validateMetadata = (metadata: Application['metadata']) => {
const _metadata = { ...metadata };
Expand All @@ -17,6 +24,21 @@ export const validateMetadata = (metadata: Application['metadata']) => {
return _metadata;
};

export const validateMap = (mapSchema: MapSchema) => {
if (mapSchema.basemap !== 'Map' && isEmpty(mapSchema.config.token)) {
const _mapSchema: MapSchema = { ...mapSchema };
if (mapSchema.basemap === 'Mapbox') {
_mapSchema.config = { ..._mapSchema.config, token: MAPBOX_TOKEN };
} else {
_mapSchema.config = { ..._mapSchema.config, token: AMAP_KEY };
}

return _mapSchema;
}

return mapSchema;
};

export const validateDataset = (dataset: DatasetSchema) => {
if (isLocalDatasetSchema(dataset) && dataset.data) {
const _dataset: LocalDatasetSchema = { ...dataset, type: 'local' };
Expand Down
10 changes: 2 additions & 8 deletions packages/li-editor/src/widgets/MapSetting/MapSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ import Icon, { DownOutlined } from '@ant-design/icons';
import type { RadioChangeEvent } from 'antd';
import { Button, ConfigProvider, Dropdown, Form, InputNumber, message, Modal, Radio, Space, Tooltip } from 'antd';
import React, { useState } from 'react';
import { AMAP_KEY as AMAP__KEY, MAPBOX_TOKEN as MAPBOX__TOKEN } from '../../constants';
import { useEditorService, useEditorState } from '../../hooks';
import type { ImplementEditorWidgetProps } from '../../types';
import {
AMAP_KEY as AMAP__KEY,
BaseMapSvg,
CLS_PREFIX,
GaodeMapStyleConfig,
MapboxStyleConfig,
MAPBOX_TOKEN as MAPBOX__TOKEN,
} from './constant';
import { BaseMapSvg, CLS_PREFIX, GaodeMapStyleConfig, MapboxStyleConfig } from './constant';
import { MapCenterModal } from './MapCenterModal';
import './MapSetting.less';

Expand Down
18 changes: 0 additions & 18 deletions packages/li-editor/src/widgets/MapSetting/constant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,3 @@ export const MapboxStyleConfig = [
type: 'dark',
},
];

/**
* https://lbs.amap.com/api/javascript-api/guide/abc/prepare
*/
// @ts-ignore
window._AMapSecurityConfig = {
securityJsCode: '8803c38931b6fddc9bbfeee69df8824d',
};
// 可用域名白名单
// locationinsight.antv.antgroup.com
// li.antv.antgroup.com
// *.antgroup-inc.cn
// *.antgroup-inc.com
// *.antfin-inc.com
// *.alipay.net
export const AMAP_KEY = 'f0230f884bbd54e2913c890cdf45aa7e';
export const MAPBOX_TOKEN =
'pk.eyJ1IjoibGl1dmlnb25nenVvc2hpIiwiYSI6ImNsYWx2dHlxOTA5NGYzeW9icGd6aDE2NnoifQ.T3wEAOe8HReAyoeu6d6HJw';
4 changes: 2 additions & 2 deletions packages/li-p2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/li-p2",
"version": "1.1.2",
"version": "1.2.0",
"description": "property panel for location insight editor",
"keywords": [
"li",
Expand Down Expand Up @@ -46,9 +46,9 @@
"ahooks": "^3.7.0",
"classnames": "^2.3.1",
"colorbrewer": "^1.5.3",
"dayjs": "^1.11.7",
"lodash-es": "^4.17.21",
"react-dnd": "^16.0.1",
"dayjs": "^1.11.7",
"react-dnd-html5-backend": "^16.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/li-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/li-sdk",
"version": "1.0.6",
"version": "1.1.0",
"description": "sdk for location insight",
"keywords": [
"sdk",
Expand Down

0 comments on commit 9805959

Please sign in to comment.