Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

line-pattern, handling empty / null values #14331

Closed
tobrun opened this issue Apr 4, 2019 · 4 comments
Closed

line-pattern, handling empty / null values #14331

tobrun opened this issue Apr 4, 2019 · 4 comments
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl

Comments

@tobrun
Copy link
Member

tobrun commented Apr 4, 2019

This is an issue downstream in the annotation plugin for Android. In this plugin we use DDS in combination with a high level annotations API to make it easy for users to draw symbols, fills, lines and circles on a map.

ezgif com-video-to-gif (54)

I'm currently hitting an issue that I can't show both normal lines as lines with a pattern at the same time. This stems from how core handles empty/null values for the line-pattern property. For normal lines, we don't have a line-pattern value and for those cases we will pass a null value. If another line has a line-pattern, this will try to load the null value as line-pattern for the other lines.

Expected behavior

Core ignores null/empty value of line-pattern and will try to render using the other properties.

Actual behavior

Core tries to load the line pattern but since it's invalid it will not render anything.

@tobrun tobrun added the Core The cross-platform C++ core, aka mbgl label Apr 4, 2019
@tobrun
Copy link
Member Author

tobrun commented Apr 4, 2019

Created a minimal reproducible example in 2d91a8f#diff-b1dcccccc9ff5957b8e35726e4bb142fR97

I would expect two lines to be rendered, be only the pattern one is shown:

image

The issue seems to be that while the default value of a line pattern is { "" } and ignores it, when using a get() expression that evaluates to "", the value is treated as valid.

@tobrun
Copy link
Member Author

tobrun commented Apr 9, 2019

Validated that passing in the default value of "" to the property results in showing no lines at all.

@stale
Copy link

stale bot commented Oct 6, 2019

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Oct 6, 2019
@tobrun tobrun reopened this Oct 7, 2019
@stale stale bot removed the archived Archived because of inactivity label Oct 7, 2019
@stale stale bot added the archived Archived because of inactivity label Apr 4, 2020
@stale
Copy link

stale bot commented Apr 4, 2020

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

1 participant