Skip to content

Geometry updateSymbol consider layer.style as default value when it symbol is null #2589

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 2 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/maptalks/src/core/Canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1320,9 +1320,8 @@ const Canvas = {
miny = Math.min(miny, y);
maxx = Math.max(maxx, x);
maxy = Math.max(maxy, y);

}
const width = Math.max(maxx - minx), height = Math.abs(maxy - miny);
const width = Math.abs(maxx - minx), height = Math.abs(maxy - miny);
if (width * height <= 0) {
return;
}
Expand Down
8 changes: 4 additions & 4 deletions packages/maptalks/src/geometry/Geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,10 @@ export class Geometry extends JSONAble(Eventable(Handlerable(Class))) {
const propsIsArray = Array.isArray(props);
if (!s) {
//generate defalut empty symbol
s = {};
if (propsIsArray) {
s = props.map(() => { return {} });
}
s = this._getInternalSymbol() || {};
// if (propsIsArray) {
// s = props.map(() => { return {} });
// }
}
if (!Array.isArray(s) && propsIsArray) {
//only read first element of props
Expand Down
Loading