-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traffic Plugin #6
Conversation
@zugaldia I found the remaining issue (not having filters setup). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the final approval up to @zugaldia, but at a high level everything looks great to me.
Traffic.java looks simple to use by itself and straightforward to customize should someone need to.
Should we update the repo's readme with installation instructions and a short code snippet around usage, or will this get out of hand as we add more plugins? Are there better ways to deal with this on Android?
My suggestion would be to add |
plugins/app/build.gradle
Outdated
@@ -20,11 +20,19 @@ android { | |||
} | |||
|
|||
dependencies { | |||
compile fileTree(dir: 'libs', include: ['*.jar']) | |||
compile fileTree(include: ['*.jar'], dir: 'libs') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line necessary at all?
} | ||
} | ||
|
||
private boolean requiresLocationPermission(String name, String category) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simply remove it?
|
||
<!-- Categories --> | ||
<string name="category">category</string> | ||
<string name="category_runtime_styling">Runtime Styling</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call it Navigation
in preparation for #12.
<string name="title_traffic">Traffic Plugin</string> | ||
|
||
<!-- Descriptions --> | ||
<string name="description_traffic">Add Traffic layer to any Mapbox basemap.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: traffic
plugins/traffic/build.gradle
Outdated
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove too?
} | ||
|
||
/** | ||
* Initialise the Traffic source and layers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: traffic
LineLayer local = TrafficLayer.getLineLayer(Local.BASE_LAYER_ID, lineColor, otherWidth, otherOffset, Local.ZOOM_LEVEL, Local.FILTER); | ||
LineLayer localCase = TrafficLayer.getLineLayer(Local.LOCAL_CASE_LAYER_ID, lineColorCase, otherCaseWidth, otherOffset, Local.ZOOM_LEVEL, Local.FILTER); | ||
|
||
// // TODO: add above highest road label instead of bridge-motorway https://github.com/mapbox/mapbox-gl-native/issues/8663 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ticket for version 0.2?
String id; | ||
for (Layer layer : layers) { | ||
id = layer.getId(); | ||
// TODO use sourceLayer filter instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ticket for version 0.2?
* Use {@link #isEnabled()} to validate if the plugin is active or not. | ||
* </p> | ||
*/ | ||
public final class Traffic implements MapView.OnMapChangedListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we call this class TrafficPlugin
instead? This could be the only convention for now, all plugins should have the Plugin
suffix.
plugins/traffic/build.gradle
Outdated
minSdkVersion 15 | ||
targetSdkVersion 25 | ||
versionCode 1 | ||
versionName "1.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's start with version 0.1 for now so that we aren't tied to SEMVER.
@tobrun Plugin is in great shape, I only added a few minor comments.
Agreed. Let's start with the basics, which is to list all the plugins in the @langsmith will be running point for the next iteration of docs and include them in the website. I'll ticket that separately. |
Rebased with master for PR with CI, review comments addressed and ready for review. |
Follow up ticket to handle the |
Closes #4