Skip to content

Commit

Permalink
[Maps] do not show circle border when symbol size is zero (#62644) (#…
Browse files Browse the repository at this point in the history
…62728)

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
nreese and elasticmachine authored Apr 7, 2020
1 parent be23954 commit 1951642
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
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

0 comments on commit 1951642

Please sign in to comment.