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

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Nathan Reese 2020-04-06 21:26:55 -06:00 committed by GitHub
parent 7882e0c3a8
commit 3f11d9c84b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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 }) {