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

[Maps] do not show circle border when symbol size is zero #62644

Merged
merged 3 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ export class DynamicSizeProperty extends DynamicStyleProperty {
}
}

syncCircleStrokeWidthWithMb(mbLayerId, mbMap) {
const lineWidth = this.getMbSizeExpression();
mbMap.setPaintProperty(mbLayerId, 'circle-stroke-width', lineWidth);
syncCircleStrokeWidthWithMb(mbLayerId, mbMap, hasNoRadius) {
if (hasNoRadius) {
mbMap.setPaintProperty(mbLayerId, 'circle-stroke-width', 0);
} else {
const lineWidth = this.getMbSizeExpression();
mbMap.setPaintProperty(mbLayerId, 'circle-stroke-width', lineWidth);
}
}

syncCircleRadiusWithMb(mbLayerId, mbMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ export class StaticSizeProperty extends StaticStyleProperty {
mbMap.setLayoutProperty(symbolLayerId, 'icon-size', this._options.size / halfIconPixels);
}

syncCircleStrokeWidthWithMb(mbLayerId, mbMap) {
mbMap.setPaintProperty(mbLayerId, 'circle-stroke-width', this._options.size);
syncCircleStrokeWidthWithMb(mbLayerId, mbMap, hasNoRadius) {
if (hasNoRadius) {
mbMap.setPaintProperty(mbLayerId, 'circle-stroke-width', 0);
} else {
mbMap.setPaintProperty(mbLayerId, 'circle-stroke-width', this._options.size);
}
}

syncCircleRadiusWithMb(mbLayerId, mbMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,11 @@ export class VectorStyle extends AbstractStyle {
setMBPaintPropertiesForPoints({ alpha, mbMap, pointLayerId }) {
this._fillColorStyleProperty.syncCircleColorWithMb(pointLayerId, mbMap, alpha);
this._lineColorStyleProperty.syncCircleStrokeWithMb(pointLayerId, mbMap, alpha);
this._lineWidthStyleProperty.syncCircleStrokeWidthWithMb(pointLayerId, mbMap);
this._iconSizeStyleProperty.syncCircleRadiusWithMb(pointLayerId, mbMap);
const hasNoRadius =
!this._iconSizeStyleProperty.isDynamic() &&
this._iconSizeStyleProperty.getOptions().size === 0;
this._lineWidthStyleProperty.syncCircleStrokeWidthWithMb(pointLayerId, mbMap, hasNoRadius);
this._iconSizeStyleProperty.syncCircleRadiusWithMb(pointLayerId, mbMap, hasNoRadius);
}

setMBPropertiesForLabelText({ alpha, mbMap, textLayerId }) {
Expand Down