-
Notifications
You must be signed in to change notification settings - Fork 660
Release site #2781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Release site #2781
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bbd606e
chore: 更新 版本号
lzxue 5784fc7
chore: 更新版本号
lzxue 9961ead
chore: 更新版本
lzxue b1a4bcc
chore: eslint 升级导致lint 错误较多
lzxue 4bf2377
chore: lint error
lzxue c96e5ad
Merge branch 'master' of https://github.com/antvis/L7 into release
lzxue 65789e2
chore: add change set
lzxue c919f51
fix: ts lint error
lzxue 3252e66
chore: 单测优化
lzxue 0fa38d4
fix: 类型转换
lzxue a5283eb
chore: 移除一样安全风险的ci
lzxue 2e4daba
fix: lint error
lzxue 4a383a5
Merge branch 'master' of https://github.com/antvis/L7 into chore_ci_snap
lzxue 43bbaa3
chore: 优化移动端layerpopoup
lzxue 4f690b8
chore: cadd changeset
lzxue f66fb58
chore: 更新变更集
lzxue 7932838
chore: changeset
lzxue 2aa8db1
chore: version (#2780)
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| import { LayerPopup, PolygonLayer } from '@antv/l7'; | ||
| import type { TestCase } from '../../types'; | ||
| import { CaseScene } from '../../utils'; | ||
|
|
||
| export const fillChina: TestCase = async (options) => { | ||
| const scene = await CaseScene({ | ||
| ...options, | ||
| mapConfig: { | ||
| center: [-96, 37.8], | ||
| zoom: 3, | ||
| }, | ||
| }); | ||
|
|
||
| const url1 = | ||
| 'https://mdn.alipayobjects.com/antforest/afts/file/A*vaL-R4SU18IAAAAAgCAAAAgAerd2AQ/original_2025-11-14.json'; | ||
| // const url2 = 'https://geojson.cn/api/china/1.6.2/china.json' | ||
| const result = await fetch(url1); | ||
| const data = await result.json(); | ||
| const fillData = data.features.filter((feature: any) => { | ||
| // 过滤掉线数据 | ||
| if (feature.properties.name === '境界线') { | ||
| return false; | ||
| } | ||
| return true; | ||
| }); | ||
| // 未定国界线数据 | ||
| const UndelimitedBoundary = data.features.filter((feature: any) => { | ||
| // 过滤掉线数据 | ||
| if (feature.properties.gb === '003') { | ||
| return true; | ||
| } | ||
| return false; | ||
| }); | ||
|
|
||
| const boundary = data.features.filter((feature: any) => { | ||
| // 过滤掉线数据 | ||
| if (feature.properties.gb !== '003') { | ||
| return true; | ||
| } | ||
| return false; | ||
| }); | ||
|
|
||
| const color = [ | ||
| '#a50026', | ||
| '#d73027', | ||
| '#f46d43', | ||
| '#fdae61', | ||
| '#fee090', | ||
| '#ffffbf', | ||
| '#e0f3f8', | ||
| '#abd9e9', | ||
| '#74add1', | ||
| '#4575b4', | ||
| '#313695', | ||
| ]; | ||
| // 行政区划填充色 | ||
| const fillLayer = new PolygonLayer({ | ||
| autoFit: true, | ||
| }) | ||
| .source({ | ||
| type: 'FeatureCollection', | ||
| features: fillData, | ||
| }) | ||
| .color('#d6dff6') | ||
| .shape('fill') | ||
| .active({ | ||
| color: '#5483ef', | ||
| }) | ||
| .style({ | ||
| opacity: 0.5, | ||
| }); | ||
| const boundaryLayer = new PolygonLayer({ | ||
| autoFit: true, | ||
| }) | ||
| .source({ | ||
| type: 'FeatureCollection', | ||
| features: boundary, | ||
| }) | ||
| .color('#5483ef') | ||
| .shape('line') | ||
| .size(0.5) | ||
| .style({ | ||
| opacity: 1, | ||
| }); | ||
|
|
||
| // 未定国际虚线表示 | ||
| const layer = new PolygonLayer({ | ||
| autoFit: true, | ||
| }) | ||
| .source({ | ||
| type: 'FeatureCollection', | ||
| features: UndelimitedBoundary, | ||
| }) | ||
| .color('red') | ||
| .shape('line') | ||
| .size(1) | ||
| .style({ | ||
| opacity: 1, | ||
| lineType: 'dash', | ||
| dashArray: [5, 5], | ||
| }); | ||
|
Comment on lines
+19
to
+101
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a few opportunities to improve the code style and clarity in this file:
|
||
|
|
||
| const layerPopup = new LayerPopup({ | ||
| trigger: 'click', | ||
| items: [ | ||
| { | ||
| layer: fillLayer, | ||
| fields: [ | ||
| { | ||
| field: 'name', | ||
| formatField: () => '名称', | ||
| }, | ||
| { | ||
| field: 'gb', | ||
| formatField: () => '编号', | ||
| formatValue: (val) => val, | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }); | ||
|
|
||
| scene.addLayer(fillLayer); | ||
|
|
||
| scene.addLayer(boundaryLayer); | ||
|
|
||
| scene.addLayer(layer); | ||
|
|
||
| scene.addPopup(layerPopup); | ||
|
|
||
| return scene; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
featureparameter is typed asany. To improve type safety and code clarity, it would be beneficial to define a specific interface for the GeoJSON feature.For example: