Skip to content

Conversation

@cammace
Copy link

@cammace cammace commented Jul 17, 2017

Closes #60
Closes #55
Closes #14?

I've gone ahead and made a few changes to the traffic plugin to keep consistency across plugins and increase compatibility to all Mapbox map styles. Only issue we should resolve (@tobrun mentioned there's a better way to do this) is to change if (!(styleLayers.get(i) instanceof SymbolLayer)) into something more performant.

@cammace cammace added enhancement ready for review When your PR has been personally reviewed, its time for an external contributors to approve traffic-plugin Issues that deal with the traffic module labels Jul 17, 2017
@cammace cammace added this to the v0.2 milestone Jul 17, 2017
@cammace cammace requested review from tobrun and zugaldia July 17, 2017 22:50
}
}
}
return belowLayer;
Copy link
Member

@tobrun tobrun Jul 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+  private String getIdLayerBelow() {
+    if (belowLayer == null || belowLayer.isEmpty()) {
+      List<Layer> styleLayers = mapboxMap.getLayers();
        Layer layer;
+      for (int i = styleLayers.size() - 1; i >= 0; i--) {
          layer = styleLayers.get(i);
+        if (!(layer instanceof SymbolLayer)) {
+          return layer.getId();
+        }
+      }
+    }
+    return belowLayer;

Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit, looking good otherwise :shipit:

@cammace cammace merged commit 95a74c5 into master Jul 18, 2017
@cammace cammace deleted the cam-traffic-improvements branch July 18, 2017 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ready for review When your PR has been personally reviewed, its time for an external contributors to approve traffic-plugin Issues that deal with the traffic module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only add traffic layer above if layer exist Replace traffic.toggle() with setVisibility(boolean) Traffic Plugin add above road layer

2 participants