You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the overflow menu, select Toggle Pattern. Now a pattern is shown on the line.
Select Toggle Pattern again. The pattern is not shown anymore, but at the same time, the entire line becomes invisible (even though you'd expect it to be back to its previous state, since setLinePattern(null) was called).
(There's also some unrelated crashes in there.)
I thought that this diff would fix it, but it doesn't have any effect:
diff --git a/plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/Line.java b/plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/Line.java
index c4cac02..3f47e5a 100644
--- a/plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/Line.java
+++ b/plugin-annotation/src/main/java/com/mapbox/mapboxsdk/plugins/annotation/Line.java
@@ -343,7 +343,11 @@ public class Line extends Annotation<LineString> {
* @param value constant property value for String
*/
public void setLinePattern(String value) {
- jsonObject.addProperty(LineOptions.PROPERTY_LINE_PATTERN, value);
+ if (value != null) {
+ jsonObject.addProperty(LineOptions.PROPERTY_LINE_PATTERN, value);
+ } else {
+ jsonObject.remove(LineOptions.PROPERTY_LINE_PATTERN);
+ }
}
@Override
The text was updated successfully, but these errors were encountered:
My current suspicion is that once line pattern property is set, annotationManager.enableDataDrivenProperty(LineOptions.PROPERTY_LINE_PATTERN) is called, causing layer.setProperties(linePattern(get(LineOptions.PROPERTY_LINE_PATTERN))) to be called, causing every line in the layer to expect a pattern. Hmm… I don't see a simple solution.
After a line pattern is set, it cannot be un-set anymore to get back the default stroke (i.e. a colorful line).
I made a demo inside the sample app in https://github.com/e-foundation/maplibre-plugins-android/tree/demo-line-pattern (based on https://github.com/louwers/maplibre-plugins-android/tree/update-repo). To reproduce:
setLinePattern(null)
was called).(There's also some unrelated crashes in there.)
I thought that this diff would fix it, but it doesn't have any effect:
The text was updated successfully, but these errors were encountered: