Skip to content
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

UIMarker Can only be added to the map #2162

Merged
merged 10 commits into from
Jan 5, 2024
Merged

UIMarker Can only be added to the map #2162

merged 10 commits into from
Jan 5, 2024

Conversation

deyihu
Copy link
Collaborator

@deyihu deyihu commented Dec 21, 2023

fix #2161

src/layer/OverlayLayer.js Outdated Show resolved Hide resolved
src/layer/OverlayLayer.js Outdated Show resolved Hide resolved
src/layer/OverlayLayer.js Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (1456349) 83.75% compared to head (6a7ace5) 83.78%.

Files Patch % Lines
src/geometry/GeoJSON.js 86.36% 3 Missing ⚠️
src/layer/OverlayLayer.js 80.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2162      +/-   ##
==========================================
+ Coverage   83.75%   83.78%   +0.03%     
==========================================
  Files         169      169              
  Lines       18748    18781      +33     
==========================================
+ Hits        15702    15736      +34     
+ Misses       3046     3045       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -92,6 +92,7 @@ class Geometry extends JSONAble(Eventable(Handlerable(Class))) {
if (!isNil(id)) {
this.setId(id);
}
this.isGeometry = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isGeometry和下面的isUI,isLayer都没有用到,应该删除掉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

故意加的,方便后续快速判断一个对象是图层,是图形,还是hi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个设计不是很好,感觉更应该用 instanceof 来判断

@@ -258,6 +263,11 @@ class OverlayLayer extends Layer {
}
}
}
// geojson to Geometry may be null
if (!geo) {
console.error(geo, 'is null');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

提示也应该写成:
console.error(geo, ' is not invalid geometry to add to layer(' + this.getId() + ') at index:' + i);

@fuzhenn fuzhenn merged commit 8f04d2a into maptalks:master Jan 5, 2024
1 check passed
@deyihu deyihu deleted the 2161 branch January 5, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UIMarker Can only be added to the map
3 participants