Do not draw empty text styles
This fixes a rendering/flicker issue when an empty text style is decluttered together with an image style.
This commit is contained in:
committed by
Andreas Hocevar
parent
3198642cec
commit
187a216379
@@ -82,7 +82,7 @@ function renderCircleGeometry(
|
|||||||
circleReplay.drawCircle(geometry, feature);
|
circleReplay.drawCircle(geometry, feature);
|
||||||
}
|
}
|
||||||
const textStyle = style.getText();
|
const textStyle = style.getText();
|
||||||
if (textStyle) {
|
if (textStyle && textStyle.getText()) {
|
||||||
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
||||||
style.getZIndex(),
|
style.getZIndex(),
|
||||||
BuilderType.TEXT
|
BuilderType.TEXT
|
||||||
@@ -251,7 +251,7 @@ function renderLineStringGeometry(
|
|||||||
lineStringReplay.drawLineString(geometry, feature);
|
lineStringReplay.drawLineString(geometry, feature);
|
||||||
}
|
}
|
||||||
const textStyle = style.getText();
|
const textStyle = style.getText();
|
||||||
if (textStyle) {
|
if (textStyle && textStyle.getText()) {
|
||||||
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
||||||
style.getZIndex(),
|
style.getZIndex(),
|
||||||
BuilderType.TEXT
|
BuilderType.TEXT
|
||||||
@@ -285,7 +285,7 @@ function renderMultiLineStringGeometry(
|
|||||||
lineStringReplay.drawMultiLineString(geometry, feature);
|
lineStringReplay.drawMultiLineString(geometry, feature);
|
||||||
}
|
}
|
||||||
const textStyle = style.getText();
|
const textStyle = style.getText();
|
||||||
if (textStyle) {
|
if (textStyle && textStyle.getText()) {
|
||||||
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
||||||
style.getZIndex(),
|
style.getZIndex(),
|
||||||
BuilderType.TEXT
|
BuilderType.TEXT
|
||||||
@@ -320,7 +320,7 @@ function renderMultiPolygonGeometry(
|
|||||||
polygonReplay.drawMultiPolygon(geometry, feature);
|
polygonReplay.drawMultiPolygon(geometry, feature);
|
||||||
}
|
}
|
||||||
const textStyle = style.getText();
|
const textStyle = style.getText();
|
||||||
if (textStyle) {
|
if (textStyle && textStyle.getText()) {
|
||||||
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
||||||
style.getZIndex(),
|
style.getZIndex(),
|
||||||
BuilderType.TEXT
|
BuilderType.TEXT
|
||||||
@@ -349,7 +349,8 @@ function renderPointGeometry(
|
|||||||
let sharedData;
|
let sharedData;
|
||||||
if (opt_declutterBuilderGroup) {
|
if (opt_declutterBuilderGroup) {
|
||||||
builderGroup = opt_declutterBuilderGroup;
|
builderGroup = opt_declutterBuilderGroup;
|
||||||
sharedData = imageStyle && textStyle ? {} : undefined;
|
sharedData =
|
||||||
|
imageStyle && textStyle && textStyle.getText() ? {} : undefined;
|
||||||
}
|
}
|
||||||
if (imageStyle) {
|
if (imageStyle) {
|
||||||
if (imageStyle.getImageState() != ImageState.LOADED) {
|
if (imageStyle.getImageState() != ImageState.LOADED) {
|
||||||
@@ -362,7 +363,7 @@ function renderPointGeometry(
|
|||||||
imageReplay.setImageStyle(imageStyle, sharedData);
|
imageReplay.setImageStyle(imageStyle, sharedData);
|
||||||
imageReplay.drawPoint(geometry, feature);
|
imageReplay.drawPoint(geometry, feature);
|
||||||
}
|
}
|
||||||
if (textStyle) {
|
if (textStyle && textStyle.getText()) {
|
||||||
const textReplay = builderGroup.getBuilder(
|
const textReplay = builderGroup.getBuilder(
|
||||||
style.getZIndex(),
|
style.getZIndex(),
|
||||||
BuilderType.TEXT
|
BuilderType.TEXT
|
||||||
@@ -391,7 +392,8 @@ function renderMultiPointGeometry(
|
|||||||
let sharedData;
|
let sharedData;
|
||||||
if (opt_declutterBuilderGroup) {
|
if (opt_declutterBuilderGroup) {
|
||||||
builderGroup = opt_declutterBuilderGroup;
|
builderGroup = opt_declutterBuilderGroup;
|
||||||
sharedData = imageStyle && textStyle ? {} : undefined;
|
sharedData =
|
||||||
|
imageStyle && textStyle && textStyle.getText() ? {} : undefined;
|
||||||
}
|
}
|
||||||
if (imageStyle) {
|
if (imageStyle) {
|
||||||
if (imageStyle.getImageState() != ImageState.LOADED) {
|
if (imageStyle.getImageState() != ImageState.LOADED) {
|
||||||
@@ -404,7 +406,7 @@ function renderMultiPointGeometry(
|
|||||||
imageReplay.setImageStyle(imageStyle, sharedData);
|
imageReplay.setImageStyle(imageStyle, sharedData);
|
||||||
imageReplay.drawMultiPoint(geometry, feature);
|
imageReplay.drawMultiPoint(geometry, feature);
|
||||||
}
|
}
|
||||||
if (textStyle) {
|
if (textStyle && textStyle.getText()) {
|
||||||
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
||||||
style.getZIndex(),
|
style.getZIndex(),
|
||||||
BuilderType.TEXT
|
BuilderType.TEXT
|
||||||
@@ -439,7 +441,7 @@ function renderPolygonGeometry(
|
|||||||
polygonReplay.drawPolygon(geometry, feature);
|
polygonReplay.drawPolygon(geometry, feature);
|
||||||
}
|
}
|
||||||
const textStyle = style.getText();
|
const textStyle = style.getText();
|
||||||
if (textStyle) {
|
if (textStyle && textStyle.getText()) {
|
||||||
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
const textReplay = (opt_declutterBuilderGroup || builderGroup).getBuilder(
|
||||||
style.getZIndex(),
|
style.getZIndex(),
|
||||||
BuilderType.TEXT
|
BuilderType.TEXT
|
||||||
|
|||||||
Reference in New Issue
Block a user